The prefers-color-scheme is rather essential for pegging your css to the user's system theme, but the :root pseudo class and even the custom properties / variables could be left out - although that'd mean nesting all your css within those media queries 😉
I'm a web sysop and support engineer. My skills are mainly in back-end: Java, Linux, Python, PostgreSQL, Git, and GitLab. Currently I'm learning front-end skills: JavaScript, and Ruby.
Here's a compatibility overview for the three major components to this implementation: caniuse.com/prefers-color-scheme,c...
The
prefers-color-scheme
is rather essential for pegging your css to the user's system theme, but the:root
pseudo class and even the custom properties / variables could be left out - although that'd mean nesting all your css within those media queries 😉I use a static blog generator with a light theme that I have overridden by hand. Now with this idea I can just wrap my overrides in the media query.
Sweet!