惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
小众软件
小众软件
The Cloudflare Blog
S
SegmentFault 最新的问题
美团技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网
WordPress大学
WordPress大学
T
Tailwind CSS Blog
腾讯CDC
人人都是产品经理
人人都是产品经理
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence
D
DataBreaches.Net
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
J
Java Code Geeks
宝玉的分享
宝玉的分享

CSS-Tricks

Let’s Use the Emergent CSS random() Function in all the Browsers | CSS-Tricks What’s !important #18: <geolocation>, Syntax ::highlight()ing, named-feature(), and More | CSS-Tricks Creating Web Widgets Using the Document Picture-in-Picture API | CSS-Tricks animation-trigger | CSS-Tricks MicroLighter: Syntax Highlighter | CSS-Tricks WordPress PHP-Only Block Registration | CSS-Tricks Resolved: CSS Class Prefix Selector | CSS-Tricks CSS Navigation Matching, Early Days | CSS-Tricks WordPress.com Student Plan | CSS-Tricks What’s !important #17: Custom Highlight API, CSS Navigation Matching, Fixing text-stroke, and More | CSS-Tricks Blocked aria-hidden: The Warning is Right, and Every Fix You've Found is Wrong | CSS-Tricks Animating CSS border-image | CSS-Tricks SmashingConf Freiburg 2026, September 7-10 | CSS-Tricks Using and Styling the Dialog Element | CSS-Tricks 2026 State of CSS, Devs Surveys | CSS-Tricks Gap Decorations Are Now Available, Here’s What’s New | CSS-Tricks What’s !important #16: sibling-index() Animations, Use Cases for the infinity Keyword, Container Stuck Queries, and More | CSS-Tricks writing-mode | CSS-Tricks pointer-events | CSS-Tricks What’s !important #15: Boundary-aware CSS, Time-based CSS, Full-bleed CSS, and More | CSS-Tricks Get Ready For the Powerful CSS border-shape Property! | CSS-Tricks What’s !important #14: Gap Decorations, random(), <select> field sizing, and More | CSS-Tricks The Shifting Line Between CSS States and JavaScript Events | CSS-Tricks translateZ() | CSS-Tricks translateY() | CSS-Tricks translateX() | CSS-Tricks translate() | CSS-Tricks Using Scroll-Driven Animations for Opposing Scroll Directions | CSS-Tricks A First Look at Scroll-Triggered Animations | CSS-Tricks The Siren Song of  ariaNotify() | CSS-Tricks
Dark mode toggles: two states are enough | CSS-Tricks
Geoff Graham · 2026-08-17 · via CSS-Tricks

Exactly the kind of nerdy UI/UX discussion I love:

Lea’s pushing back on light/dark mode implementations that display three state options for visitors:

  • Light
  • Dark
  • System (core of the debate)

Why show a System option at all when:

[…] a good two state control can actually express all three states — users just need to apply the override the first time it becomes relevant.

The first figure succinctly illustrates the point:

In short: No preference? Fall back to the system settings and provide a setting to override that if that’s needed/preferred. Then that preference is stored in localStorage for future sessions.

Something I sorta missed the first time I saw the image is that perhaps we don’t even need to display two states when we know what color scheme is active:

  • Light by default? Show a Dark option to override that.
  • Dark by default? Show a Light option to override that.

Personally, I’m convinced. Less UI that accomplishes the same as more UI is generally a good thing. Lea’s point goes way beyond that, getting into well-considered reasons that go beyond simplicity.

An interesting consideration is what happens when toggling back to a state. Like, if we start with a Light system preference, toggle it to Dark, then back to Light. Do we get a new override preference or go back to the system setting would be an undefined localStorage value? Maybe it doesn’t matter because theme switching isn’t exactly the primary user intent:

Remember, this control is entirely tangential to the actual user goal for visiting the website. Even if their intent were to pin light instead of reverting to System (light), this is something they would only notice once these diverge, i.e. the OS switches to dark. At that point, fixing it is a single click away. It’s such an easy fix, that there is no point in dwelling on it further.

To be clear, Lea is referring to persistent UI. The guidance is targeting toggles that are always visible to the visitor. That’s really, really common in a site’s header/navigation (my personal site included). If that’s the pattern, then it could distract from the visitor’s primary intent. And the more options we see, the more cognitive dissonance is introduced.

I think there’s an even more compelling argument in the thread:

Yes, please! Development for the preference, but no need to show an override when the setting is in the browser itself. Then a tri-state toggle might be more acceptable.

Speaking of which, Lea does offer two scenarios where three states make sense:

  1. Color scheme setting that lives a separate settings panel (i.e., the toggle is in a completely different context that isn’t interfering with the visitor’s primary intent)
  2. When color schemes are implemented differently depending on the system setting (i.e., more than two color schemes are offered )

Worth the full read, if you ask me!

Direct Link →