Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Notifications
Mark all as read
Q&A

Control whether Firefox renders web pages in dark or light mode

+3
−0

It has been reported that, if on a dark theme in KDE, Firefox automatically renders some websites that support it (e.g. Duckduckgo does, but Codidact doesn't) in dark mode.

How can I better control how Firefox behaves in respect to that?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Not a general solution, but for ddg in particular, you can activate dark mode in the settings https:/... (2 comments)

1 answer

+4
−0

According to this support answer to "Home page is black",

  1. Enter about:config in the address bar.

  2. Edit the value of "layout.css.prefers-color-scheme.content-override" to

    0 to use a dark background
    1 to use a light background
    2 to follow the system GTK theme
    3 to follow the browser toolbar theme
    

Some notes:

  • The option is not documented yet.

  • It doesn't work if "privacy.resistFingerprinting" is true.

  • Since few web pages offer a dark mode, don't expect this to affect many of them. If you want to force a dark background for any page, there are several add-ons for that, for example Dark Reader and Midnight Lizard.

  • If you choose 2 and use a global dark theme on KDE, you also need to set a dark GTK theme in the settings manager (Application style > GNOME/GTK application style). Choosing only the global theme as dark will have no effect on Firefox, because the former is Qt based and the latter GTK based.

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

As alternative for darkreader, I also like `Midnight Lizard`. In my experience, midnight lizard is a ... (1 comment)

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate