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

推荐订阅源

爱范儿
爱范儿
量子位
人人都是产品经理
人人都是产品经理
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Recent Announcements
Recent Announcements
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
H
Help Net Security
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
The Cloudflare Blog
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
Vercel News
Vercel News

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 →