If you use Google Chrome (or Chromium, before anyone hisses) you may have noticed that websites you visit in it don’t respect your dark mode preference on Linux.
The window chrome totally matches, but the content of web pages and chrome://urls (which do support dark mode) don’t change.
Here’s an example in Google Chrome 112 (which at the time of writing is the most recent stable release). When I load the redesigned Flathub website with dark mode enabled on my system the website content remains light despite supporting the prefers-color-scheme
media query:
Light remains the default when loading other websites that otherwise follow dark mode preference on other operating systems, such as YouTube, Wikipedia, and this blog as of last week (sorry that took so long 😅).
The good news is that Google Chrome 114 will follow the FreeDesktop.org dark mode, rendering both chrome:// pages and websites dark (if they support it) in addition to window chrome.
Here’s the Flathub website again, this time open in Google Chrome Dev (v114.x build):
As you can see, dark mode is respected, as intended — nice! 💪
This change will benefit all Chromium-based web browsers that don’t currently follow dark mode preference for web content (though some may already carry patches to enable it – I haven’t tried in all of them) and will work on both Qt and GTK desktops.
Google Chrome 114 will hit the stable channel in a couple of months time, so if you’re not content to ride the development wave you’ll need to wait.
Of course, this isn’t an issue in other web browsers so you could, until this is fixed, use one of those.
Big thanks Albedo