by rektide · 3y ago · 0 comments
I think this should all work outside <template> tags. Re-remembering how they worked slowed down my comprehension some. The MDN article[2] was a solid refresher.
[1] https://nolanlawson.com/2023/01/17/my-talk-on-css-runtime-pe...
[2] https://developer.mozilla.org/en-US/docs/Web/Web_Components/...
Also, it's still possible to shoot yourself in the foot, especially if you have a large/complex stylesheet repeated across multiple shadow roots. (Not because of the repetition – that's optimized in browsers [1] – but rather because of the number of DOM nodes affected.)
That said, I still think the perf benefits of shadow DOM have been undersung. And Declarative Shadow DOM makes it way more useful.
[1]: https://github.com/whatwg/dom/issues/831#issuecomment-585489...