#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Sign up
The home for great developer writing.
We surface the best developer writing from thousands of independent blogs, updated daily.
Join Diff.blog
TOPICS
Toggle light / dark mode
·
Thiago Perrotta
·
Dec. 21, 2025, 9:35 p.m.
Light Mode
dark-mode
localStorage
theme toggling
Summary
This blog post discusses the implementation of a manual toggle for light and dark mode themes on a website, which persists the user's choice using localStorage. It contrasts this with a previous automatic setting based on system/browser preferences.
Read full post on perrotta.dev →
MORE POSTS LIKE THIS
In defense of two-state theme toggles
Josh Collinsworth ·
Aug 21, 2026
Opinion
user-interface-design
Theme selector
Tom MacWright ·
Dec 9, 2025
CSS
dark-mode
The Case for Tri-State Dark Mode Toggles
Original Content – Bram.us ·
Aug 18, 2026
CSS
dark-mode
Dark mode toggles: two states are enough
CSS-Tricks ·
Aug 17, 2026
links
dark-mode
Dark mode toggles: two states are enough [link]
Remy Sharp ·
Aug 14, 2026
UI Design
dark-mode
My new favorite Terminal
splitbrain.org - blog ·
Aug 10, 2026
terminal
Linux
Discover more posts →
AUTHOR
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub
Continue with Google