--- title: "Design Reference File" description: "Keep brand-book.html and ui-kit.html at project root as permanent Claude Code context for consistent UI generation" tags: [design-system, frontend, web, ui, consistency, brand, color-palette, tailwind] --- # Design Reference File — CLAUDE.md Pattern Keep `brand-book.html` and `ui-kit.html` at the project root as permanent context files. Claude Code reads them before generating any UI — every new page inherits your design system automatically. Inspired by Boris Paillard's workflow (mixt.care, March 2026): once the design system is in place, new pages take 5 minutes instead of 30. ## The Problem When building a website with Claude Code across multiple sessions, every new page risks drifting from the design — wrong colors, inconsistent typography, new component variants. Re-stating design constraints in each prompt is repetitive and unreliable. ## The Solution Two HTML files at the project root act as a design memory Claude can read at any time: - `brand-book.html` — color palette with semantic roles, fonts, CSS variables, WCAG contrast ratios - `ui-kit.html` — documented components (buttons, forms, trust bars, section labels) One CLAUDE.md instruction makes Claude reference them before every UI task. ## Project Structure ``` project/ ├── brand-book.html # Color palette + typography + CSS variables (permanent reference) ├── ui-kit.html # Component library documented with Tailwind ├── CLAUDE.md # Design system instruction below ├── src/ │ ├── styles/ │ │ └── tokens.css # CSS variables extracted from brand-book.html │ └── components/ └── ... ``` ## CLAUDE.md Snippet Add this to your project-level `CLAUDE.md`: ```markdown ## Design System Always read `brand-book.html` and `ui-kit.html` before generating any UI component, page, or layout. Rules: - Never hardcode colors or font sizes — use CSS variables from brand-book.html - Reuse components from ui-kit.html before creating new variants - New pages must use the same design tokens (--color-primary, --font-primary, etc.) - If a requested design element is not in the UI kit, document it in ui-kit.html after creating it ``` ## Step 1 — Generate brand-book.html ``` Create a brand-book.html file at the project root. For each color in my palette, display a card showing: - Color swatch (120×80px block) - Name, hex code, RGB values, HSL values - CSS variable name (e.g. --color-primary) - Semantic role: PRIMARY | DARK | LIGHT | ACCENT | NEUTRAL - Usage rule in plain text (e.g. "CTAs, buttons, active links") - WCAG contrast ratio vs white: X.X:1 — AA PASS/FAIL — AAA PASS/FAIL - WCAG contrast ratio vs black: X.X:1 — AA PASS/FAIL — AAA PASS/FAIL My palette: [LIST YOUR COLORS AND ROLES HERE] My fonts: [LIST YOUR FONTS HERE] Include a type scale section: 12px / 16px / 20px / 24px / 32px / 48px / 64px / 96px with rem equivalents. At the bottom, output a copyable