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

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 (56)

dickelippe @ home wrote on 12 January 2022:
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...
Marcus Herrmann wrote on 12 January 2022:
prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
Marcus Herrmann wrote on 12 January 2022:
prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
Marcus Herrmann wrote on 12 January 2022:
prefers-reasonable-firefox-behaviour-regarding-dark-mode 👇
Doug C. Hardester 👨‍💻 wrote on 13 January 2022:
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.