# Design with Tokens How to translate design intent into WordPress block attributes using theme.json presets. ## Design Decisions ### Purpose What does this pattern achieve for the end user? A hero converts visitors. A testimonial grid builds trust. A pricing table drives comparison. Let purpose drive every subsequent choice. ### Tone | Tone | Color Strategy | Typography | Layout | |------|---------------|------------|--------| | **Bold/energetic** | High contrast, accent backgrounds, gradients | XX-large headings, tight letter-spacing, uppercase accents | Full-width, asymmetric columns, large padding | | **Minimal/refined** | Base + contrast only, subtle tertiary sections | Restrained sizes, generous line-height | Constrained width, generous whitespace, centered | | **Editorial/magazine** | Dark sections alternating with light | Mixed font families, varied heading scales | Asymmetric splits (66/33), media-text blocks | | **Playful/creative** | Multiple accent colors, bright backgrounds | Large display sizes, varied weights | Grid layouts, unexpected column ratios, rounded corners | | **Corporate/professional** | Neutral palette, primary for CTAs only | Consistent scale, body font dominant | Equal columns, structured grid, minimal decoration | ### Spatial Composition Primary layout strategies: - **Constrained centered** — classic content width with wide breakouts - **Full-width sections** — alternating background bands - **Asymmetric split** — 60/40 or 70/30 columns with content + media - **Grid** — block-native grid or columns layouts for cards, team members, portfolio items - **Stacked vertical** — flex column with varied spacing for editorial feel ### Typography Hierarchy Plan your type scale before writing markup: - **Hero heading**: `fontSize:"xx-large"` + `fontFamily:"heading"` + tight `lineHeight` - **Section heading**: `fontSize:"x-large"` + `fontFamily:"heading"` - **Subtitle/lead**: `fontSize:"large"` + `textColor:"secondary"` or `fontFamily:"body"` - **Body**: `fontSize:"medium"` or default - **Caption/meta**: `fontSize:"small"` + `textColor:"secondary"` Add at least one typographic accent: - Uppercase + letter-spacing for labels: `{"style":{"typography":{"textTransform":"uppercase","letterSpacing":"0.1em"}}}` - Tight letter-spacing on display headings: `{"style":{"typography":{"lineHeight":"1.1"}}}` - Italic for pull quotes - Monospace for technical/code content - Generous leading on body: `{"style":{"typography":{"lineHeight":"1.8"}}}` ### Color Strategy Plan section-by-section color flow: - **Light section**: `base` background, `contrast` text (default) - **Dark section**: `contrast` background, `base` text (inverted) - **Accent section**: `primary` or `tertiary` background - **Gradient section**: cover block with gradient overlay A pattern with multiple sections should vary backgrounds — don't use the same background for every section. ## Core Principle In block patterns, **all visual design** is expressed through: 1. **`preset` slugs** — reference theme.json values by name (preferred) 2. **Style attributes** — inline custom values in block JSON (fallback) 3. **Block nesting** — layout and composition via container blocks Never use inline `