#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Privacy
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.
dark-mode
localStorage
Light Mode
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
Two vs. Three-State Color Theme Toggles
Frontendmasters ·
Sep 3, 2026
The Beat
CSS
Don't use a dark-light toggle at all
Edwin Martin’s weblog ·
Aug 25, 2026
user-experience
dark-mode
In defense of two-state theme toggles
Josh Collinsworth ·
Aug 21, 2026
Opinion
ux-design
Theme selector
Tom MacWright ·
Dec 9, 2025
Web Development
CSS
The Case for Tri-State Dark Mode Toggles
Original Content – Bram.us ·
Aug 18, 2026
Original Content
CSS
Dark mode toggles: two states are enough
CSS-Tricks ·
Aug 17, 2026
links
dark-mode
Discover more posts →
AUTHOR
Advertise
Sponsor diff.blog
Put your product in front of developers who read and write about their craft. One exclusive sponsor at a time.
Become a sponsor →
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub
Continue with Google
By continuing, you agree to our
Privacy Policy
.