Skip to content

Design system: migrate raw amber/slate/rose Tailwind colors used for semantic warning state onto --color-warning #2161

Closed

Description

@AwsomeFox

Split from #1533 §3, found during the audit in that issue's latest comment. Re-measured on c44baf05a.

Context

#1533's PR (landing alongside this issue) defines --color-warning: #d97706 — the token four call sites (GroupActionRunner.tsx:414,466, ActionUseFlow.tsx:316, BattleMap.tsx:508) already referenced via var(--color-warning, #d97706) but which was undefined anywhere in the CSS cascade until now. That PR is deliberately narrow: it defines the token at the exact value those call sites already fell back to (zero visual change) and does not touch any of the raw Tailwind color usage described below.

The remaining problem

amber-* Tailwind utility classes are still used directly for semantic warning state across the app, instead of resolving through --color-warning (now that it exists) or the --cf-* semantic alias family (--cf-success, --cf-danger, etc. at index.css:415-419). Sampled sites (not exhaustive — re-grep before starting):

  • AudienceField.tsx:61
  • StaleWriteConflict.tsx:64
  • EntityRevealDialog.tsx:64
  • VisibleToPlayersBar.tsx:95,113
  • EncounterWhisperComposer.tsx:65
  • QuickRollButtons.tsx:171
  • RunSessionPage.tsx:4434,4458,4489
  • SpellbookPanel.tsx:260,463,484
  • A dozen+ admin cards: CampaignAuditPage.tsx:294, StorageCard.tsx:188, UsersCard.tsx:666,673, AiPricingEditor.tsx:198, TokensCard.tsx:288,293,380, MembersPage.tsx:483,862,863,1612,1614,1617, AuditLogCard.tsx:173, ResetRequestsCard.tsx:117,118, RulePacksCard.tsx:385,386, OidcCard.tsx:333,340, campaignAuditDisplay.tsx:96

The original #1533 measurement cited "126 amber-, 376 slate-, and 130 rose-* raw Tailwind colours used for semantic state" (the rose/slate figures likely overlap with #593's separate raw-text-color tracking — re-verify before scoping). This has the same shape as #1688 (the --spacing-* bridge): a large call-site count with essentially no dedicated visual-regression coverage for the affected surfaces.

Scope

Depends on

The --color-warning token definition, landing in the PR referenced from #1533.

Related

Activity

  1. AwsomeFox commented on Aug 11, 2026

    @AwsomeFox
    OwnerAuthor

    Agent Workpad

    State: CLAIM_CANDIDATE
    Tool: claude
    Run ID: claude-20260810T235000Z-2161
    Claimed at: 2026-08-10T23:50:00Z
    Lease until: 2026-08-11T01:20:00Z
    Branch: claude/backlog-2161-semantic-warning-token

    Migrate raw amber/slate/rose Tailwind classes used for semantic warning state onto --color-warning.

    Blocker: None


    Generated by Claude Code

  2. added
    agent: claude
    agent: claimed
    on Aug 11, 2026
  3. AwsomeFox commented on Aug 11, 2026

    @AwsomeFox
    OwnerAuthor

    Agent Workpad — state update (run claude-20260810T235000Z-2161)

    State: WAITING_CI
    Continues: claim comment 5247743181
    Branch: claude/backlog-2161-semantic-warning-token
    PR: #2203 (draft)
    Latest head: 3bd47ad085a0a80de57b95314a39c98b8499e48e (base 88e8175f4)

    Posted as a follow-up rather than an edit: this MCP surface exposes no comment-update operation, so workpad transitions for this run are appended. Treat the newest comment carrying this Run ID as current. The worker correctly declined to post a duplicate workpad and flagged the gap instead.

    Scope delivered

    16 sites migrated across 12 files — border/background-tint only, plus one solid-fill button. ~136 of 152 re-measured raw amber-* sites deliberately excluded, each with a stated reason: readable warning text colour (no text-safe tonal variant exists for --color-warning the way it does for --color-danger), amber-950 muted dark surfaces that would visibly lighten, a decorative admin-card-heading pattern that titles cards rather than warning, and multi-state interactive controls. No slate-* or rose-* site was touched — every candidate checked turned out to be neutral chrome or unrelated danger state, which is the answer I'd expect and wanted confirmed rather than assumed.

    That ratio is the right shape for this issue. A sweep of all 152 would have recoloured a lot of things that are amber without meaning "warning."

    The measurement that changed the work

    The worker initially treated amber-600 as byte-identical to --color-warning (#d97706), which would have made this a no-op formalization. Measuring through real Chromium showed otherwise: Tailwind v4 ships colours as oklch(), and amber-600 resolves to rgb(225,113,0) against --color-warning's rgb(217,119,6). Small, but real — and it means every migrated site is an actual pixel change requiring contrast verification, not a rename.

    Sixth instance this session of a source-level assumption falling to a measurement. Consistent enough now to be a property of this codebase rather than a run of bad luck.

    Coordinator caveat for review — one number worth a second look

    The solid-fill button (white on amber) is reported as moving 3.20:1 → 3.19:1. The worker flagged it honestly as a pre-existing sub-AA condition not introduced here, and that framing is fair. But two things should be checked in review rather than accepted from the report:

    1. Which WCAG threshold applies. 3:1 is the floor for large text and for non-text UI component boundaries; normal-size text on a filled button needs 4.5:1. If that label is normal-size body text, both the old and new values fail, and this change — while not the cause — moves it fractionally further from compliance.
    2. Whether "pre-existing" is the right disposition. Making a known-failing contrast marginally worse is defensible when the alternative is leaving the site off the token entirely, but it should be a decision someone made, not a rounding error that rode along.

    If it turns out to be normal-size text below 4.5:1, that deserves its own issue rather than being absorbed here — the fix is a token or a foreground change, not a scope expansion of this PR.

    Validation

    lint clean, typecheck clean, test:unit:web 2666/2666 including 13 new guard assertions in warning-token-migration.unit.spec.ts. test:e2e not run locally; the worker verified specifically that control-surface-goldens.spec.ts does not screenshot or pin any of the 16 changed declarations, checking its Locator scopes rather than assuming. CI's e2e-web axe color-contrast check is authoritative for anything that reasoning missed — which, given this session's record, is the right place to put the trust.

    Remaining

    CI on #2203, then the review loop. This PR has had no independent review from me — I'm out of context to do one properly, and a rubber stamp would be worse than the gap.


    Generated by Claude Code

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: claimedagent: claude

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions