Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using adoptedStyleSheets in custom elements #10837

Closed
jfalxa opened this issue Mar 18, 2024 · 1 comment
Closed

Using adoptedStyleSheets in custom elements #10837

jfalxa opened this issue Mar 18, 2024 · 1 comment

Comments

@jfalxa
Copy link

jfalxa commented Mar 18, 2024

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 the adoptedStyleSheets array of every new instance of the custom element.

https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptedStyleSheets

Importance

nice to have

@dummdidumm
Copy link
Member

Closing as duplicate of #8988

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants