Closed Bug 1592210 Opened 2 years ago Closed 2 years ago

enabling dark theme should set ui.systemUsesDarkTheme=1 to enable dark account central etc.

Categories

(Thunderbird :: Theme, enhancement, P2)

enhancement

Tracking

(thunderbird_esr68 affected)

RESOLVED DUPLICATE of bug 1638233
Tracking Status
thunderbird_esr68 --- affected

People

(Reporter: mkmelin, Assigned: aleca)

References

()

Details

Currently if you enable the Thunderbird dark theme you still get a light account central, and some other similar pages, unless the system theme is also dark.

Setting ui.systemUsesDarkTheme = 1 makes it consistent within the application.

xref bug 1559176, bug 1559174

Since bugs you referenced have been addressed, can this piece be done now?

I'm not up on all the pieces to make this possible, but we should also make it so that plaintext email shows up white-on-black.

Flags: needinfo?(mkmelin+mozilla)

Richard, do you have any background info there? Are there reasons to do it one way or the other?

Flags: needinfo?(mkmelin+mozilla) → needinfo?(richard.marti)

Enabling ui.systemUsesDarkTheme would also apply to web content like the start page or ATN, when it would support it.
We could also try to add a new pref like mail.content.dark-mode when a dark theme is used and add to the media queries a @supports -moz-bool-pref("mail.content.dark-mode") to account central and multimesssage view.

If you want to apply the dark colours to the content (message pane, composer editor area), we maybe need to port bug 1347204.

Flags: needinfo?(richard.marti)

(In reply to Richard Marti (:Paenglab) from comment #3)

Enabling ui.systemUsesDarkTheme would also apply to web content like the start page or ATN, when it would support it.

But that sounds like something we want, no?

If you want to apply the dark colours to the content (message pane, composer editor area), we maybe need to port bug 1347204.

I see https://hg.mozilla.org/mozilla-central/rev/57eb4ec50bfb from that, but if we don't want a whitelist, that doesn't appear to be very needed, I think.

(In reply to Magnus Melin [:mkmelin] from comment #4)

(In reply to Richard Marti (:Paenglab) from comment #3)

Enabling ui.systemUsesDarkTheme would also apply to web content like the start page or ATN, when it would support it.

But that sounds like something we want, no?

Yes, but this stylesheets need to be provided from the thunderbird server.

If you want to apply the dark colours to the content (message pane, composer editor area), we maybe need to port bug 1347204.

I see https://hg.mozilla.org/mozilla-central/rev/57eb4ec50bfb from that, but if we don't want a whitelist, that doesn't appear to be very needed, I think.

Then we should set ui.systemUsesDarkTheme=1 when the dark theme is set and ui.systemUsesDarkTheme=0 when the light theme is set (to override a dark system theme)? When none of this two themes are set, we clear the pref to let the default apply.

Flags: needinfo?(mkmelin+mozilla)

Sounds like something for Alex to bite into ;)

Assignee: nobody → alessandro
Flags: needinfo?(mkmelin+mozilla)
Duplicate of this bug: 1602141
Duplicate of this bug: 1603118
Status: NEW → ASSIGNED

Hi Tim, sorry to bother you but I need a bit of direction.

I'd like to implement ui.systemUsesDarkTheme in Thunderbird in order to request dark mode for the preferences panel, account central, etc, when the user changes themes.

Is there a way to sync the ui.systemUsesDarkTheme to which theme is currently selected?
Since the themeing part comes straight from m-c, I'm not sure what to look for to change that value accordingly.

Flags: needinfo?(ntim.bugs)

Hi Alessandro, Firefox is affected by the same issue, see bug 1529323.

Implementing this in toolkit is trivial, the ui.systemUsesDarkTheme pref can be set here: https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#53-58

...except this would break the auto-switching of the default theme to the dark theme when the system theme changes, since that functionality relies itself on prefers-color-scheme: dark. What I'd do here is make @media (-moz-system-dark-theme) work differently from @media (prefers-color-scheme: dark), the former would only follow the system theme, while the latter would only follow the pref. Right now, the latter follows the pref if set, then tries to get the system theme. Emilio would probably be the best person to provide guidance on how to do this though.

Flags: needinfo?(ntim.bugs) → needinfo?(emilio)
Depends on: 1529323

This is just a dupe of bug 1529323.

Tim, shouldn't it be easier, instead of fiddling with prefs, to just use the override mechanism (which i built for devtools, but seems like it'd be applicable here as well)? That keeps @media (-moz-system-dark-theme) working as is, which is what you want, really.

emulatePrefersColorScheme allows you to tweak this on a per-document basis. We can decide whether to propagate it or not to content as needed too.

Flags: needinfo?(emilio) → needinfo?(ntim.bugs)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #12)

This is just a dupe of bug 1529323.

I agree.

Tim, shouldn't it be easier, instead of fiddling with prefs, to just use the override mechanism (which i built for devtools, but seems like it'd be applicable here as well)? That keeps @media (-moz-system-dark-theme) working as is, which is what you want, really.

emulatePrefersColorScheme allows you to tweak this on a per-document basis. We can decide whether to propagate it or not to content as needed too.

If we want bug 1529323 to apply to normal web pages as well (which I think would make sense), so effectively all documents except browser.xhtml (since it would define the browser theme based on user preference + system preference), then I'm not sure using the override mechanism all the time still makes sense. Wdyt ?

Flags: needinfo?(ntim.bugs) → needinfo?(emilio)

(In reply to Tim Nguyen :ntim from comment #13)

If we want bug 1529323 to apply to normal web pages as well (which I think would make sense), so effectively all documents except browser.xhtml (since it would define the browser theme based on user preference + system preference), then I'm not sure using the override mechanism all the time still makes sense. Wdyt ?

It's not clear it'd make sense to me, fwiw (it seems reasonable to me to want a dark firefox interface but light colors).

But anyhow yeah if you want that then the override mechanism is not great. Using the pref doesn't make sense as it's supposed to override the OS setting. We'd need a second pref or such that we could toggle, and that we'd check around here. Then the browser can tweak the pref at its will. Or something of that sort...

Flags: needinfo?(emilio)
Duplicate of this bug: 1602144
Duplicate of this bug: 1602148
See Also: → 1622695
Duplicate of this bug: 1637620
See Also: → 1638233
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1638233
You need to log in before you can comment on or make changes to this bug.