Closed Bug 2011761 Opened 24 days ago Closed 3 days ago

Links in info-bars are hard to read on Win11 with dark OS color-scheme (or dark browser theme) -- dark purple on dark gray

Categories

(Core :: Widget: Win32, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- fixed
firefox147 --- wontfix
firefox148 --- fixed
firefox149 --- fixed

People

(Reporter: dholbert, Assigned: gstoll)

References

Details

Attachments

(8 files)

STR:

  1. Start Firefox on Win11
  2. Make Firefox use a dark theme, by either (a) searching Win11 settings for "Dark" and adjusting "Choose your mode: [light|dark]" in the Peronalization|Colors UI, or (b) activating Firefox's built-in "Dark" Theme.
  3. Spawn an info-bar that has links. If you happen to see the "We've introduced a new Firefox Terms of Use" info-bar, you're already there and you can skip to the last step. Otherwise you can get one on-demand by doing the following:
  4. Set about:config pref browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  5. Visit about:asrouter
  6. Do "find-in-page" (Ctrl+F) for UNIVERSAL_INFOBAR_WITH_EMBEDDED_LINKS, and click the "Show" button in that section.
  7. Look at the links in the info-bar that appears.

ACTUAL RESULTS:
The links are dark purple on a dark gray background, which is hard to read.

EXPECTED RESULTS:
Easier-to-read links (in a lighter color for better contrast).

Notes:

  • I see this locally as well as in a remote Win11 session that I spawned on BrowserStack - so I don't think this requires any specific OS/theme configuration (beyond using a dark OS-preference or browser-theme, as noted in STR).
  • If I switch to a light theme, then the links change to a nicely-contrasting blue color. So this is specific to dark themes.
  • On macOS (with dark OS color-scheme), the links are dark blue (not dark purple) -- a different color, but still rpetty hard to read on a dark gray background.
  • On Ubuntu (with dark OS color-scheme), the links are dark orange and are a bit easier to read, but perhaps contrast could still be improved...

Here's a screenshot on my Linux system, for completeness. (As noted above, this doesn't look quite as unreadable as the Windows text, but the link text is maybe a teensy bit dark.)

Attachment #9539213 - Attachment description: screenshot showing dark orange text on dark gray background → screenshot showing dark orange links on dark gray background, on Ubuntu 25.04

...and here's what I see on macOS (Tahoe 26.2).

Here's the webaim Contrast Checker assessment of the color-parings shown in my screenshots here (using the color of the underline as the foreground color, since that doesn't have any antialiasing[1] and so it gives the most consistent color-reading:

Win11: https://webaim.org/resources/contrastchecker/?fcolor=8C8CFF&bcolor=42414D
Ubuntu: https://webaim.org/resources/contrastchecker/?fcolor=EC6D40&bcolor=42414D
macOS: https://webaim.org/resources/contrastchecker/?fcolor=419CFF&bcolor=42414D

They assess all three as "Fail" for normal-sized text (which I think is the bucket for these links), under for WCAG AA and WCAG AAA guidelines.

[1] on my Ubuntu system, I have 150% pixel-scaling which messed with the antialiasing in my attached screenshot a bit - but I captured a fresh local screenshot at 100% scaling in order to read the #EC6D40 color-value for a crisp underline there.

OS: Unspecified → Windows
Whiteboard: [tos]

Sharing some of the investigation from Slack and my digging but I believe this is a larger design system issue. Infobar uses text-link from global-shared.css which maps to LinkText. And looking at the Windows fallback color for LinkText NS_RGB(0x8c, 0x8c, 0xff which maps to rgb(140, 140, 255).

(Also thank you as always for the thorough investigation and repro steps, Daniel!)

Moving this bug to the Toolkit::Themes component and removing the [tos] whiteboard tag because this bug can affect any infobar with links, not just the ToU infobar.

FWIW, Windows dark mode uses a legible blue color for "Learn more" links in Firefox settings. Should we use the same color token for links on an infobar?

Component: Messaging System → Themes
Product: Firefox → Toolkit
Whiteboard: [tos]
Component: Themes → Widget
Depends on: 1738613
Product: Toolkit → Core
Component: Widget → Widget: Win32
Assignee: nobody → gstoll
Severity: -- → S3
Status: NEW → ASSIGNED

I think Chris's suggestion in comment 6 is reasonable.

We probably want UX to sign off on this change since it also affects web content. Here's a simple test-case:

data:text/html,<meta name=color-scheme content=dark><a href="https://foo.com">before</a> <a style="color: 61DCE9" href="https://bar.com">after</a>

I think it's fine, and a bit more consistent with light mode where the link color is full blue. Jules do you know who the right person to make a call would be/

Flags: needinfo?(jules)
Attachment #9541364 - Attachment description: Bug 2011761 - make infobar links more legible in dark mode r=emilio! → Bug 2011761 - Change default dark mode link color r=emilio!

Is the change making sure our links use our actual design system link color token which actually aliases off of our accent color (blue in light mode, cyan in dark mode) which look better on our infobar's background color, instead of the OS accent? Sounds good to me, if so, I can sign this off right now. Let me know if I misunderstood, though, but I can help sign this off myself

Flags: needinfo?(jules)

This change just changes the dark mode link color to #61dc39. It looks like the current link color in light mode is #0000ee. Are these correct? Thanks!

Flags: needinfo?(jules)

Ah, so sorry didn't look at the patch and didn't realize this had to happen in a yaml and cpp file, so it can't point to a design token. That cyan used on dark mode links from our accent color should be --color-cyan-30 which converted to hex is #00cadb

Flags: needinfo?(jules)

Great, thanks! I've attached a screenshot of what this looks like for posterity.

Status: ASSIGNED → RESOLVED
Closed: 3 days ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

This seems safe enough for a Beta and ESR140 uplift request. Please nominate if you agree.

Flags: needinfo?(gstoll)

firefox-beta Uplift Approval Request

  • User impact if declined: links on infobar in dark mode are hard to see
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Just changing a color
  • String changes made/needed: no
  • Is Android affected?: yes
Attachment #9544203 - Flags: approval-mozilla-beta?

This will make infobar links more legible in dark mode.

Original Revision: https://phabricator.services.mozilla.com/D281231

firefox-esr140 Uplift Approval Request

  • User impact if declined: links on infobar in dark mode are hard to see
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Just changing a color
  • String changes made/needed: no
  • Is Android affected?: yes
Attachment #9544204 - Flags: approval-mozilla-esr140?

This will make infobar links more legible in dark mode.

Original Revision: https://phabricator.services.mozilla.com/D281231

Attachment #9544203 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9544204 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: