Wednesday, 07 June 2006 at 00:11
Back in April a large number of web developers participated in a drive to raise awareness about web standards, basically by throwing away all of the fancy styling for a day and exposing the bare HTML underneath. The idea behind this is that it should all still be perfectly readable and navigable, if not quite so pretty.
A number of PHP scripts were made available for various content management systems, but none were for the Textpattern CMS. So I twiddled the scripts a bit and you can download one for yourself a little lower down the page.
“It’s time to get naked, people! Time to strip off all your decorative layers and reveal your white bits (or whatever your default background colour might be) in the first CSS Naked Day".
“Ian Lloyd”:http://www.webstandards.org/about/members/lloydi/, Web Standards Project, April 3rd 2006 :: Link
So that’s the idea!
But… why?
So why exactly would you want to do this? If you’re a web standards junkie then you may already know, but it’s basically to show everyone the benefits of seperating the content of a site from its presentation. There are many sites out there that are poorly written from an accessibility point of view, or use old table-based layout techniques that can mush up the proper structure of the HTML underneath: and that’s the part which actually carries the content of the site. This content can become hidden by the design, leading to sites that can be unusable for people not using ‘standard’ browsers.
What this means is that people with visual impairments may be prevented from using screen readers or braille output devices. People browsing on mobile phones can’t read the pages. Search engines can’t seperate what the page is saying from how it’s trying to present the words. Basically, what is being said is lost amongst the code.
That’s why organisations like the Web Standards Project get behind ideas like this, and it’s why designers who want an accessible web write our sites the way we do. Not just so you can get a good rank on Google (although it can help), but so anyone with any browser can access the information.
This journal isn’t going to be a web standards rant, but if you don’t already know the benefits, check out the FAQ here on the Web Standards Project site. Section 3 tells you about some of the benefits.
Getting Involved
If you’d like to hop on board the naked bandwagon next time around you can pop over to the CSS Naked Day site and check out how to participate. Stephen Clay and Luke Wertz have created some PHP for WordPress and standalone sites, but if, like me, you use TextPattern I’ve mushed the two together and come up with this if you just want to be naked for 24 hours in your own country:
< txp:php>
$NakedDay_Today = (date('dm')=='0504');
if($NakedDay_Today) {
?>
<link rel="stylesheet" href="<txp:site_url />css/naked.css" type="text/css" media="screen" />
<?php }
if(!$NakedDay_Today) {
?>
<link rel="stylesheet" href="<txp:site_url />css/normal.css" type="text/css" media="screen" />
<?php }
< /txp:php>
Download in .txt format.
Or this if you want to be naked for 48 hours so the whole world can see:
< txp:php>
$start = date('U', mktime(-12,0,0,04,05,date(Y)));
$end = date('U', mktime(36,0,0,04,05,date(Y)));
$now = time();
if ( $now >= $start && $now <= $end ) {
?>
<link rel="stylesheet" href="<txp:site_url />css/naked.css" type="text/css" media="screen" />
<?php }
else {
?>
<link rel="stylesheet" href="<txp:site_url />css/normal.css" type="text/css" title="" media="screen" />
<?php }
< /txp:php>
Download in .txt format.
Grab the files from the links (the TXP tags are slightly munged in the display versions) and just replace your usual stylesheet links with one of these and edit the paths to suit. This way you won’t forget when it comes around again!