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

[Declarative Shadow DOM Style Sharing] Suggestions for improving problem statement #889

Open
sorvell opened this issue Oct 10, 2024 · 0 comments

Comments

@sorvell
Copy link

sorvell commented Oct 10, 2024

The main issues with using <style> in declarative Shadow DOM (DSD) are:

  1. It's not equivalent to adopting a stylesheet since the sheet is not shared between different shadowRoots. A shared sheet can be modified and any shadowRoots in which it's adopted are automatically updated. There is currently no way to do this with DSD
  2. Identical styling must be re-emitted as HTML as many times as it's used. This bloats the HTML size of the document. Some of the cost can be easily mitigated via compression and also since browsers likely optimize actual creation of stylesheets. However, the strings must be decompressed and parsed and this adds needless extra work.
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

1 participant