Ah, you have a button for the toggle! Did you know that you can conform to the user's light/dark preference with CSS? Like this:
:root { --varname: #FFE; }
@media (prefers-color-scheme: dark) {
:root { --varname: #022; }
}
Edit: To expand on this, I dislike light/dark toggles. If I have dark mode on, seeing a bright screen and having to search for a toggle is jarring. Just show me the colours according to my preference!
How can you detect the system preferences in the browser?