:root {
color-scheme: light dark;
--text: light-dark(#000, #FFF);
--bg: light-dark(#EEE, #242936);
}
Hmm, I guess the advantage of that over
@media (prefers-color-scheme: dark) {
/*set different values for variables*/
}
is that you can set the color scheme via a button much more easily then.
Had to think about that for a moment, because the old way of doing things seemed fine, but that is a pretty good reason, I guess.