Skip to content

fix(site): raise light destructive token contrast and align error role to tokens - #30282

Draft
chrifro wants to merge 3 commits into
mainfrom
fix-destructive-token-contrast
Draft

chrifro wants to merge 3 commits into
mainfrom
fix-destructive-token-contrast

Conversation

@chrifro

@chrifro chrifro commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The light theme --content-destructive and --border-destructive tokens were #ef4444, so destructive text such as the "Failed" workspace status on /workspaces was 3.78:1 on white, failing WCAG AA 1.4.3 (axe Auditor issue 2871489). Both tokens are now #dc2626 (0 72.2% 50.6%), which is 4.83:1.

The light and dark error roles in theme/*/roles.ts now read the CSS tokens instead of hardcoded Tailwind palette values, moving toward one way of applying color tokens:

error role key Light before Dark before Now
background red-100 red-950 --surface-destructive
outline red-500 red-600 --border-destructive
fill.solid, fill.outline red-600 red-400 --content-destructive

Every swapped value matches its token within rounding, except outline, which is the intended change: light goes from 3.76:1 to 4.83:1 and dark from #dc2626 (4.12:1) to #f87171 (7.24:1). text stays on the palette because no matching token exists. The only role consumer is the workspace build timings chart, which uses these values as CSS fill/borderColor, so CSS variables work there. Colorblind themes have their own roles and token overrides and are unchanged.

Theme Before After
Light before light after light
Dark before dark after dark

Screenshots are rendered replicas of the affected elements (status text, destructive border, timings failure bar) using the exact old and new token values, with contrast computed against the page background.

Decision log
  • Scoped the role cleanup to error because it maps cleanly onto the destructive token family. Other roles have coincidental or semantically mismatched token matches (for example info.background equals --content-invert, notice.fill.outline equals --content-link), so they were left alone.
  • danger was not touched: colorblind.test.ts asserts tritan danger equals the base theme's danger.
  • Values use the existing "hsl(var(--token))" string pattern already used across chart code.

This PR was generated by Coder Agents on behalf of @chrifro.

…e to tokens

Light --content-destructive and --border-destructive move from #ef4444
to #dc2626 so destructive text such as the Failed workspace status meets
WCAG AA 1.4.3 on white (3.78:1 to 4.83:1).

The light and dark error roles now read surface, border, and content
destructive tokens instead of hardcoded Tailwind palette values.
@linear-code

linear-code Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

DEQ-440

DEQ-385

DEQ-321

This branch has not been deployed

No deployments
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