1 hour ago · 7 min read1425 words · Tech · hide · 0 comments

Adding a Dark Mode toggle to your website is a nice touch that many users appreciate. When implementing one, the default instinct for many developers is to reach for a simple binary switch: Light on one side, Dark on the other. While a two-state control might seem like the most straightforward solution, I firmly believe it’s flawed from a user experience perspective. Instead, we should all be using tri-state controls. Let me explain why. ~ A raised eyebrow The whole thing started about two weeks ago. While browsing through Modern Web Guidance’s guides, I noticed that the dark mode guide advises authors to use a two-state control when offering a Dark Mode toggle to their users. Use a two-state control This had me raise my eyebrow, as I strongly believe that these type of controls should be a tri-state control. Here’s what I wrote back in 2020 when I recreated a Dark Mode toggle by Josh W. Comeau using Vanilla JavaScript: 🤔 One thing that I personally find missing from Joshua’s…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.