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

de-bloating custom-elements by using Constructable Stylesheets #8988

Open
pascalvos opened this issue Jul 18, 2023 · 0 comments
Open

de-bloating custom-elements by using Constructable Stylesheets #8988

pascalvos opened this issue Jul 18, 2023 · 0 comments
Milestone

Comments

@pascalvos
Copy link

Describe the problem

Every time a custom element with styling is created it creates a <style> tag what also adds a dom element.
Custom elements already adds more dom elements so allowing to remove one that is mostly there always would realy make a big difference in dom node creation and also performance.

if any more information needed i can help :)

Describe the proposed solution

Solution is like LIT implementing usage of Constructable Stylesheets.
Constructable Stylesheets are implementend now in every browser.
svelte beeing all about performance this would be a great step in the right direction for custom element creation with svelte

preventing an excessive DOM size: https://developer.chrome.com/docs/lighthouse/performance/dom-size/
Information on Constructable Stylesheets: https://web.dev/constructable-stylesheets/ and https://github.com/WICG/construct-stylesheets/blob/main/explainer.md

Alternatives considered

not really

Importance

would make my life easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants