:root { --varname: #FFE; } @media (prefers-color-scheme: dark) { :root { --varname: #022; } }
I used this on a personal project to add a README logo that is dark mode friendly: https://paul.af/github-readme-dark-mode