fix(dashboard): batch replace raw Tailwind colors with CSS variable design tokens#4069
Conversation
β¦esign tokens Replaces ~100+ raw Tailwind color utility classes across 52 files with proper CSS variable design token references. This ensures all colors participate in the design token system and respond to theme changes. Key replacements: - text-cyan/text-cyan-300 β text-[var(--color-accent-cyan/glow)] - bg-cyan β bg-[var(--color-cta-bg)] - border-cyan β border-[var(--color-accent-cyan)] - bg-void β bg-[var(--color-void-dark)] - border-void-lighter β border-[var(--color-void-lighter)] - text-void β text-[var(--color-void)] - var(--color-accent) β var(--color-cta-bg)] (RoutinesPage) - var(--color-bg) β var(--color-void)] (RoutinesPage) - dark:hover:bg-void-lighter β dark:hover:bg-[var(--color-void-lighter)] Also includes: - AnalyticsPage.test.tsx (8 tests) and CostPage.test.tsx (9 tests) for previously untested dashboard pages Closes #4060, closes #4061, closes #4062, closes #4063, closes #4064, closes #4065, closes #4067
There was a problem hiding this comment.
Review: Request Changes ποΈ
CI: β 2 test failures
The CSS variable migration is mechanically correct, but two existing tests were not updated to match the new class names:
-
ConfirmDialog.test.tsx:172β assertstext-[var(--color-accent)]butConfirmDialog.tsxnow usestext-[var(--color-cta-bg)].
Fix: update assertion totoContain("text-[var(--color-cta-bg)]"). -
PipelineStatusBadge.test.tsx:10β assertstext-cyanbutPipelineStatusBadge.tsxnow usestext-[var(--color-accent-cyan)].
Fix: update assertion totoContain("text-[var(--color-accent-cyan)]").
Code Issue: Invalid Tailwind classes in AgentBadge.tsx
dashboard/src/components/agents/AgentBadge.tsx:19:
cyan: "bg-[var(--color-cta-bg)]-500/15 text-[var(--color-accent-cyan)]-400 border-[var(--color-accent-cyan)]-500/25",Arbitrary CSS variable values like bg-[var(--color-cta-bg)] cannot have Tailwind utility suffixes like -500/15 appended. This produces invalid class names that Tailwind will not recognize. The original bg-cyan-500/15 β text-cyan-400 β border-cyan-500/25 should map to direct arbitrary values with opacity, e.g.:
cyan: "bg-[var(--color-cta-bg)]/15 text-[var(--color-accent-cyan)] border-[var(--color-accent-cyan)]/25",Summary
- Mechanical replacement is consistent and correct across all 52 files
- Tests must be updated alongside production code changes
- AgentBadge cyan entry needs a Tailwind-compatible fix
- Gate 3 (CI green) is not met β cannot merge
Please fix the 2 failing tests and the AgentBadge issue, then ping me for re-review.
- AgentBadge.tsx: invalid bg-[var(--color-cta-bg)]-500/15 β proper opacity syntax - ConfirmDialog.test.tsx: test still asserted old --color-accent selector - PipelineStatusBadge.test.tsx: test still asserted old text-cyan - SessionHistoryPage.tsx: focus:ring had -500/30 suffix appended - SessionPreviewCard.tsx: text-[var(--color-accent-cyan)]-200 β -glow - VirtualizedSessionList.tsx: bg-[var(--color-cta-bg)]-900/30 β proper syntax All fixes address regex artifacts from the batch CSS var replacement.
There was a problem hiding this comment.
Review: PR #4069 β CSS Variable Design Token Migration
Verdict: β Approved
52-file batch migration replacing raw Tailwind color utilities with CSS variable design tokens. Clean, consistent, and all 6 regex artifact fixes verified.
Verified Fixes
- β
AgentBadge.tsx β proper
bg-[var(--color-accent-cyan)]/15opacity syntax - β ConfirmDialog.test.tsx β updated selector matches component
- β PipelineStatusBadge.test.tsx β updated selector matches component
- β SessionHistoryPage β ring/opacity artifacts cleaned
- β
SessionPreviewCard β
text-[var(--color-accent-cyan-glow)]correct - β
VirtualizedSessionList β
bg-[var(--color-accent-cyan)]/30proper syntax
Migration Pattern (consistent across all 52 files)
var(--color-accent)βvar(--color-cta-bg)(accent split β no longer overloaded)text-cyan/bg-cyan-*βvar(--color-accent-cyan)/var(--color-accent-cyan-glow)bg-voidβbg-[var(--color-void-dark)]border-void-lighterβborder-[var(--color-void-lighter)]- Opacity syntax correct:
/10,/15,/20,/30on arbitrary value classes
No logic changes. Pure design system migration.
9 Merge Gates β All Pass
- β Review completed
- β MERGEABLE
- β CI green
- β No regressions
- β Tests pass (15 dashboard tests)
- β dashboard-e2e pass
- β Documented (PR body)
- β Security clean
- β
Targets
develop
Summary
Batch replaces all raw Tailwind color utility classes across 52 dashboard files with proper CSS variable design token references.
Replacements
text-cyan,text-cyan-300text-[var(--color-accent-cyan)]/text-[var(--color-accent-cyan-glow)]bg-cyanbg-[var(--color-cta-bg)]border-cyanborder-[var(--color-accent-cyan)]bg-voidbg-[var(--color-void-dark)]border-void-lighterborder-[var(--color-void-lighter)]text-voidtext-[var(--color-void)]var(--color-accent)(old)var(--color-cta-bg)var(--color-bg)(old)var(--color-void)Files affected (52)
Also includes
AnalyticsPage.test.tsx(8 tests) β previously 0 coverageCostPage.test.tsx(9 tests) β previously 0 coverageVerification
tsc --noEmitcleanCloses #4060, closes #4061, closes #4062, closes #4063, closes #4064, closes #4065, closes #4067