Description
The frontend uses TailwindCSS 4 with PostCSS but has no custom theme configuration beyond the default variables. There's no consistent color palette, typography system, spacing scale, or component style overrides. As the application grows with dozens of components, a well-defined design theme is essential for visual consistency.
Design system gaps:
- No CSS custom properties for brand colors beyond background/foreground
- No typography scale (font sizes, line heights, font weights)
- No spacing scale
- No shadow scale for elevation
- No border radius token system
- No breakpoint naming convention
- No animation/transition timing configuration
- No dark theme refinement (current dark theme is basic)
- No component-specific CSS variables for customization
- No brand asset integration (logo, icons)
Technical Context & Impact
- Affected Components/Files:
app/globals.css, tailwind.config.ts (missing - v4 doesn't need it but needs CSS config)
- Impact: Inconsistent visual design; hard to maintain theme changes
Step-by-Step Implementation Guide
- Define design tokens in
globals.css using @theme directive:
- Colors:
brand-50 through brand-950, success, warning, error, info
- Typography:
font-size-xs through font-size-5xl, font-leading, font-tracking
- Spacing:
space-1 through space-16 corresponding to 0.25rem increments
- Shadows:
shadow-sm, shadow-md, shadow-lg, shadow-xl
- Radii:
radius-sm, radius-md, radius-lg, radius-full
- Create CSS variable pattern for component customization:
.card { --card-bg: var(--color-surface); --card-border: var(--color-border); }
.btn { --btn-bg: var(--color-brand); --btn-text: white; }
- Implement comprehensive dark theme: Each semantic color has a dark variant; test all components in both themes
- Add brand assets:
/public/logo.svg, /public/icon.svg, /public/logo-mark.svg with proper sizing
- Create icon set: Use SVG sprite or
lucide-react for consistent icons across app
- Add TailwindCSS Typography plugin:
tailwindcss-typography for prose content formatting
- Document design system: Create
src/lib/design/DESIGN_TOKENS.md with visual examples of all tokens
- Create visual regression tests: Chromatic or Percy integration for component visual testing
Verification & Testing Steps
- Run
npm run build and verify CSS compiles without errors
- View dark mode and light mode for every component
- Verify brand colors are used consistently (not hardcoded hex values)
- Check typography scale: headers should use brand font, body uses system font
- Test shadow/elevation on cards, modals, and dropdowns
- Run
npx tsc --noEmit
Description
The frontend uses TailwindCSS 4 with PostCSS but has no custom theme configuration beyond the default variables. There's no consistent color palette, typography system, spacing scale, or component style overrides. As the application grows with dozens of components, a well-defined design theme is essential for visual consistency.
Design system gaps:
Technical Context & Impact
app/globals.css,tailwind.config.ts(missing - v4 doesn't need it but needs CSS config)Step-by-Step Implementation Guide
globals.cssusing@themedirective:brand-50throughbrand-950,success,warning,error,infofont-size-xsthroughfont-size-5xl,font-leading,font-trackingspace-1throughspace-16corresponding to 0.25rem incrementsshadow-sm,shadow-md,shadow-lg,shadow-xlradius-sm,radius-md,radius-lg,radius-full/public/logo.svg,/public/icon.svg,/public/logo-mark.svgwith proper sizinglucide-reactfor consistent icons across apptailwindcss-typographyfor prose content formattingsrc/lib/design/DESIGN_TOKENS.mdwith visual examples of all tokensVerification & Testing Steps
npm run buildand verify CSS compiles without errorsnpx tsc --noEmit