Auto Dark Theme

There are a number of ways to approach a dark mode for your website, but essentially you get all the styles ready for it and then apply them when the user has indicated they want them, whether by direct …

There are a number of ways to approach a dark mode for your website, but essentially you get all the styles ready for it and then apply them when the user has indicated they want them, whether by direct choice or a system-level preference. If your website doesn’t have a dark mode, well, then, it doesn’t have a dark mode.

Chrome is testing changing that, and forcing your website to have a dark mode if a user has indicated they prefer them at the system level. André Cipriani Bandarra:

With this feature, the browser applies an automatically generated dark theme to light themed sites, when the user has opted into dark themes in the operating system. Users can opt-out of dark themes by either disabling the option on the OS level or in a specific setting in Chrome.

A little scary, I think. But hey let’s give it a test to see. They’ve built in the ability to test this right into Chrome DevTools.

Just looking at my own site quick…

Emulated dark theme on left, normal on right. 😭

The homepage looks like crap, as it didn’t flip out the explicit white background color. Not sure why, as it does on article pages where it looks much better:

The link blue feels too dark to me, but otherwise it kinda makes me want to build a real dark theme.

The WordPress admin famously has no dark mode, so here’s a look at that:

Kinda good?

I have mixed feelings about it. On one hand, users should have control over what they want to see in their browsers on their computers. Nobody is claiming accessibility features like high contrast, invert colors, or reduced motion modes shouldn’t exist. They directly affect website rendering. This could be considered an accessibility feature. On the other hand, this can cause accessibility problems (case in point: the contrast issues visible right here in that first screenshot).

This is just an Origin Trial for now, so I imagine there is plenty of time before this ships and for problems to get ironed out. But the web is huge so I imagine the edge cases here are absolutely bonkers and this is going to be very hard to perfect. It’s not even clear if this is just a Chrome-on-Android thing or if it will spread wider than that. It’s also not clear that if it leaves your site alone if you have a hand-crafted dark mode, or if it still messes with the design. Me, I’d probably use their mechanism for opt-ing out until I could get the details right.


Print Share Comment Cite Upload Translate
APA
Chris Coyier | Sciencx (2024-03-28T12:08:36+00:00) » Auto Dark Theme. Retrieved from https://www.scien.cx/2021/12/20/auto-dark-theme/.
MLA
" » Auto Dark Theme." Chris Coyier | Sciencx - Monday December 20, 2021, https://www.scien.cx/2021/12/20/auto-dark-theme/
HARVARD
Chris Coyier | Sciencx Monday December 20, 2021 » Auto Dark Theme., viewed 2024-03-28T12:08:36+00:00,<https://www.scien.cx/2021/12/20/auto-dark-theme/>
VANCOUVER
Chris Coyier | Sciencx - » Auto Dark Theme. [Internet]. [Accessed 2024-03-28T12:08:36+00:00]. Available from: https://www.scien.cx/2021/12/20/auto-dark-theme/
CHICAGO
" » Auto Dark Theme." Chris Coyier | Sciencx - Accessed 2024-03-28T12:08:36+00:00. https://www.scien.cx/2021/12/20/auto-dark-theme/
IEEE
" » Auto Dark Theme." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/12/20/auto-dark-theme/. [Accessed: 2024-03-28T12:08:36+00:00]
rf:citation
» Auto Dark Theme | Chris Coyier | Sciencx | https://www.scien.cx/2021/12/20/auto-dark-theme/ | 2024-03-28T12:08:36+00:00
https://github.com/addpipe/simple-recorderjs-demo