Closed Bug 1740089 Opened 3 years ago Closed 3 years ago

Centralize dark/light theme decisions and provide reasonable fallback when toolbar color isn't set.

Categories

(Firefox :: Theme, task)

task

Tracking

()

RESOLVED FIXED
Tracking Status
firefox96 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(5 files)

STR:

ER:

  • Toolbar-color should probably be considered light since it does provide a frame color.

AR:

  • Toolbar color is not there, so we fall back to "system", which might be dark and look a bit off.

The code caught my attention because it broke my editor's syntax
highlighting. This should be more correct.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

After the previous patches all this should be unnecessary.

Flags: needinfo?(richard.marti)
Flags: needinfo?(alessandro)

(I ni?d because I can't r?)

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c9f35164a4f Use CSS.escape to escape URIs in LightweightThemeConsumer. r=desktop-theme-reviewers,harry https://hg.mozilla.org/integration/autoland/rev/ac810bf14fd5 Centralize theme computation in LightweightThemeConsumer. r=desktop-theme-reviewers,harry https://hg.mozilla.org/integration/autoland/rev/a4546a4b8991 Fall back to frame (accentcolor) to determine toolbar theme. r=desktop-theme-reviewers,harry

Backed out for causing bc failures on browser_ext_browserAction_theme_icons.js.

The affected platforms are Linux 18.04 x64 WebRender opt and debug.

Push with failures

Failure log

Backout link

Flags: needinfo?(emilio)

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

Created attachment 9249840 [details] [diff] [review]
comm-central cleanup

After the previous patches all this should be unnecessary.

I'll let Alessandro make the review as it is his code that's changed.

Flags: needinfo?(richard.marti)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f5bbb34d94f7 Use CSS.escape to escape URIs in LightweightThemeConsumer. r=desktop-theme-reviewers,harry https://hg.mozilla.org/integration/autoland/rev/9a5d45e4cf07 Centralize theme computation in LightweightThemeConsumer. r=desktop-theme-reviewers,harry
Keywords: leave-open
Depends on: 1740230

Maybe is due to D130670 not in m-c yet, but this patch doesn't work unfortunately.
Switching to dark theme doesn't properly update the in-content style (prefs, account settings, account setup, etc.). Partial sections of the UI and other pages are not properly updated with an hybrid state of light text and light bg.

Thanks for thinking about us and keeping us in the loop :D

Flags: needinfo?(alessandro)

Well the other two patches aren't in central either so that's not too surprising. After that happens it should work :)

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

Well the other two patches aren't in central either so that's not too surprising. After that happens it should work :)

I'm not a smart man, I didn't see it was on autoland but not on m-c.
I'll circle back to this and test it again, thanks and sorry for noise.

Flags: needinfo?(alessandro)
Comment on attachment 9249840 [details] [diff] [review] comm-central cleanup Review of attachment 9249840 [details] [diff] [review]: ----------------------------------------------------------------- This is perfect! Tested this on Linux, Windows, and macOS, and everything works as expected. The dark/light theme variation properly updates both chrome and content, and the auto theme properly follows the OS themeing. Thank you so much for doing this.
Attachment #9249840 - Flags: review+
Flags: needinfo?(alessandro)

Emilio, can I mark this for checkin-needed-tb only for the patch you made for TB?

I suppose? I can push it otherwise I guess :)

Flags: needinfo?(emilio)
Depends on: 1741666
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30ef1f19b746 Fall back to frame (accentcolor) to determine toolbar theme. r=desktop-theme-reviewers,harry
Regressions: 1741726
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Can you push the comm-central cleanup patch attached to this bug?

Flags: needinfo?(rob)
Flags: needinfo?(rob)
Flags: qe-verify+
Attached image screenshot

Hello Emilio! I'm having some trouble reproducing the issue with Firefox 96.0a1 (20211108214919) on Windows 10x64, macOS 10.15, and Ubuntu 21.1. For me when installing the theme provided in comment 0, the toolbar color is white as well on the affected build even if the system color is dark.

Am I doing something wrong here? Attached screenshot of Windows 10x64 with the affected and fixed build.

Or maybe could you verify the fix on the latest beta if you have the time? Thank you in advance.

Flags: needinfo?(emilio)

The toolbar is always, light, but before the patch we choose a dark color for content (erroneously). With the theme installed both the UI and the content color (i.e., about:support backgrounds etc) should be light.

Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: