Use Firefox with a dark theme without triggering dark themes on websites

Published 12 January 2022 category: notes

With prefers-color-scheme, web developers can provide styles specifically for dark or light mode. Recently, Firefox started to display dark mode specific styles to users who used a dark Firefox theme, even if they have their system set to light mode.

There is a flag in Firefox that determines whether dark/light preferences are taken from the browser or from the browser theme.

This is how you set it:

  1. Go to about:config
  2. Search layout.css.prefers-color-scheme.content-override
  3. Set it to 0 to force dark mode, 1 to force light mode, 2 to set according to system’s colour setting or 3 to set according to browser theme colour

(via support.mozilla.org)

Personally, I feel respecting the system setting worked better. I hope it gets changed back. In the mean time, I hope this override helps.

Comments, likes & shares (53)

Marcus Herrmann replied: prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
Marcus Herrmann replied: prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
Marcus Herrmann replied: prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
dickelippe @ home replied: Thank you for sharing! I was kind of annoyed about that behavior for quite some time as I use both the FF Standard Edition (light theme as default) and the FF Dev Edition (dark theme) to develop and test websites...
Doug C. Hardester 👨‍💻 replied: I don’t know if I like this or not. Some people may want the app theme to be dark but not the websites themselves. Added complexity for the win.
Leave a comment
Posted a response to this?

This website uses Webmentions. You can manually notify me if you have posted a response, by entering the URL below.