Re:Reasonable System for CSS Stylesheet Structure
by octref on Tuesday November 03, 2015 @01:41PM
(#10501575)
In another comment[0] I also mentioned using Shadow DOM for modularizing CSS. However I got a comment "Shadow DOM is not the solution for CSS isolation for components." and the commenter referred me to css-modules.
I'm wondering what's the merit/advantages of using css-modules over using Shadow DOM to limit the scope of CSS rules.
Re:Reasonable System for CSS Stylesheet Structure
by Zikes on Tuesday November 03, 2015 @01:54PM
(#10501666)
Shadow DOM enforces CSS isolation incidentally, but is also part of the larger "web components" plan, which would also incorporate CSS modules.
In these cases you would fully encapsulate CSS, HTML, and JS on a per-component basis.
[0] https://w3c.github.io/webcomponents/spec/shadow/