Skip to content

Commit 6f27bdb

Browse files
Add :host rule to @theme layer
Fixes #15799 Adds a `:host` selector for 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.
1 parent 86264a9 commit 6f27bdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/tailwindcss/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ async function parseCss(
473473
// Keep a reference to the first `@theme` rule to update with the full
474474
// theme later, and delete any other `@theme` rules.
475475
if (!firstThemeRule && !(themeOptions & ThemeOptions.REFERENCE)) {
476-
firstThemeRule = styleRule(':root', node.nodes)
476+
firstThemeRule = styleRule(':root, :host', node.nodes)
477477
replaceWith([firstThemeRule])
478478
} else {
479479
replaceWith([])

0 commit comments

Comments
 (0)