# CSS Migration Guide This guide documents the migration from legacy `.igny8-*` classes and `--igny8-*` variables to the new standardized design token system. ## Overview All design tokens are now centralized in `/src/styles/tokens.css` with plain naming (no "igny8" prefix). The legacy `igny8-colors.css` file is maintained for backward compatibility but should not be used in new code. ## Color Token Migration ### CSS Variables **Before:** ```tsx
Content
``` **After:** ```tsx
Content
``` ### Complete Variable Mapping | Legacy Variable | New Token | Usage | |----------------|-----------|-------| | `--igny8-blue` | `--color-primary` | Primary brand color | | `--igny8-blue-dark` | `--color-primary-dark` | Primary dark variant | | `--igny8-green` | `--color-success` | Success states | | `--igny8-green-dark` | `--color-success-dark` | Success dark variant | | `--igny8-amber` | `--color-warning` | Warning states | | `--igny8-amber-dark` | `--color-warning-dark` | Warning dark variant | | `--igny8-red` | `--color-danger` | Danger/error states | | `--igny8-red-dark` | `--color-danger-dark` | Danger dark variant | | `--igny8-purple` | `--color-purple` | Purple accent | | `--igny8-purple-dark` | `--color-purple-dark` | Purple dark variant | ## Utility Class Migration ### Background Colors **Before:** ```tsx
Content
``` **After (Option 1 - Tailwind):** ```tsx
Content
``` **After (Option 2 - CSS Variable):** ```tsx
Content
``` ### Text Colors **Before:** ```tsx Text ``` **After (Option 1 - Tailwind):** ```tsx Text ``` **After (Option 2 - CSS Variable):** ```tsx Text ``` ### Border Colors **Before:** ```tsx
Content
``` **After (Option 1 - Tailwind):** ```tsx
Content
``` **After (Option 2 - CSS Variable):** ```tsx
Content
``` ## Component Migration ### Buttons **Before:** ```tsx Click me ``` **After:** ```tsx import Button from '@/components/ui/button/Button'; ``` ### Badges **Before:** ```tsx New ``` **After:** ```tsx import Badge from '@/components/ui/badge/Badge'; New ``` ### Cards **Before:** ```tsx
Title
Content
``` **After:** ```tsx import { Card, CardTitle, CardContent } from '@/components/ui/card/Card'; Title Content ``` ## Gradients **Before:** ```tsx
Content
``` **After:** ```tsx
Content
``` Or use the Button component with `variant="gradient"`: ```tsx ``` ## Active Classes (Still in Use) These classes are still actively used and should continue to be used: - `.igny8-table-container` - Table wrapper with loading states - `.igny8-table-wrapper` - Table scroll wrapper - `.igny8-table-compact` - Compact table styling - `.igny8-table-smooth` - Smooth table transitions - `.igny8-table-body` - Table body styling - `.igny8-skeleton-row` - Loading skeleton rows - `.igny8-header-metrics` - Header metrics container - `.igny8-header-metric` - Individual metric - `.igny8-header-metric-accent` - Metric accent color - `.igny8-header-metric-label` - Metric label - `.igny8-header-metric-value` - Metric value - `.igny8-header-metric-separator` - Metric separator ## Migration Checklist When updating a file: - [ ] Replace `--igny8-*` variables with `--color-*` tokens - [ ] Replace `.igny8-bg-*` with `bg-brand-500` or `bg-[var(--color-primary)]` - [ ] Replace `.igny8-text-*` with `text-brand-500` or `text-[var(--color-primary)]` - [ ] Replace `.igny8-border-*` with `border-brand-500` or `border-[var(--color-primary)]` - [ ] Replace hardcoded buttons with `