Differential D296488
Bug 2034940 - Fix contrast on "Let's go" button disabled state in AI window firstrun. r=#ai-frontend-reviewers Needs RevisionPublic Authored by czhou on Apr 25 2026, 2:04 AM. Referenced Files
Details Summary The "Let's go" button on the AI window firstrun screen failed WCAG 2.2 1.4.3 Contrast (Minimum): its white text had a contrast ratio of only 2.06:1 against the gradient background due to CSS opacity: 0.5 being applied to the entire element. This change raises the opacity to 0.75 (via a local --button-disabled-opacity variable) and explicitly sets the text color to --color-white, bringing the contrast within the minimum requirement. The cursor is also updated to not-allowed to communicate the unavailable state without suppressing pointer events. renamed all local custom variables in this file are renamed to --aiwindow-firstrun-* prefix to avoid collisions with design system tokens, and forced-colors handling for the back button (label color and icon visibility) is moved into the existing @media (forced-colors) block so all HCM overrides live in one place. Test Plan
Diff Detail
Event Timelineczhou created this revision.Apr 25 2026, 2:04 AM phab-bot published this revision for review.Apr 25 2026, 2:04 AM phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)". phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)". phab-bot removed a project: secure-revision. Comment Actions Code analysis found 1 defect in diff 1258318:
IMPORTANT: Found 1 defect (error level) that must be fixed before landing.
You can run this analysis locally with: If you see a problem in this automated review, please report it here. You can view these defects in the Diff Detail section of Phabricator diff 1258318. Gijs requested changes to this revision.Apr 28 2026, 3:45 PM Comment ActionsLooks like this has stylelint complaints. Looks like elsewhere we use which might work here too? This revision now requires changes to proceed.Apr 28 2026, 3:45 PM czhou requested review of this revision.Apr 30 2026, 4:12 AM czhou updated this revision to Diff 1262552. czhou added a comment.Apr 30 2026, 4:13 AM Comment Actions
Thanks for your suggestion, @Gijs! I agree that meets the 3:1 contrast requirement, but I am concerned that because the 0.75 we use right now is already closer to the enabled state, using 0.8 might further remove the "disabled" affordance for users. Gijs accepted this revision.Apr 30 2026, 10:30 AM Comment ActionsThanks for the update and pushing back here. I guess this points to the question of why we're using custom styles for these buttons rather than something that relies entirely on existing design system bits. It's probably desirable from a UX/product pov, but unfortunate because threading the needle between reusing and custom values here ends up making this less maintainable: if the colours in the design system change, we may either fail WCAG again, or lose the disabled affordance anyway. That shouldn't stop us making the change but we'll probably need to be mindful of the nova updates. This revision is now accepted and ready to land.Apr 30 2026, 10:30 AM This revision now requires changes to proceed.Apr 30 2026, 10:34 AM dao added inline comments.Apr 30 2026, 10:37 AM
dao added a comment.Apr 30 2026, 10:46 AM Comment ActionsGoing back to https://bugzilla.mozilla.org/show_bug.cgi?id=2034940#c0, I feel like I still don't fully understand the intent here.
What does "this button is not, in its current implementation, disabled" mean? In what sense is this button not disabled? Why does it match , and why are you using the term "disabled" in the variable name? czhou added a comment.EditedMay 7 2026, 4:10 AM Comment Actions
@Gijs Totally agree, the custom gradient is what forces this hand-tuned balance. Good news: Nova already overrides to 0.7, and Nova switches this button to a solid color with the 0.7 opacity, so once we migrate this button to Nova styles we can drop the custom 0.75 entirely and just use the standard token. I've also added a note in the comment pointing to var(--button-opacity-disabled) as the replacement once Nova lands here. Thank you for the guidance! czhou added a comment.May 7 2026, 4:18 AM Comment Actions
Thank you so much for reaching out, @dao! The comment saying was initially made when reporting an issue about the let's go button being focusable with a keyboard even when disabled. That's why it was noted as not being fully disabled. We've now fixed the keyboard focus issue, and the next step is to update the button's opacity to meet the minimum contrast requirements. The accessibility team still believes it's important to ensure the contrast is sufficient, despite the focus issue being addressed. Here's a Slack discussion that explains the reasoning behind this decision. czhou requested review of this revision.May 7 2026, 4:20 AM czhou updated this revision to Diff 1268643. czhou added inline comments.May 7 2026, 4:21 AM
czhou edited the summary of this revision. (Show Details) dao requested changes to this revision.May 7 2026, 11:42 AM Comment Actions
I'm still confused by that conversation because ensuring minimum contrast necessarily means the button will be less discernable as being disabled. I assume that's why disabled elements are exempt from contrast requirements in the first place. In some cases we have in fact reduced the opacity of disabled elements in prefers-contrast mode to ensure they don't look enabled. I don't understand why we'd want to do the opposite for this button even after reading that thread. This revision now requires changes to proceed.May 7 2026, 11:42 AM Comment Actions
Thanks for pushing back here @dao! re-reading the Slack thread, the reasoning is more nuanced than "WCAG 1.4.3 says so". A few key points from the a11y team:
So the spec we're targeting here is the Firefox "3:1 for disabled text" convention, which is a deliberate middle ground between WCAG AA (too readable) and the WCAG exemption (essentially invisible). 0.75 opacity hits that 3:1 target for the current gradient. If it would be helpful, I'd be glad to connect you with the a11y team to share more about this rationale! phab-bot added a subscriber: ai-frontend-reviewers-rotation. czhou requested review of this revision.May 15 2026, 5:08 AM Gijs added a comment.May 15 2026, 2:42 PM Comment ActionsI defer to @dao here but I'm not sure I understand the benefit of all the custom prefixes?
dao requested changes to this revision.Wed, May 27, 7:48 AM Comment Actions
This was motivated by https://phabricator.services.mozilla.com/D296488#inline-1611780. Essentially this looked confusingly like it was doing things in the "button" variable namespace. Requesting changes for @Gijs' latest review comments. I'm open to rubber-stamping this as we've already burnt too much time on this single button. The custom fiddling and reinventing the wheel seems unfortunate, and this is exactly what the design system aimed to prevent. Maybe I'm wish-casting, but I seem to remember reading somewhere that an upcoming design update brings the button back in line with the design system? Would be great if we could get there sooner rather than later. This revision now requires changes to proceed.Wed, May 27, 7:48 AM
Revision Contents
Diff 1268723 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
