Contrast pairs

Docs

The contrast check grades two lists in both themes: the semantic pairs, which the palette has to get right, and the component pairs, which the kit paints from component tokens. Text pairs need 4.5:1, non-text pairs 3:1 (WCAG 2.2, SC 1.4.3 and 1.4.11). A required pair counts against the score and is what Fix all repairs; an advisory pair is decoration, measured and shown, never counted.

Semantic pairs

37 semantic pairs. Each names the semantic tokens on each side.

Pair Foreground Background Threshold Severity
Background foreground background 4.5:1 required
Muted text on background muted-foreground background 4.5:1 required
Card card-foreground card 4.5:1 required
Popover popover-foreground popover 4.5:1 required
Primary primary-foreground primary 4.5:1 required
Secondary secondary-foreground secondary 4.5:1 required
Muted muted-foreground muted 4.5:1 required
Accent accent-foreground accent 4.5:1 required
Destructive destructive-foreground destructive 4.5:1 required
Border border background 3:1 advisory
Input input background 3:1 advisory
Focus ring ring background 3:1 required
Sidebar text sidebar-foreground sidebar 4.5:1 required
Sidebar primary sidebar-primary-foreground sidebar-primary 4.5:1 required
Sidebar accent sidebar-accent-foreground sidebar-accent 4.5:1 required
Sidebar border sidebar-border sidebar 3:1 advisory
Sidebar focus ring sidebar-ring sidebar 3:1 required
Chart 1 chart-1 card 3:1 required
Chart 2 chart-2 card 3:1 required
Chart 3 chart-3 card 3:1 required
Chart 4 chart-4 card 3:1 required
Chart 5 chart-5 card 3:1 required
Primary gradient start primary-foreground primary-gradient-from 4.5:1 required
Primary gradient middle primary-foreground primary-gradient-via 4.5:1 required
Primary gradient end primary-foreground primary-gradient-to 4.5:1 required
Accent gradient start accent-foreground accent-gradient-from 4.5:1 required
Accent gradient middle accent-foreground accent-gradient-via 4.5:1 required
Accent gradient end accent-foreground accent-gradient-to 4.5:1 required
Page wash start foreground surface-gradient-from 4.5:1 required
Page wash middle foreground surface-gradient-via 4.5:1 required
Page wash end foreground surface-gradient-to 4.5:1 required
Page wash muted start muted-foreground surface-gradient-from 4.5:1 required
Page wash muted middle muted-foreground surface-gradient-via 4.5:1 required
Page wash muted end muted-foreground surface-gradient-to 4.5:1 required
Page wash primary start primary surface-gradient-from 4.5:1 required
Page wash primary middle primary surface-gradient-via 4.5:1 required
Page wash primary end primary surface-gradient-to 4.5:1 required

Component pairs

44 component pairs, one per component, variant and state whose slots paint text or a control on a fill. The key is how the check and the fixers name a row: button, button.outline, button.outline:hover. A background slot of — is a slot painted straight on the page, graded against the page background. Every component pair is required.

Key Row Foreground slot Background slot Threshold
alert Alert fg bg 4.5:1
avatar Avatar fg bg 4.5:1
badge Badge fg bg 4.5:1
badge.destructive Badge destructive destructive.fg destructive.bg 4.5:1
badge.ghost:hover Badge ghost hover ghost.hover-fg ghost.hover-bg 4.5:1
badge.link Badge link link.fg — 4.5:1
badge.secondary Badge secondary secondary.fg secondary.bg 4.5:1
bubble Bubble fg bg 4.5:1
bubble.muted Bubble muted muted.fg muted.bg 4.5:1
bubble.secondary Bubble secondary secondary.fg secondary.bg 4.5:1
button Button fg bg 4.5:1
button.destructive Button destructive destructive.fg destructive.bg 4.5:1
button.ghost:hover Button ghost hover ghost.hover-fg ghost.hover-bg 4.5:1
button.link Button link link.fg — 4.5:1
button.outline Button outline outline.fg outline.bg 4.5:1
button.outline:hover Button outline hover outline.hover-fg outline.hover-bg 4.5:1
button.secondary Button secondary secondary.fg secondary.bg 4.5:1
card Card fg bg 4.5:1
checkbox Checkbox fg bg 4.5:1
dialog Dialog fg bg 4.5:1
dropdown-menu Dropdown menu fg bg 4.5:1
empty Empty fg bg 4.5:1
input Input fg bg 4.5:1
item.muted Item muted muted.fg muted.bg 4.5:1
kbd Kbd fg bg 4.5:1
menubar Menubar fg bg 4.5:1
popover Popover fg bg 4.5:1
progress Progress fg bg 3:1
radio-group Radio group bg — 3:1
select Select fg bg 4.5:1
sheet Sheet fg bg 4.5:1
skeleton Skeleton bg — 3:1
slider Slider fg bg 3:1
spinner Spinner fg — 3:1
switch Switch fg bg 3:1
tabs Tabs fg bg 4.5:1
tabs.line Tabs line line.fg — 4.5:1
tabs.line:active Tabs line active line.active-fg — 4.5:1
tabs.line:indicator Tabs line indicator line.indicator — 3:1
textarea Textarea fg bg 4.5:1
toast Toast fg bg 4.5:1
toggle Toggle fg bg 4.5:1
toggle.outline:hover Toggle outline hover outline.hover-fg outline.hover-bg 4.5:1
tooltip Tooltip fg bg 4.5:1