I’m using ViewFactory to dynamically create some views and I want to inject scoped CSS into these views. I tried using the following code but the CSS leaks to the whole DOM:
If you want your CSS not to leak “out”, you need to put it inside a shadow dom root. That’s what I was suggesting. The classes were just for having some colorful stuff for demo purposes
Tip for greater way to learn: create more Q topics
EDIT: i modifed the example a bit by adding <style> h1 { color: red } </style> to show that the style from outside won’t leak into the shadow root either