Skip to content

Commit f943d8d

Browse files
committed
Fixed theme switcher not working on light mode system
1 parent 28cf387 commit f943d8d

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

style.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,12 @@ section > .button-group:last-child {
229229
/* Magic */
230230
:root:has(#theme-toggle:checked) {
231231
color-scheme: dark;
232-
background-color: var(--light-bg);
233-
color: var(--light-text);
234-
--inv-bg: var(--dark-bg);
235-
--inv-text: var(--dark-text);
232+
background-color: var(--dark-bg);
233+
color: var(--dark-text);
234+
--inv-bg: var(--light-bg);
235+
--inv-text: var(--light-text);
236236
}
237+
237238
@media (prefers-color-scheme: dark) {
238239
:root {
239240
background-color: var(--dark-bg);
@@ -243,6 +244,10 @@ section > .button-group:last-child {
243244
}
244245
:root:has(#theme-toggle:checked) {
245246
color-scheme: light;
247+
background-color: var(--light-bg);
248+
color: var(--light-text);
249+
--inv-bg: var(--dark-bg);
250+
--inv-text: var(--dark-text);
246251
}
247252
}
248253

0 commit comments

Comments
 (0)