W3C home > Mailing lists > Public > www-style@w3.org > March 2012

<style scoped> and the cascade

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 07 Mar 2012 01:37:27 -0500
Message-ID: <4F570227.8060707@mit.edu>
To: HTML WG <public-html@w3.org>
CC: www-style list <www-style@w3.org>
I've been looking into scoped stylesheets, and I'm not sure that the way 
the spec currently places them in the CSS cascade makes sense.  If the 
intent is for them to be used for styling a particular subtree, it seems 
like they should probably come later than global document sheets in the 
cascade; otherwise you can end up with global sheets accidentally 
overriding scoped styles, which makes it difficult to really use scoped 
styles effectively.

Of course the counterargument could be made that the opposite behavior 
would disallow document-global sheets from "fixing up" problems from 
scoped styles.

Perhaps the cascading order should be:

   document normal rules
   scoped normal rules
   scoped !important rules
   document !important rules


ccing www-style, but this discussion should probably happen on the 
htmlwg list, since that's where scoped styles are defined...

Received on Wednesday, 7 March 2012 06:38:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:13 UTC