DEV Community


What's the dark mode priority should be?

nikitahl profile image Nikita Hlopov ・1 min read

From the UX perspective, what's the dark mode priority should be on a site,
localStorage or user default computer theme?

E.g. If a user has a dark theme by default (on a computer), and then the user enabled the light theme (switch on a site), then the next time the user enters a site what value should be applied (default or saved from the localStorage)?

Or have I misunderstood this whole dark mode and doing something wrong?


Editor guide
kilianvalkhof profile image
Kilian Valkhof

localStorage because that's a more direct signal specifically for your site, but you need to make sure people can also still choose "use system setting", not just toggle between light and dark. I wrote about that here: Your dark mode toggle is broken

nikitahl profile image
Nikita Hlopov Author

Wow thanks, I'll definitely check your article. 👍

tobiassn profile image
Tobias SN

The one from localStorage. The user told your site that they prefer it a certain way, keep it like that.

nikitahl profile image
waylonwalker profile image
Waylon Walker

Thinking from a perspective of mobile browsing I think it should be from the OS. Dark Mode gets triggered at the os more often on a mobile device depending on the mood, time of day, or location.