[whatwg] A link[scoped] usecase

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

Received on Friday, 2 March 2012 18:33:21 UTC