Skip to content

Commit

Permalink
fix: color mode scoping for root html element
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianCataldo committed Nov 19, 2022
1 parent 5463c5b commit 7fbbd48
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions app/ColorMode/README.md
Expand Up @@ -96,15 +96,30 @@ export default defineConfig({
Then, use it like this in your stylesheets:

```scss
span {
.my-layout {
:is(.my-link, body) {
@include color-mode(light) {
color: black;
background-color: white;
// ...
}
@include color-mode(dark) {
color: white;
background-color: black;
// ...
}
}
}

.some-class {
@include color-mode(light) {
color: black;
background-color: white;
color: blue;
background-color: yellow;
// ...
}
@include color-mode(dark) {
color: white;
background-color: black;
color: yellow;
background-color: blue;
// ...
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/ColorMode/use-color-mode.scss
Expand Up @@ -10,7 +10,7 @@
}
} @else {
@at-root [data-color-mode='#{$is}'] &,
&[data-color-mode='#{$is}'] {
[data-color-mode='#{$is}']#{&} {
@content;
}
}
Expand Down

0 comments on commit 7fbbd48

Please sign in to comment.