Skip to content

Commit

Permalink
Fix CSS scoping for CSS variables
Browse files Browse the repository at this point in the history
```
:root {
  --color: red;
}

label {
  color: var(--color);
}
```
  • Loading branch information
sonnyp committed Jun 3, 2024
1 parent a4e1163 commit e9748dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Previewer/Internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function scopeStylesheet(style, id) {
for (const node of ast.nodes) {
if (node.selector === "window") {
node.selector = `#${id}`;
} else if (node.selector) {
} else if (!node.selector.startsWith(":")) {
node.selector = `#${id} ${node.selector}`;
}
}
Expand Down

0 comments on commit e9748dd

Please sign in to comment.