trying add variable for dark mode with prefered theme and "dark" class.q

Currently what I am doing is using declaring same variable twice for each condition can i do this better.
:root {
--background: 240 5% 96%;
}

@media (prefers-color-scheme: dark) {
:root {
--background: 0 3% 6%;
}
}

.dark {
--background: 0 3% 6%;

}
:root {
--background: 240 5% 96%;
}

@media (prefers-color-scheme: dark) {
:root {
--background: 0 3% 6%;
}
}

.dark {
--background: 0 3% 6%;

}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server