W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] <nostyle> consideration

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 13 Jul 2009 04:08:43 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0907130401570.23663@hixie.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 12 July 2009 21:08:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC