Firefox Flatpak doesn't properly forward system theme to websites

Hey everyone,
I’m using the Flatpak version of Firefox on Fedora and I’ve noticed a pretty annoying issue regarding system theme detection.

Here’s what’s happening:

  • Firefox itself does respond to the system theme (light/dark) — the UI updates correctly.

  • But web content does not. Websites that rely on prefers-color-scheme don’t switch themes accordingly.

For example:

  • WhatsApp Web always appears in light mode.

  • Dark Reader (set to “follow system theme”) behaves inconsistently — it only detects the correct theme in the active tab, but new tabs open in the wrong theme.

Is there any workaround for this? Note that rpm version of firefox is fine but i do want to use the flatpak version from flathub.

This is most likely due to sandboxing and permissions. If something isn’t picking up the system theme, you need to give it permission to do so either via the command line with sudo flatpak override [application-id] --env=GTK_THEME=[theme] or by using a graphical tool like Flatseal. Back when I was using Silverblue, I preferred the Flatseal method.

I’m not sure how to deal with web content that rely on prefers-color-scheme though as I am boring and keep everything light themed.

Did you enable resist-fingerprint?

1 Like

I am using Firefox as Flatpak from Flathub on Silverblue, and I don’t have such issues (taking this discussion page as an example).

So it must be something else in the settings. Maybe what @yuntaz is suggesting.

What theme are you using? Fedora Flatpak only ships GTK themes for adw-gtk3 and breeze. If you’re using any other theme, you’ll need to grant apps access to xdg-data/themes (and actually have your themes in there, not someplace like /usr/share/themes).

Setting GTK_THEME is a bad idea. That breaks the look Libadwaita apps.

Good shout, I’d forgotten about this despite the fact I need to set finger printing protection in Firefox to only in private windows for alternative language fonts. Otherwise if I enable finger printing protection in all windows, it blocks said fonts.

Noted. Although I’m surprised. I usually just ls the /usr/share/themes folder and then added “Adwaita” to the GTK_THEME argument when doing it by command line. Had no issues. Though as I said above, I preferred the Flatseal method since I didn’t have to remember a bunch of command line stuff. Same with installing gnome-tweaks on Silverblue, so I wouldn’t have to remember the command line strings just to centre new windows and add window buttons.