# MTG Deckbuilder Web UI Style Guide ## Design Tokens Design tokens provide a consistent foundation for all UI elements. These are defined as CSS custom properties in `code/web/static/styles.css`. ### Spacing Scale Use the spacing scale for margins, padding, and gaps: ```css --space-xs: 0.25rem; /* 4px - Tight spacing within components */ --space-sm: 0.5rem; /* 8px - Default gaps between small elements */ --space-md: 0.75rem; /* 12px - Standard component padding */ --space-lg: 1rem; /* 16px - Section spacing, card gaps */ --space-xl: 1.5rem; /* 24px - Major section breaks */ --space-2xl: 2rem; /* 32px - Page-level spacing */ ``` **Usage examples:** - Chip gaps: `gap: var(--space-sm)` - Panel padding: `padding: var(--space-md)` - Section margins: `margin: var(--space-xl) 0` ### Typography Scale Consistent font sizes for hierarchy: ```css --text-xs: 0.75rem; /* 12px - Meta info, badges */ --text-sm: 0.875rem; /* 14px - Secondary text */ --text-base: 1rem; /* 16px - Body text */ --text-lg: 1.125rem; /* 18px - Subheadings */ --text-xl: 1.25rem; /* 20px - Section headers */ --text-2xl: 1.5rem; /* 24px - Page titles */ ``` **Font weights:** ```css --font-normal: 400; /* Body text */ --font-medium: 500; /* Emphasis */ --font-semibold: 600; /* Headings */ --font-bold: 700; /* Strong emphasis */ ``` ### Border Radius Consistent corner rounding: ```css --radius-sm: 4px; /* Subtle rounding */ --radius-md: 6px; /* Buttons, inputs */ --radius-lg: 8px; /* Panels, cards */ --radius-xl: 12px; /* Large containers */ --radius-full: 999px; /* Pills, chips */ ``` ### Color Tokens #### Semantic Colors ```css --bg: #0f0f10; /* Page background */ --panel: #1a1b1e; /* Panel/card backgrounds */ --text: #e8e8e8; /* Primary text */ --muted: #b6b8bd; /* Secondary text */ --border: #2a2b2f; /* Borders and dividers */ --ring: #60a5fa; /* Focus indicator */ --ok: #16a34a; /* Success states */ --warn: #f59e0b; /* Warning states */ --err: #ef4444; /* Error states */ ``` #### MTG Color Identity ```css --green-main: rgb(0,115,62); --green-light: rgb(196,211,202); --blue-main: rgb(14,104,171); --blue-light: rgb(179,206,234); --red-main: rgb(211,32,42); --red-light: rgb(235,159,130); --white-main: rgb(249,250,244); --white-light: rgb(248,231,185); --black-main: rgb(21,11,0); --black-light: rgb(166,159,157); ``` ## Component Patterns ### Chips Chips display tags, status indicators, and metadata. **Basic chip:** ```html Label ``` **Chip containers:** ```html