feat(theme): dark/light mode with a Radix Colors-based palette

Adds a working Dark/Light toggle (next to the language switcher, same row
as EN/VI) and re-themes the whole dashboard, not just the handful of
components that already used semantic tokens.

- Tailwind darkMode:"class" + CSS-variable color tokens (client/src/index.css,
  tailwind.config.js): surface.0-5, border/border-light, accent/accent-hover,
  fg.primary/secondary/muted, status.success/danger/warning. One class flip
  on <html> re-themes everything — no per-element dark: variant pairs.
- useTheme() hook: localStorage-persisted, defaults to dark, no
  prefers-color-scheme fallback (client/src/hooks/useTheme.ts).
- Mechanical, table-driven migration (scripts/migrate-color-tokens.mjs,
  scripts/tokenize-status-colors.mjs, scripts/darken-status-colors.mjs) of
  every raw neutral/gray/slate + emerald/red/amber Tailwind utility across
  client/src onto the new tokens, so every badge/button/component pulls the
  same shade per status/role instead of each picking its own.
- Palette values are the literal Radix Colors (radix-ui.com/colors) scale
  constants — slate/blue/green/red/amber steps 1-12 — adopted after three
  rounds of hand-picked values that kept overshooting (flat, then too dark,
  then glaring); see docs/superpowers/specs/2026-07-31-color-redesign-
  dark-light-mode-design.md for the full history and role mapping.
- PipelineMap: done/current/failed/passed-no-evidence/detected share one
  visual language (border + text + translucent wash of the same status
  color); `current` alone stays a solid accent fill, the one state that
  gets to look bolder ("you are here").
- LaneCard: removed the stage/kind/auto-stage chips that duplicated the
  Workspace lane-detail header already showing them.

Categorical/decorative hues (violet, indigo, cyan, teal, sky, rose, pink,
orange, yellow, and blue where it plays a role-coloring part e.g. message
bubbles) are deliberately out of scope — collapsing those onto shared
tokens would erase the distinction between different kinds of thing, not
a status.
This commit is contained in:
2026-07-31 10:54:31 +07:00
parent 4905d63b97
commit b673363351
82 changed files with 3776 additions and 2578 deletions
+27 -12
View File
@@ -1,31 +1,46 @@
/**
* @file tailwind.config.js
* @description Tailwind CSS configuration — content globs and the dashboard's dark-theme design tokens.
* @description Tailwind CSS configuration — content globs and the dashboard's
* dark/light color tokens. Token values live in `src/index.css` as CSS
* variables (`:root` = light, `.dark` = dark); this file only wires Tailwind
* class names to them. RGB-triplet vars (not hex) so `<alpha-value>` keeps
* opacity modifiers like `bg-surface-2/70` working under either theme.
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
*/
/** @type {import('tailwindcss').Config} */
export default {
darkMode: "class",
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
colors: {
surface: {
0: "#06060a",
1: "#0c0c14",
2: "#13131e",
3: "#1a1a28",
4: "#222233",
5: "#2a2a3d",
0: "rgb(var(--surface-0) / <alpha-value>)",
1: "rgb(var(--surface-1) / <alpha-value>)",
2: "rgb(var(--surface-2) / <alpha-value>)",
3: "rgb(var(--surface-3) / <alpha-value>)",
4: "rgb(var(--surface-4) / <alpha-value>)",
5: "rgb(var(--surface-5) / <alpha-value>)",
},
border: {
DEFAULT: "#2a2a3d",
light: "#363650",
DEFAULT: "rgb(var(--border) / <alpha-value>)",
light: "rgb(var(--border-light) / <alpha-value>)",
},
accent: {
DEFAULT: "#6366f1",
hover: "#818cf8",
muted: "rgba(99, 102, 241, 0.15)",
DEFAULT: "rgb(var(--accent) / <alpha-value>)",
hover: "rgb(var(--accent-hover) / <alpha-value>)",
muted: "rgb(var(--accent) / 0.15)",
},
fg: {
primary: "rgb(var(--fg-primary) / <alpha-value>)",
secondary: "rgb(var(--fg-secondary) / <alpha-value>)",
muted: "rgb(var(--fg-muted) / <alpha-value>)",
},
status: {
success: "rgb(var(--status-success) / <alpha-value>)",
danger: "rgb(var(--status-danger) / <alpha-value>)",
warning: "rgb(var(--status-warning) / <alpha-value>)",
},
},
fontFamily: {