Skip to content

chore: add design system token layer and migrate hardcoded values#485

Open
eskp wants to merge 1 commit intostagingfrom
feature/design-system-token-migration
Open

chore: add design system token layer and migrate hardcoded values#485
eskp wants to merge 1 commit intostagingfrom
feature/design-system-token-migration

Conversation

@eskp
Copy link
Member

@eskp eskp commented Mar 4, 2026

Summary

  • Establish a three-layer token architecture so all UI code references semantic CSS variables instead of raw hex/rgb values, preventing visual drift and making theme changes propagate automatically
  • Adds a CI-ready audit script (scripts/token-audit.js) that scans for hardcoded visual values, suggests the correct token, and exits non-zero on errors -- 98 errors resolved to reach zero across 18 files
  • Centralizes the project/tag color palette into a shared module to eliminate three duplicate arrays

Test plan

  • Run node scripts/token-audit.js -- should report 0 errors (74 warnings expected)
  • Hub pages render correctly: protocol cards, detail view, strip, minimap all use correct colors
  • Template badges show correct blue styling in both light and dark mode
  • Project and tag color pickers still function with the shared palette
  • SVG connection dots and animated borders render correctly
  • Project dot fallback color (when no color assigned) renders as muted text color
  • pnpm build succeeds with no type errors

Establish a three-layer token architecture so all UI code references
semantic CSS variables instead of raw hex/rgb values, preventing
visual drift and making theme changes propagate automatically.

- Create specs/design-system/ with foundation specs, component specs,
  and a tokens.css file defining Layer 1 (primitives) and Layer 2
  (semantic aliases)
- Add scripts/token-audit.js that scans CSS and component files for
  hardcoded visual values, suggests the correct token, and exits
  with code 1 if errors are found (CI-ready)
- Replace 98 hardcoded color violations across 18 files with var()
  token references (hub surfaces, accent green, badge blues, palette
  fallbacks, SVG fills)
- Centralize the project/tag COLOR_PALETTE into keeperhub/lib/palette.ts
  and import from the three files that duplicated it
- Add design system usage rules to CLAUDE.md
@eskp eskp requested review from a team, OleksandrUA, joelorzet and suisuss and removed request for a team March 4, 2026 06:57
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🚀 PR Environment Deployed

Your PR environment has been successfully deployed!

Environment Details:

Components:

  • Keeperhub Application
  • PostgreSQL Database (isolated instance)
  • LocalStack (SQS emulation)
  • Redis (isolated instance)
  • Scheduler Dispatcher (staging image)
  • Scheduler Executor (staging image)
  • SC Event Tracker (staging image)
  • SC Event Worker (staging image)

The environment will be automatically cleaned up when this PR is closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant