3 ms·
It's been a while since I dipped into it, but Web Components use this thing called Shadow DOM to encapsulate the CSS inside from being affected by the stuff out
by arcanemachiner 3y ago
It's been a while since I dipped into it, but Web Components use this thing called Shadow DOM to encapsulate the CSS inside from being affected by the stuff outside. Great for compartmentalization, but unnecessary for my personal needs.
So if you're curious about the concept, check out Custom Elements. Same thing, but no Shadow DOM. I found them to work quite well for a toy project I made a couple years ago.
- jongjong 3y agoShadow DOM is a nice touch and in terms of isolating CSS definitions per-component, it does something beyond what most popular front frameworks can do. That said, I know some developers don't even use the shadow DOM; you can use inline styles like some people do with React or you can use a centralized stylesheet for skinning and only write barebones CSS definitions as part of components.