Skip to content

fix(a11y): meet WCAG contrast on default button variant#81

Merged
balajmarius merged 1 commit into
mainfrom
fix/a11y-button-contrast
May 27, 2026
Merged

fix(a11y): meet WCAG contrast on default button variant#81
balajmarius merged 1 commit into
mainfrom
fix/a11y-button-contrast

Conversation

@ErolP18
Copy link
Copy Markdown
Collaborator

@ErolP18 ErolP18 commented May 27, 2026

Lighthouse flagged the Login button in the app bar — white text (#ffffff) on the brand orange (#ff6900, bg-orange-50) yields a contrast ratio of ~2.89:1, failing WCAG AA for both normal text (4.5:1) and large text (3:1).

Override the inherited text-white with text-gray-100 (#191919) on the default variant. New contrast: ~6.09:1 on the base bg and ~7.34:1 on the orange-150 hover gradient — comfortably AA, near AAA.

The default variant is only used in two places in the codebase (AppBar Login when signed out, AppBar Logout when signed in), so this is a visible but scoped design tweak: brand orange preserved, foreground darkens to keep the CTA legible.

Note: the outline and danger variants also fail contrast in their hover states (white text on solid orange-50 / red-50), but Lighthouse does not test hover so those weren't flagged. Worth a follow-up PR.

Summary

Brief description of changes.

Changes

  • Change 1
  • Change 2

Claudebin Session

🔗 Session Link

Testing

How did you test this?

Checklist

  • bun check passes
  • bun type-check passes
  • Tested locally
  • Claudebin session link attached

Lighthouse flagged the Login button in the app bar — white text
(#ffffff) on the brand orange (#ff6900, bg-orange-50) yields a
contrast ratio of ~2.89:1, failing WCAG AA for both normal text
(4.5:1) and large text (3:1).

Override the inherited text-white with text-gray-100 (#191919) on
the default variant. New contrast: ~6.09:1 on the base bg and
~7.34:1 on the orange-150 hover gradient — comfortably AA, near
AAA.

The default variant is only used in two places in the codebase
(AppBar Login when signed out, AppBar Logout when signed in), so
this is a visible but scoped design tweak: brand orange preserved,
foreground darkens to keep the CTA legible.

Note: the outline and danger variants also fail contrast in their
hover states (white text on solid orange-50 / red-50), but
Lighthouse does not test hover so those weren't flagged. Worth a
follow-up PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@balajmarius balajmarius merged commit 7093107 into main May 27, 2026
1 of 2 checks passed
@balajmarius balajmarius deleted the fix/a11y-button-contrast branch May 27, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants