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

Use :host rule instead of :root for @theme layer #15972

Closed
wants to merge 2 commits into from

Conversation

hugo-vrijswijk
Copy link
Contributor

Fixes #15799

This replaces the :root selector with :host in the @theme layer. This is necessary for the @theme layer to work correctly in shadow DOM.

Also updates the snapshots for the tests that were affected by this change (in a separate commit).

Fixes tailwindlabs#15799

This replaces the `:root` selector with `:host` in the `@theme` layer. This is necessary for the `@theme` layer to work correctly in shadow DOM.

Also updates the snapshots for the tests that were affected by this change (in a separate commit)
@hugo-vrijswijk hugo-vrijswijk requested a review from a team as a code owner January 28, 2025 15:01
@adamwathan
Copy link
Member

Hey! This appears to break all theme variables in the framework when used regularly without the shadow DOM:

https://play.tailwindcss.com/255UWngh2x?file=css

So going to close this one as-is, but welcome to open a PR that uses :root, :host { ... } instead which I think would work.

@adamwathan adamwathan closed this Jan 28, 2025
@hugo-vrijswijk
Copy link
Contributor Author

Hey! This appears to break all theme variables in the framework when used regularly without the shadow DOM:

https://play.tailwindcss.com/255UWngh2x?file=css

So going to close this one as-is, but welcome to open a PR that uses :root, :host { ... } instead which I think would work.

@adamwathan see #15975

@hugo-vrijswijk hugo-vrijswijk deleted the host-root branch January 28, 2025 15:47
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.

tailwindcss and shadow dom not working well (--spacing)
2 participants