Skip to content

Decision: how visible should an unchecked checkbox's outline be? (1.2:1 today, WCAG 1.4.11 asks 3:1) #4953

Open

Description

@yannickmonney

Summary

An unchecked checkbox is drawn with a 1px outline that is about 1.2:1 against a light page. WCAG 2.1 SC 1.4.11 (Non-text Contrast, level AA) asks 3:1 for the parts of a control a person needs in order to identify it, and the repo's contract is "WCAG 2.1 AA … AA contrast" (AGENTS.md, non-negotiable boundaries). The radio beside it on the same page is 17:1. This is a design-system choice, not a defect on one page, so this issue lays out the evidence and the options and leaves the choice open.

Found while reviewing the coding-agent consent page (the Also allow group), where the three checkboxes are the only way to see that those choices exist.

What the repo says today (main c62118c)

Control Outline token Where
Checkbox border-border, which is --color-border: hsl(var(--border)) (globals.css:138); --border is 240 5.9% 90% in light (:247) and 0 0% 24% in dark (:394) packages/ui/src/components/forms/checkbox.tsx:87
Radio border-primary radio-group.tsx:137
Switch, unchecked border-border-strong (#d1d5db) switch.tsx:73-76, with a comment that the track alone is ~1.2:1
Input, Textarea, Select --color-border-input, which is --color-border-strong (#d1d5db) in light mode globals.css:74-79; input.tsx:33, textarea.tsx:152, select.tsx:64
Dark mode, the --color-border-* family base #404040, strong #525252, input = base globals.css:356-359

globals.css:76-78 says the base border "is barely perceptible (~1.2:1)" on a white field, "so inputs use a stronger border". The stronger token is #d1d5db, which is 1.47:1 on white, so the stated aim was "more visible", not 3:1. The checkbox does not use even that token.

What was observed

Measured in a real browser with getComputedStyle on /oauth/consent (light theme, page background rgb(252,252,252)):

Element Outline Contrast vs page
Unchecked checkbox (×3, "Also allow") rgb(228,228,231), 1px 1.24:1
Radio rgb(24,24,27) / selected rgb(3,7,18), 1px 17.27:1 / 19.63:1

Computed from the tokens, on white: #e5e7eb 1.24, #d1d5db 1.47, gray-400 #9ca3af 2.54, gray-500 #6b7280 4.83. In dark mode the checkbox's hsl(0 0% 24%) outline on #0a0a0a is 1.8:1, #404040 is 1.91 and #525252 is 2.53. A checked box fills with the accent colour and is not affected.

Blast radius at that commit: <Checkbox appears in 21 platform files (27 usages) and in 7 packages/ui components (column-builders.tsx row selection for every DataTable, filter-panel.tsx, multi-select.tsx, checkbox-group.tsx, env-var-list-editor.tsx, schedule-editors.tsx, data-table-skeleton-cell.tsx).

Not examined: the focus ring's contrast, the disabled state, other controls' borders (chips, badges, the segmented control), and whether any screen reader or axe rule reports this (axe's 1.4.11 coverage is partial, and the consent page's axe audits pass today).

Constraints a change has to respect

  • The label and the box's position are also cues, so a reader can still tell what the control is; the outline is the cue for its state (empty vs checked).
  • Inputs, selects and textareas sit beside checkboxes in the same forms and share one family of tokens; a checkbox that is much darker than the fields next to it changes how every form looks.
  • The Switch already received an outline for the same reason (its comment), so the system has precedent for strengthening one control's edge.
  • The tokens live in @tale/ui's globals.css, which the docs site imports as it is (services/docs/app/globals.css:1).

Options (no stated preference)

  1. Checkbox only → the radio's outline (border-primary). Matches the radio next to it; heavier than inputs.
  2. Checkbox only → a mid-grey token at 3:1 or more (gray-500 is 4.8:1; gray-400 at 2.5:1 is not enough). Lighter than radios, still distinct from the inputs.
  3. Raise the light-mode --color-border-strong / --color-border-input to 3:1 or more, which moves inputs, selects, textareas and the Switch outline together.
  4. Keep it and record the reasoning in the design-system guide (a boundary that the label and the position already identify), with the exception named.

Questions

  • Is 1.4.11 meant to apply to form-control outlines in this design system, or is "visible, not 3:1" the intent behind globals.css:76-78?
  • If it applies, should inputs move with the checkbox?

Related

Found in the polish pass over the coding-agent consent page and Connected agents (app/features/auth/components/agent-consent/).

Activity

  1. added
    priority: medium
    needs discussion
    improvement
    on Oct 13, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    The rule: WCAG 2.1 SC 1.4.11 (Non-text Contrast) applies to the boundary of every form control in @tale/ui. That covers checkbox, radio, the switch track, input, select and textarea, plus any hand-rolled indicator or field that draws one of these controls. An unchecked or empty control's edge must reach at least 3:1 against every surface a form sits on, in both themes. Disabled controls are exempt, as 1.4.11 allows, and keep their opacity treatment. Incidental borders (cards, dividers, tables, popover section rules, --color-border-base, --border) are not covered and do not change.

    How: one shared control-boundary token, the existing --color-border-input, is raised:

    • Light: #80858f. That is 3.70:1 on white, 3.54:1 on bg-elevated and 3.37:1 on --muted.
    • Dark: #7a7a7a, its own value rather than an alias of border-base. That is 4.61:1 on the page, 4.18:1 on card, 3.53:1 on muted and 3.28:1 on --accent.

    The unchecked checkbox, the unchecked radio, the unchecked Switch outline, searchable-select's radio indicator and switcher search field, and filter-panel's radio all move to this token. The Switch outline now also shows in dark mode. Checked and indeterminate states keep the accent. The guard test is the normative spec: the token must be at least 3:1 against bg-base, bg-elevated, bg-muted, --background, --card, --popover, --input, --sidebar, --muted and --accent in both themes. The hex values are just what passes it today.

    Answers

    • Does 1.4.11 apply to form-control outlines? Yes. An unchecked box's outline is its only state cue. The 1.47:1 border in globals.css:76-78 fell short of 3:1 and was never a recorded exception.
    • Should inputs move with the checkbox? Yes. The whole family shares one token, so every control edge has one weight.

    Rationale

    At 1.24:1 (1.8:1 dark), the checkbox fails AA on 27 platform usages and on every DataTable row, and searchable-select's own radio indicator fails the same way. Fixing only the checkbox would leave inputs and dark controls under 3:1 and make the box heavier than the fields beside it. Recording an exception would document a known violation. One raised token, applied to the primitives and to the hand-rolled copies, fixes the whole family with one value per theme. The guard keeps it from drifting back.

    Implementation units

    1. fix(ui): raise the form-control boundary token to 3:1 in both themes, with a guard (base main, S)
      • Change: the new values in globals.css, with the comments rewritten to state the rule.
      • Guard: globals.test.ts checks the token against the ten surfaces in both themes.
      • Docs: design/docs/tokens.md and the ui-docs colors and accessibility foundations. The colors.md note about the old aliasing is rewritten.
      • Acceptance: the guard fails on the old values, and the fields compute to the new colours.
    2. fix(ui): put checkbox, radio, switch and hand-rolled control edges on the control-boundary token (base main, S; depends on 1)
      • Change: checkbox.tsx, radio-group.tsx, switch.tsx, the radio indicator and switcher search field in searchable-select.tsx, the radio in filter-panel.tsx, and a sweep for other hand-rolled indicators and caller overrides.
      • Test: a browser test checks each unchecked control's computed edge is at least 3:1 in both themes.
      • Also: a box in services/ui-docs/tests/manual/suites/ or a row in its reference/automation.md.
      • Acceptance: the consent page's "Also allow" boxes measure at least 3:1 in light and dark, and checked and disabled states are unchanged.
  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions