Skip to content

Fix: meet AA contrast on filled controls and badges - #136

Merged
SandObserver merged 1 commit into
mainfrom
fix/filled-control-contrast
Aug 22, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/filled-control-contrast

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Replace --on-accent with --on-fill (ink on a control filled with a role colour, dark in the dark theme and white in the light one) and --on-tint (white in both, for a fill the stylesheet does not choose).
  • Move the accent buttons, the active nav item and chip, the credential tick, the success and danger buttons and the About dot onto --on-fill; leave the user-coloured app icons and previews on --on-tint.
  • Add an --info role token and give the app badges --badge-green, so all three badge fills resolve per theme and take --on-fill.
  • Lower the light --sy-green-hi to #238539 and point the light --tile-placeholder at --sy-gray2-hi.
  • Ink a user-chosen badge colour explicitly in computeBadgeVisual, in both directions, instead of falling through to the stylesheet against a NAMED table that does not hold the fill values.
  • Update the design-system token table and rules.

Testing
All green, including the Docker build. Added a contrast test that reads the filled-control rules off the stylesheets and measures every pair in both themes and both contrast modes, and 1 test for the badge ink.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

Split --on-accent into --on-fill and --on-tint. --on-fill is the ink on a
control filled with a role colour and moves with the theme; --on-tint is the
white ink on a fill the project does not choose, such as a user's app colour.

White on the dark hues measured 1.86 on the accent, 2.02 on the success green
and 3.43 on the danger red, all under the 4.5 of WCAG 1.4.3.

Add an --info role token so the blue badge takes the accessible blue in the
light theme, where --sy-blue measured 4.02. Lower the light --sy-green-hi to
#238539, which measured 4.40 as a fill behind white. Point the light tile
placeholder at the -hi grey, which measured 2.21 behind a white icon against
the 3.0 of 1.4.11.

badge-logic.js chose badge ink by comparing against hexes that do not match the
stylesheet's fills. Ink a user-chosen badge colour explicitly in both
directions and leave a named badge to --on-fill.
@SandObserver SandObserver added the ui/ux UI, UX, and accessibility only fix label Aug 22, 2026
@SandObserver
SandObserver merged commit a56ee2b into main Aug 22, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/filled-control-contrast branch August 22, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui/ux UI, UX, and accessibility only fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant