Make macOS system CSS colors work for dark mode, if "force aqua" is off
Categories
(Core :: Widget: Cocoa, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
(Whiteboard: [mac:darkmode])
Attachments
(2 files)
At the moment, our CSS system colors on macOS always simulate "light mode", even when the system-wide Dark Mode is used.
When we set NSRequiresAquaSystemAppearance
to NO
(see bug 1623684), and the system-wide Dark Mode is enabled, some of the system colors change to be appropriate for dark mode. However, they do so inconsistently, and the -moz-appearance
rendering for many widget types does not consistently update with them.
In this bug I'd like to investigate how we can fix this properly. It seems like having all -moz-appearance
widgets and all relevant CSS system colors respect Dark Mode properly should be the right solution.
However, Firefox also has its own dark theme that can be toggled independently from the system-wide dark theme. How do these two themes interact? Does the Firefox dark theme not make use of any system colors? What about -moz-appearance? How does this work on Windows? How should it work?
Assignee | ||
Comment 1•4 years ago
|
||
Dão, ntim, I'm interested in your thoughts on this.
Comment 2•4 years ago
|
||
Sounds good in principle to me, since in the default situation the Firefox theme follows the system theme. We already do this type of adjustment for a few things (can’t remember what atm, my memory is still a bit fuzzy, but I’ll let you know once I remember). If possible a pref would be convenient, but if not I think we can try this for a while.
Assignee | ||
Comment 3•4 years ago
|
||
Thanks for the feedback!
Comment 4•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #0)
In this bug I'd like to investigate how we can fix this properly. It seems like having all
-moz-appearance
widgets and all relevant CSS system colors respect Dark Mode properly should be the right solution.
Yeah, that would make sense. This already works on Linux because there's no dark mode switch, instead we just detect the Gtk theme being a dark one.
However, Firefox also has its own dark theme that can be toggled independently from the system-wide dark theme. How do these two themes interact? Does the Firefox dark theme not make use of any system colors? What about -moz-appearance?
Our dark theme adjustments avoid system colors and appearances, but there are some things that it doesn't adjust, so system stuff being dark would complement our support for dark mode.
How does this work on Windows? How should it work?
Windows behaves pretty much like macOS at the moment. Afaik this is because some legacy native applications make bogus assumptions about the system theme, although this should theoretically be less of a problem on Windows since it already provided dark high contrast themes that automatically affect system colors and appearances.
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D107749
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
I looked at this again and determined that, with "force aqua" off, the CSS colors already react in exactly the way we want, i.e. like on Linux. The only missing piece here was reacting to dynamic changes. The attached patch fixes that.
Landing this patch won't make an observable difference until we stop forcing aqua, bug 1623686.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 9•4 years ago
|
||
(In reply to steve-_- from comment #5)
Does this bug cover the download dialog? if not, should I file a separate bug?
I've filed bug 1697703 about the download dialog.
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Description
•