[whatwg] <nostyle> consideration

Ian Hickson ian at hixie.ch
Sun Jul 12 21:08:43 PDT 2009


On Mon, 15 Jun 2009, Thomas Powell wrote:
>
> Proposing <nostyle> in the spirit of <noscript>

The idea of <style> is that it be completely optional, i.e. that the page 
be as correct without the styles as with (though styles can make a page 
more usable).

Providing <nostyle> would run counter to this philosophy.


> Examples
> --------
> 
> 1) Head Usage
> 
> <nostyle>
>  <meta http-equiv="Refresh" content="0;url=/errors/stylerequired.html">
> </nostyle>
> 
> 
> 2) Body Usage
> 
> <nostyle>
>  <h2>Warning: Styles required for correct rendering</h2>
> </nostyle>

Both of these examples show a lack of understanding of the point of CSS. :-)


> The Obvious Push Back
> ---------------------
> 
> Why bother? You can just do this
> 
> .nostyle {display: none;}
> 
> <h2 class="nostyle">Warning: Styles required for correct rendering</h2>

This also misses the point of CSS. You should never _need_ the CSS.


> For example, using the content property can be somewhat troubling if
> style is removed.

The 'content' property should only be used for stylistic additions, not 
anything that is important.


> For example, consider what happens if you are putting in field required 
> indicators
> 
> input[type=text].required:before {content: " (*) "}

Using the required="" attribute, the user agent is able to mark required 
fields even with CSS disabled.


> or for offsite links
> 
> a[href^="http://"]:after {content:' ( Offsite Link )';}
> 
> or any other dynamic insert this way.

The latter isn't needed for the page to be usable, so if CSS isn't 
available, just do nothing. (The user agent can put in these annotations 
manually if desired by the user.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list