Skip to content

fix(site/src): raise checkbox and radio border contrast to 3:1 - #30462

Merged
chrifro merged 2 commits into
mainfrom
a11y-control-border-token
Oct 14, 2026
Merged

chrifro merged 2 commits into
mainfrom
a11y-control-border-token

Conversation

@chrifro

@chrifro chrifro commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

The resting and hover borders of the shared Checkbox and RadioGroupItem were below the 3:1 non-text contrast required by WCAG 1.4.11. In dark mode, the resting border was #27272A on #09090B (1.33:1) and the hover border was #3F3F46 (1.90:1). In light mode, they were #E4E4E7 on white (1.27:1) and #A1A1AA (2.56:1).

This adds two color tokens and uses them in both components:

Token Dark Light
border-control zinc-500 #71717A (4.1:1 on page, 3.7:1 on surface-secondary) zinc-500 #71717A (4.8:1 on white)
border-control-hover zinc-400 #A1A1AA (7.8:1) zinc-600 #52525B (7.7:1)

A checked radio now uses the same border-control border as an unchecked one. Before, it used border-secondary. Checked and indeterminate checkboxes keep their inverted fill. border-default and border-secondary are unchanged, so cards, dividers and other decorative borders look the same. The colorblind themes inherit the new tokens from the base light and dark blocks.

Fixes DEQ-583, DEQ-151, DEQ-426, DEQ-590, DEQ-433, DEQ-152, DEQ-300
Refs DEQ-285, DEQ-51

Before and after

Checkboxes on Create user > Roles and radios on Appearance > Terminal font. In the hover rows, the pointer is on the first item.

Before After
Checkbox, dark, rest
Checkbox, dark, hover
Checkbox, light, rest
Checkbox, light, hover
Radio, dark, rest
Radio, dark, hover
Radio, light, rest
Radio, light, hover
Decision log
  • New token instead of retuning border-secondary. border-secondary is used in 14 places, and only 4 are form controls. The rest are card hovers, table-row outlines and chips. Retuning it would make those heavier for no accessibility gain.
  • zinc-500 in dark mode. zinc-600 is about 2.6:1 on the page and 2.3:1 on surface-secondary, so it fails. The darkest zinc-tinted value that passes on both is about hsl(240 5% 42%), but it only clears 3:1 by about 0.1, so we chose zinc-500 for margin.
  • Hover moves away from the background (zinc-400 in dark mode, zinc-600 in light mode). This way hover is never weaker than rest.
  • Scope is limited to Checkbox and RadioGroupItem. These are handled in follow-ups: inputs and field-style triggers (Input, Textarea, Select, InputGroup, Combobox and others), the Switch (it uses surface-quaternary), the template builder ModuleCard checkbox (DEQ-148), the theme card radio indicator in SingleModeSection (the theme-card part of DEQ-285) and the ThemeSwatch ring (DEQ-597).
  • Text buttons and navbar menu buttons are exempt from 1.4.11 because their text labels identify them, so they are not changed.

Generated by Coder Agents on behalf of @chrifro.

Add border-control and border-control-hover color tokens and use them
for the resting and hover borders of the shared Checkbox and
RadioGroupItem components. The previous borders (border-default and
border-secondary) fell below the 3:1 non-text contrast required by
WCAG 1.4.11.

border-control is zinc-500 in both themes. border-control-hover is
zinc-400 in dark mode and zinc-600 in light mode.
@linear-code

linear-code Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

@chrifro
chrifro marked this pull request as ready for review October 8, 2026 08:44
chrifro added a commit that referenced this pull request Oct 9, 2026
…en for swatch ring

Use surface-invert-secondary, which already exists on main and is
used for the Slider handle border, instead of the border-control token
added in #30462.
@chrifro
chrifro requested a review from aqandrew October 13, 2026 08:48
@chrifro
chrifro merged commit 01f78b3 into main Oct 14, 2026
27 checks passed
@chrifro
chrifro deleted the a11y-control-border-token branch October 14, 2026 08:52
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants