Skip to content

Commit f159ad0

Browse files
author
DESKTOP-939248N\apple
committed
fix: css issue
1 parent 9b698cd commit f159ad0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/test.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
}
3737

3838
@media (prefers-color-scheme: dark) {
39-
:not([theme="light"]) .background\:black\:dark {
40-
background: black;
39+
html:not([theme="light"]) *.background\:black\:dark {
40+
background: red;
4141
}
42-
:not([theme="light"]) .color\:white\:dark {
42+
html:not([theme="light"]) *.color\:white\:dark {
4343
color: white;
4444
}
4545
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const makeRuleForTheme = (className) => {
129129
[style, value, theme] = className.split(':');
130130
if (theme == 'dark' || theme == 'light') {
131131
let rule = '[theme="' + theme + '"] .' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}';
132-
let reverseRule = ':not([theme="' + themes[1 - themes.indexOf(theme)] + '"]) .' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}';
132+
let reverseRule = 'html:not([theme="' + themes[1 - themes.indexOf(theme)] + '"]) *.' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}';
133133
tempStyleList.push(rule);
134134
themeCSS[theme].push(reverseRule);
135135
return rule;

0 commit comments

Comments
 (0)