W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2012

[whatwg] A link[scoped] usecase

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Sat, 3 Mar 2012 03:33:21 +0100
Message-ID: <20120303033321997228.57a8a5d2@xn--mlform-iua.no>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:40 UTC