# Design System Migration Guide This guide helps migrate from the legacy frontend system to the unified design system. ## Overview The ThrillWiki frontend was consolidated from two parallel systems: - **Legacy System** (`/backend/templates/`, `/backend/static/css/`) - HSL-based variables, Font Awesome icons - **Modern System** (`/templates/`, `/static/css/`) - RGB hex-based design tokens, SVG icons The unified system uses `design-tokens.css` as the single source of truth. ## CSS Migration ### Color Variables Replace HSL-based variables with design tokens: ```css /* Before (legacy) */ background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); /* After (design tokens) */ background-color: var(--color-primary); color: var(--color-primary-foreground); ``` ### Common Replacements | Legacy | Design Token | |--------|--------------| | `hsl(var(--primary))` | `var(--color-primary)` | | `hsl(var(--secondary))` | `var(--color-secondary)` | | `hsl(var(--background))` | `var(--color-background)` | | `hsl(var(--foreground))` | `var(--color-foreground)` | | `hsl(var(--muted))` | `var(--color-muted)` | | `hsl(var(--accent))` | `var(--color-accent)` | | `hsl(var(--destructive))` | `var(--color-destructive)` | | `hsl(var(--border))` | `var(--color-border)` | | `hsl(var(--card))` | `var(--color-card)` | ### Font Variables ```css /* Before */ font-family: var(--font-sans); /* After */ font-family: var(--font-family-sans); ``` ### Shadow Variables ```css /* Before */ box-shadow: var(--shadow); /* After */ box-shadow: var(--shadow-base); ``` ## Icon Migration Replace Font Awesome icons with the SVG icon component: ```html {% include "components/ui/icon.html" with name="search" %} {% include "components/ui/icon.html" with name="user" %} {% include "components/ui/icon.html" with name="heart" %} ``` ### Icon Name Mapping | Font Awesome | SVG Icon | |--------------|----------| | `fa-search` | `search` | | `fa-user` | `user` | | `fa-users` | `users` | | `fa-cog` | `settings` | | `fa-heart` | `heart` | | `fa-star` | `star` | | `fa-home` | `home` | | `fa-edit` | `edit` | | `fa-trash` | `trash` | | `fa-copy` | `copy` | | `fa-external-link` | `external-link` | | `fa-chevron-down` | `chevron-down` | | `fa-chevron-up` | `chevron-up` | | `fa-chevron-left` | `chevron-left` | | `fa-chevron-right` | `chevron-right` | | `fa-check` | `check` | | `fa-times` | `close` | | `fa-plus` | `plus` | | `fa-minus` | `minus` | | `fa-bars` | `menu` | ### Icon Sizes ```html {% include "components/ui/icon.html" with name="search" size="sm" %} {% include "components/ui/icon.html" with name="search" size="lg" %} {% include "components/ui/icon.html" with name="search" size="xl" %} ``` ## Button Migration ### Basic Buttons ```html {% include "components/ui/button.html" with text="Click Me" variant="default" %} {% include "components/ui/button.html" with text="Click Me" variant="secondary" %} {% include "components/ui/button.html" with text="Delete" variant="destructive" %} {% include "components/ui/button.html" with text="Outline" variant="outline" %} ``` ### Buttons with Icons ```html {% include "components/ui/button.html" with text="Search" icon="search" %} ``` ### Link Buttons ```html Go {% include "components/ui/button.html" with text="Go" href="/url" %} ``` ## Form Input Migration ```html
Content here
Content here
" footer_content="" %} ``` ## Modal Migration ```html