You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing around with the svelte custom element API, and I was wondering if instead of inlining a new style element to every shadow DOM instance, you could use the shadowRoot.adoptedStyleSheets property.
Describe the proposed solution
Basically, it requires creating one instance of a CSSStyleSheet per component, setting its content with the component's CSS, and then referencing this single sheet inside the adoptedStyleSheets array of every new instance of the custom element.
Describe the problem
I'm playing around with the svelte custom element API, and I was wondering if instead of inlining a new style element to every shadow DOM instance, you could use the
shadowRoot.adoptedStyleSheets
property.Describe the proposed solution
Basically, it requires creating one instance of a
CSSStyleSheet
per component, setting its content with the component's CSS, and then referencing this single sheet inside theadoptedStyleSheets
array of every new instance of the custom element.https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptedStyleSheets
Importance
nice to have
The text was updated successfully, but these errors were encountered: