[whatwg] A link[scoped] usecase

Leif Halvard Silli xn--mlform-iua at xn--mlform-iua.no
Fri Mar 2 18:33:21 PST 2012


Gray Zhang on Fri, 02 Mar 2012 10:58:32 -0800:
> By now, for the reason that there is not link[scoped] and style[scoped] is
> not supported for any browser, my solution is add a data-theme attribute on
> wrapper element, and the theme .css file should add some extra selector:
> 
> .visual-root[data-theme="fireworks"] {
>     background-color: #404040;
>     color: #addede;
> }

Until support is available, would this help?

   <style scoped id=uniqueID >
      #uniqueID + .visual-root {style}
      #uniqueID + .visual-root * {style}
   </style>
   <div class='visual-root'></div>

At the very least, what this stylesheet will style, depends on which 
exact *.visual-root element you place it adjacent to.
-- 
Leif Halvard Silli



More information about the whatwg mailing list