Skip to content

Conversation

oliveror
Copy link
Member

Design decision for the team: this changes the brand orange across the whole UI. Please look at it in the browser before approving.

Token Before After White text on it
--color-brand-primary #e86a1c #a8470b 3.23:1 → 5.88:1
--color-brand-primary-hover #cc5b14 #9a3f08 4.14:1 → 6.80:1
--color-brand-primary-active #b84f0d #8f3a06 5.05:1 → 7.57:1

Changes

  • axe reported serious color-contrast failures on Explore, recipe detail, Login, Register and 404. White text on the brand orange was 3.23:1, and brand-coloured text and links were below 4.5:1 on the light surfaces (active nav link 4.01:1).
  • Shifted the brand ramp one step darker (table above). The old "active" shade is close to the new primary, so the look stays warm orange. Brand text now passes on every surface it is used on (e.g. 5.21:1 on the page background, 4.67:1 on the selected surface). The contrast rationale is documented next to the tokens in tokens.css.
  • The desktop servings hint on recipe detail used --color-text-muted (4.4:1 on its panel); it now uses --color-text-secondary (4.8:1).
  • Updated the fallback colour in apps/web/src/components/ui/SKILL.md.
  • New e2e/accessibility.spec.ts with @axe-core/playwright (4.10.2, dev dependency). It checks WCAG 2.x A/AA rules on Explore, recipe detail, recipe not found, Login, Register, 404, Cookbook and Add Recipe (signed in), at 1280 px and 375 px: 16 tests, API mocked like the smoke tests, no database needed. It runs in CI with the rest of test:e2e.

Validation

Remaining work

  • --color-text-muted (#667085) is borderline on the warm backgrounds (4.2–4.4:1). axe found no failing use after this change, but new uses on --color-bg-page / --color-bg-subtle should use --color-text-secondary.
  • The axe suite enforces WCAG A/AA only. best-practice rules (e.g. page-has-heading-one) can be enabled after Add an h1 to the "Recipe not found" page #68 is merged.
  • Dialog/sheet open states are not scanned yet.

AI usage

Written with Claude Code (Anthropic) during the final-delivery review. The change was proposed, implemented and tested by the AI agent and pushed from my account; the review summary is in the linked issue. Please review the diff as you would any other contribution.

Closes #67

White text on the brand orange (#e86a1c) was 3.23:1 and orange text on the
light surfaces was below 4.5:1, failing axe color-contrast on most pages.
Shift the brand ramp one step darker (primary #a8470b, hover #9a3f08,
active #8f3a06) and use secondary text for the desktop servings hint.

Add an axe-core Playwright suite that checks WCAG 2.x A/AA rules on public
and signed-in pages at desktop and mobile widths, so contrast regressions
fail CI.

Closes #67
Copy link
Member

@olestan olestan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No merge blockers, but two non-blocking concerns:

  • Accessibility scans may run before recipe data loads, potentially missing contrast issues.
  • The Cookbook mock uses a recipe that is neither saved nor owned, so it doesn't reflect a realistic state.

Review on #86 (non-blocking): Explore and Cookbook now wait for the
recipe card link before running axe, so the scan covers the loaded
results rather than the loading state, and the Cookbook mock returns a
recipe the user has saved.

Refs #67
@oliveror
Copy link
Member Author

Thanks — addressed both non-blocking points in the latest commit:

  • Scans before data loads: Explore and My Cookbook now wait for the recipe card link to be visible before axe runs (the page heading alone appears before the results). Recipe detail already waited for the recipe's own title.
  • Cookbook mock: the cookbook query now returns the recipe as saved by the signed-in user (isSaved: true), like a real Saved entry, so the card renders its "Saved" state in the scan.

All 16 accessibility tests still pass.

@oliveror oliveror merged commit dc409b9 into dev Nov 16, 2026
2 checks passed
@oliveror oliveror deleted the fix/a11y-color-contrast branch November 17, 2026 00:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants