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.