4 ms·
Shadow DOM[0] is a big step in the right direction, as well. [0] https://w3c.github.io/webcomponents/spec/shadow/ https://w3c.github.io/webcomponents/spec/shad
by Zikes 11y ago
Shadow DOM[0] is a big step in the right direction, as well.
[0] https://w3c.github.io/webcomponents/spec/shadow/ https://w3c.github.io/webcomponents/spec/shadow/
- octref 11y agoIn 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 https://news.ycombinator.com/item?id=10453076
- Zikes 11y agoShadow 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.