Skip to content

fix(#262): resolve WCAG AA contrast violations across codebase#263

Merged
ChristopherRotnes merged 1 commit into
masterfrom
fix/262-wcag-aa-contrast
May 19, 2026
Merged

fix(#262): resolve WCAG AA contrast violations across codebase#263
ChristopherRotnes merged 1 commit into
masterfrom
fix/262-wcag-aa-contrast

Conversation

@ChristopherRotnes
Copy link
Copy Markdown
Owner

Summary

Changes

1. --accent--accent-active on filled backgrounds with white text
--accent (#ee2c80) as a background with color: #fff produces 3.95:1 — fails AA for normal text (requires 4.5:1). Replaced with --accent-active (#b5116a, ~6.45:1) in five locations:

  • Home.jsx — CTA "Log" button
  • MuscleMapConfirm.jsx — Today / Other day segmented pills + Save CTA
  • Settings.jsx — Save display-name button
  • Report.jsx — add-to-library (+) button in recommendations

2. --accent-soft override for light mode
--accent-soft: #ff7eb6 as text on --accent-bg-14 in light mode computes to ~1.77:1 (FAIL). Added --accent-soft: #b5116a to the [data-theme="g10"] block in carbon-tokens.css. Dark mode keeps #ff7eb6 (~7.7:1 on dark bg). Fixes AccentChip and all accent-soft text labels in light mode.

3. OvelsePicker exercise label on green-soft background
10px mono label used --exercise (#1a8c4e in light mode) as text on --exercise-soft background → 3.79:1 (FAIL). Changed to --cds-text-primary. Green identity preserved via border and Add icon.

4. Focus rings on raw <input> elements
Inline outline: none on custom-styled text inputs in ExFlyt, GruppetimePicker, OvelsePicker, and Planlegger suppressed keyboard focus rings with no replacement. Removed all four. Extended app.css focus rule from input[type=number] to all non-Carbon inputs.

5. CLAUDE.md rule added
Added an explicit WCAG rule to the key-tokens section: never use --accent as a filled background with white text — always use --accent-active.

Test plan

  • Home → verify CTA button is slightly darker magenta (not hot pink), white text readable
  • Camera flow → confirm step: Today / Other day pills and Save CTA use darker magenta
  • Settings → save display name: button uses darker magenta
  • Report → add a recommendation to library: + button uses darker magenta
  • Toggle to light mode (g10) — verify AccentChip labels (Report gap callout, MuscleMapResult muscle chips) are legible dark magenta, not faint pink
  • Sett sammen → Ny øvelse card: subtitle label is now primary text color, not green
  • Tab through ExFlyt search input, GruppetimePicker name input, OvelsePicker search input, Planlegger search input — verify blue focus ring appears on each
  • Verify no regressions in dark mode (g100)

#262

🤖 Generated with Claude Code

- Replace --accent (#ee2c80, 3.95:1) with --accent-active (#b5116a, ~6.45:1)
  on filled backgrounds with white text: Home CTA, MuscleMapConfirm pills +
  Save CTA, Settings save button, Report add-to-library button
- Add --accent-soft: #b5116a override to [data-theme="g10"] block so accent-soft
  text on tinted backgrounds passes AA in light mode (~4.84:1 vs ~1.77:1 before)
- Fix OvelsePicker 10px exercise label on --exercise-soft bg: change color from
  --exercise to --cds-text-primary (green identity kept via border + icon)
- Remove inline outline:none from raw <input> elements in ExFlyt, GruppetimePicker,
  OvelsePicker, Planlegger; broaden app.css focus rule to cover non-Carbon inputs
- Bump version to 1.5.16

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-263.westeurope.7.azurestaticapps.net

@ChristopherRotnes ChristopherRotnes merged commit d584da9 into master May 19, 2026
2 checks passed
@ChristopherRotnes ChristopherRotnes deleted the fix/262-wcag-aa-contrast branch May 19, 2026 20:11
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.

1 participant