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

Published 2022-01-12 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 (56)

knut (in SF 🌉), Robert Spier, Alan Dávalos, Jan Maarten, Michelle Barker, Marijn - ActiveB1t, Web Axe, Tim Kraut, Geoff Rich, Jens Grochtdreis, J O N, Károly Szántai, Ahmad Nasr, dovyden, jason kunesh, Nikki, Stefan Galescu, Savvas Stephanides, Lars Roettig, Jorge Rumoroso, Dannie Vinther, Germán Freixinós López, Jan Hoek, Rizkania, Alexander Skogberg, Meagan Eller, Alicia Jarvis (She/Her/Elle), CPACC, CSM 🇨🇦💜, Jonathan McNamara, Jen Gorfine, Den, 𝔇𝔢𝔳𝔢𝔩𝔬𝔭𝔢𝔯 | 𝔓𝔯𝔬𝔤𝔯𝔞𝔪𝔪𝔢𝔯 | 𝔖𝔈𝔒, Masataka Yakura, Aleks Totic, Smashing Magazine 🇺🇦, Amelia Bellamy-Royds and Ingo Steinke, creative web dev liked this

Marijn - ActiveB1t, Deborah Edwards-Oñoro, Gunnar Bittersmann, SELFHTML, Eric Bailey, Jorge Rumoroso, Bramus, Germán Freixinós López, Brian Hinton 🐧, Meagan Eller, Alicia Jarvis (She/Her/Elle), CPACC, CSM 🇨🇦💜, Jayne Cravens Coyote Communications, 𝔇𝔢𝔳𝔢𝔩𝔬𝔭𝔢𝔯 | 𝔓𝔯𝔬𝔤𝔯𝔞𝔪𝔪𝔢𝔯 | 𝔖𝔈𝔒, Šime (she-meh) 🦊 and Alan Dávalos reposted this

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.