Brifing

Two States Are Enough for Dark Mode Toggles

Simple and effective solutions for user experience.

CSS-Tricks2 min

1The Complexity of Dark Mode Toggles

Dark mode toggles are often designed with three states (system, light, dark). However, this approach can fall short in meeting users' actual needs. Lea Verou offers a different perspective, arguing that two-state toggles can be more effective. This approach allows users to stick to system settings and override them when necessary, providing a more streamlined experience.

2Advantages of Two-State Toggles

Two-state toggles offer a more consistent experience by basing user preferences on system settings. This method saves user preferences in localStorage, ensuring they are preserved for future sessions. Additionally, this approach simplifies the user interface, providing a cleaner and more user-friendly experience.

3Managing User Preferences

Lea Verou's suggestion makes it easier for users to manage their preferences based on system settings. For example, if the system setting is in light mode and the user switches to dark mode, this preference is saved in localStorage. If the user switches back to light mode, the system setting is restored. This method allows users to manage their preferences flexibly.

4Simplifying the User Interface

Two-state toggles remove unnecessary complexity from the user interface. This approach provides a cleaner experience without distracting users from their primary goals. Three-state toggles, often seen in website headers and navigation sections, can increase cognitive load. Two-state toggles reduce this load.

5The Role of Browser Preferences

Lea Verou notes that browsers linking system preferences to web content was a significant step. However, she argues that managing these preferences in the browser would be more appropriate. In this case, three-state toggles could become more acceptable. This approach offers a more flexible solution for developers.

6Exceptions for Three-State Toggles

Lea Verou acknowledges that three-state toggles can make sense in certain scenarios. For instance, when users frequently change system settings, three-state toggles can be more useful. However, she emphasizes that these cases are exceptions and that two-state toggles are generally more effective.

7Impact on User Experience

Two-state toggles can significantly improve users' experience on websites. This approach provides a cleaner and more consistent experience without distracting users. Additionally, this method offers a simpler and more manageable solution for developers, potentially enhancing website performance.

8Future Applications

Lea Verou's suggestion could serve as an important reference point for future web design applications. Two-state toggles improve user experience while offering a more flexible and manageable solution for developers. This approach can make websites more user-friendly and performant.

Original article: CSS-Tricks — Dark Mod Geçişlerinde İki Durum Yeterli