W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: Scoped style sheets.

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 15 Jul 2008 07:17:19 +0000 (UTC)
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: David Hyatt <hyatt@apple.com>, Lachlan Hunt <lachlan.hunt@lachy.id.au>, www-style <www-style@w3.org>
Message-ID: <Pine.LNX.4.62.0807150715200.12994@hixie.dreamhostps.com>

On Mon, 14 Jul 2008, Andrew Fedoniouk wrote:
>
> Normal specificity rules will simply not work.
> To be able to overweight global styles you will end
> up with something like this:
> 
> <style>
>   body.foo #content p { color:red; }
> </style>
>  <body>
>    <div #content>
>      <style scoped>
>          body.foo #content p { color:green; }
>      </style>
>      <p>what would be the color of this text?</p>
>   </div>
> </body>

I don't think this is really realistic. If <div id="content"> is imported
from another source, why would the doc style sheet attempt to style it if 
the importing source is going to override it?

In fact, I'd suggest that it's the parent doc that is the one that is 
going to want to override styles. For that, this mechanism works fine.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 15 July 2008 07:17:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT