Skip to content

fix(a11y): hold Atlas themes' text to 4.5:1 and run axe contrast in Storybook - #36

Merged
uzayer merged 5 commits into
mainfrom
uzayermasud/atl-1006-package-a11y
Nov 11, 2026
Merged

uzayer merged 5 commits into
mainfrom
uzayermasud/atl-1006-package-a11y

Conversation

@uzayer

@uzayer uzayer commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

ATL-1006. An axe run over every story (Atlas dark, colour contrast on) found no component-level violations, but color-contrast failed in 452 stories. Nearly all of it was Atlas dark's muted-foreground (#585858, 2.4–2.95:1) and text.disabled (#3f3f3f).

Contrast

Atlas-authored themes now hold every text tier to at least 4.5:1 on background, card, sidebar, popover and muted. Ratios are against the worst of those surfaces, which is the popover:

theme / appearance token before after
atlas dark muted-foreground #585858 (2.40) #939393 (5.55)
atlas dark text.disabled #3f3f3f (1.62) #858585 (4.62)
atlas light text.disabled #7e7e7e (3.56) #6c6c6c (4.61)
atlas-mono dark secondary + muted-foreground #8a8a8a (3.99) #a4a4a4 (5.53)
atlas-mono dark text.disabled #656565 (2.36) #969696 (4.66)
atlas-mono light secondary + muted-foreground #6b6b6b (4.47) #5d5d5d (5.52)
atlas-mono light text.disabled #878787 (3.01) #696969 (4.61)
chyral dark muted-foreground #645c47 (2.59) #9a927f (5.57)
chyral dark text.disabled #504938 (1.93) #8b8473 (4.63)
chyral light text.disabled #867c64 (3.21) #6c634e (4.61)
phosphor dark muted-foreground #7e5300 (2.58) #be8100 (5.24)
phosphor dark text.disabled #644100 (1.90) #b27900 (4.65)
phosphor light text.disabled #946d3b (3.75) #855f2f (4.60)
  • The order still runs secondary > muted > disabled. In Atlas dark that's #aaaaaa (7.34) > #939393 (5.55) > #858585 (4.62).
  • These themes now set text.disabled explicitly. The derived value (muted 20% toward the background) can't reach 4.5:1 unless muted-foreground goes above secondary-foreground. The note in keys.toml explains this.
  • terminal.ansi.bright_black is set to its old value wherever muted-foreground changed, because a terminal's bright black is meant to look dim. One side effect: atlas-mono light's syntax.comment follows its muted value and goes from #6b6b6b to #5d5d5d.
  • The ported third-party themes (dracula, monokai, tokyo-night, rosé pine, catppuccin, one-dark, vesper, mirage) keep their upstream colours, following the existing rule in keys.toml. Several of them still fail.

Components

  • AccordionTrigger drops outline-none and gets the global :focus-visible ring, the same one Button uses. The ring is drawn inset because the root's overflow-hidden would clip it.
  • AuthSplit: the form column is now a <main> element.
  • DataTable: a clickable row is focusable and opens on Enter or Space, with an inset ring.
  • TerminalOutputLine: a link segment is role="link" and focusable, and opens on Enter. A pointer click still needs ⌘/Ctrl.
  • Text dimmed with opacity now uses a text token. This covers done and upcoming steps in the session pipeline, the auth-error detail and done plan items in the turn row, sending messages in comms, and the code fence language label.
  • No change to the search overlay's forget ✕: it sits inside an option, so a button there would be a nested control. Delete on the active option already does the same thing. No change to the canvas pages row either: it already contains a keyboard-operable role="button", and the outer click only makes the hit area bigger.

Storybook

  • color-contrast now runs under bun run test:storybook.
  • During that run, motion jumps straight to its end state (MotionGlobalConfig.skipAnimations). Otherwise axe can measure an entrance fade partway through.
  • A story can turn this one rule off with contrastExempt(reason) from stories/lib/a11y.ts. There are three reasons:
    • disabled: the command compact disabled row and InputGroup Disabled.
    • code-content: syntax and ANSI colours in the editor and terminal stories. Atlas dark's syntax colours are Pierre's palette.
    • every-theme: the Tag story that draws all 15 themes.

Gates

typecheck, test (652), test:storybook (853/853, contrast on), format:check and theme:check all pass.

Atlas dark muted-foreground #585858 -> #939393 (2.40 -> 5.55:1 on the
popover, its worst surface) and text.disabled #3f3f3f -> #858585
(1.62 -> 4.62:1). The same floor in atlas light, atlas-mono, chyral and
phosphor. text.disabled is pinned in those themes: the derived 0.2 mix
cannot pass without lifting muted-foreground above secondary-foreground.
terminal.ansi.bright_black keeps its old value where muted moved.

Refs ATL-1006
@uzayer
uzayer merged commit 23f0b41 into main Nov 11, 2026
1 check passed
@uzayer
uzayer deleted the uzayermasud/atl-1006-package-a11y branch November 11, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant