News for hackers. Stuff that matters.
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.

[0]: https://news.ycombinator.com/item?id=10453076

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.