3 ms·
Well, turns out you can just add style tags to the template, and they will be scoped there. It's the only way to get local CSS rules. You can also add script t
by marcosdumay 1y ago
Well, turns out you can just add style tags to the template, and they will be scoped there. It's the only way to get local CSS rules.
You can also add script tags wherever you want. They will execute when added to the DOM, but they won't be scoped.
- spankalee 1y agoStyles aren't scoped to templates. You might be thinking of shadow DOM: if you clone your template into a ShadowRoot, then any included styles will be scoped to that ShadowRoot.