DEV Community

Nikita Hlopov
Nikita Hlopov

Posted on

What's the dark mode priority should be?

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?

Top comments (5)

Collapse
 
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

Collapse
 
nikitahl profile image
Nikita Hlopov

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

Collapse
 
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.

Collapse
 
nikitahl profile image
Nikita Hlopov

Thanks! 👍

Collapse
 
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.