Dark mode toggles: two states are enough
lea.verou.me
lea.verou.me
> When you press it for the first time, it toggles to the opposite of what you’re currently seeing, and stores the literal value (light or dark). The next time you press it, it toggles back to the system default, and removes the stored value.
The article even provides a demonstration demo: https://lea.verou.me/blog/2026/dark-mode-toggles/demo
> This article is about how to implement a good dark mode toggle, if you have already decided you need one. It does not prescribe whether one is necessary at all. If you decide to simply default to the system preference and not offer a toggle, I think that is a perfectly valid choice.