▲ | marcosdumay 2 days 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 2 days ago | parent [-] | |
Styles 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. |