[Feature] Contrast multiplier (--contrast) for accessibility-tunable translucent UI #6641
aosmcleod
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature description
A
--contrastCSS custom property that acts as a global multiplier for translucent/semi-transparent UI elements — focus rings, soft backgrounds, tinted overlays, and hover states. Raising it makes these elements more visible for users with low vision; lowering it produces a subtler, more muted aesthetic.This is an accessibility-first feature: it gives end users (or app developers) a single knob to improve the visibility of focus indicators and interactive state feedback without changing the colour palette itself.
How it works
The variable defaults to
1and is consumed viacalc()insidecolor-mixpercentages:When
--contrastis1, the percentages are unchanged (25%, 15%). When raised to1.5, they become 37.5% and 22.5% — noticeably more visible. When lowered to0.7, they become 17.5% and 10.5% — subtler.What it scales
What it does NOT scale
Accessibility value
WCAG 2.1 SC 1.4.11 (Non-text Contrast) requires 3:1 contrast for UI components and graphical objects. Focus rings and soft backgrounds are the most common failure points. A
--contrastmultiplier lets:Scope
This is a CSS-only addition — a single variable in
:rootplus modifications to existingcolor-mixexpressions. No new React components or props needed. The variable could be exposed via a futureapplyTheme()API or simply documented as a CSS override.Recommended range
0.5–2.0. Values below 0.5 make focus rings nearly invisible; values above 2.0 make soft backgrounds look like solid fills.All reactions