Re: Scoped style sheets.

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 UTC