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

Shadow DOM - POC #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Shadow DOM - POC #10

wants to merge 2 commits into from

Conversation

mahmoudmoravej
Copy link
Collaborator

@mahmoudmoravej mahmoudmoravej commented Oct 29, 2024

This PR shows that we can implement Shadow DOM inside our web elements. 🎉 We are able to load CSS files in isolation and assign them to the Shadow Element. This unblock us on using Slot, and newly added Declarative Shadow Dom .

But the main limitation is not related to Shadow Dom, but most design systems render some context inside the document.body which is not in shadow root CSS scope. This means that if a Web component renders some content outside of the Shadow Root, they will not get the Shadow Root CSS, and instead, they get the main document CSS which is a conflict.

So, to avoid complexity around it. we decided to not move forward with Shadow Elements unless we can address it and we see a huge advantage in other functionalities.


Here are some examples of Design System issues that stops them to adopt Shadow Elements:

image
image
image

ShadowDOM issues:
adobe/react-spectrum#1472
adobe/react-spectrum#2540 (comment)

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

Successfully merging this pull request may close these issues.

1 participant