Use when the user asks about visual design, color theory, typography, layout, visual hierarchy, spacing, proportion, or UI aesthetics. Do NOT use for: design systems (design-design-systems), UX research (design-ux-research), or prototyping (design-prototyping).
Apply visual design principles — color theory, typography, layout grids, spacing systems, visual hierarchy, and aesthetic consistency — to create interfaces that are both beautiful and functional. Visual design serves usability: every decision about color, type, spacing, or layout should support clarity, readability, and user goals.
Visual hierarchy defined (size, color, position, whitespace strategy)
Accessibility requirements documented (focus indicators, reduced motion, text spacing)
Max Response Length
200 lines of spec, patterns, and configuration.
Framework/Methodology
Visual Design Decision Tree
What is the primary design goal?
├── Clarity and readability → Typography-first approach
│ Select readable typeface, generous line-height, strong hierarchy
├── Brand expression and emotion → Color-first approach
│ Start with brand palette, extend to UI semantic colors
├── Data density and precision → Layout-first approach
│ Establish grid system, information density rules, spacing constraints
└── Engagement and delight → Motion + visual hierarchy
Leading lines, focal points, depth through shadow/layering
The Four Pillars of Visual Design
Pillar
Definition
Key Techniques
Color
Hue, saturation, value relationships
Color harmony, contrast, temperature
Typography
Typeface selection and text styling
Hierarchy, readability, pairings
Layout
Spatial arrangement of elements
Grids, alignment, proximity
Spacing
Whitespace management
Padding, margin, density control
Visual Design Process
Problem → Information → Structure → Visual Design → Prototype → Validate
↑ ↓
Layout wireframes Visual spec + tokens
Content hierarchy Dark mode adaptation
User flows Responsive behavior
Workflow
Step 1: Establish Color System
Color Theory Foundations:
Hue: the pigment (red, blue, green) — 360° color wheel
Saturation: intensity/purity of the color — 0% (gray) to 100% (pure)
Lightness: how light or dark — 0% (black) to 100% (white)
Temperature: warm (reds, oranges, yellows) vs cool (blues, greens, purples)
Color Harmonies:
Harmony
Composition
Effect
Best For
Complementary
Opposite on color wheel
High contrast, energetic
CTAs, emphasis
Analogous
Adjacent on color wheel
Harmonious, peaceful
Backgrounds, branding
Triadic
Evenly spaced (120°)
Balanced, vibrant
Colorful interfaces
Split-complementary
Base + two adjacent to complement
High contrast, less tension
Versatile UI
Monochromatic
Single hue, varying lightness
Clean, sophisticated
Data viz, minimal design
Color Accessibility: Every text/background combination must meet WCAG AA (4.5:1 for text <18px, 3:1 for text >=18px bold). Use tools: WebAIM Contrast Checker, Stark for Figma, axe DevTools.
Proximity Rule: Elements that are functionally related should be visually grouped through spacing. Items within a group use tighter spacing (8-16px); groups of items use more spacing (24-40px). This replaces visible borders in many cases.
Size: Larger elements draw attention first — primary actions are bigger than secondary
Color: Bright/high-contrast elements advance; muted/low-contrast recede
Weight: Bold text stands out; regular weight recedes
Position: Top-left (LTR) is primary attention zone; bottom-right is lowest
Whitespace: More space around an element = more importance
Depth: Shadows, elevation, and layering create focal planes
Texture: Patterns, gradients, and imagery attract attention
F-Pattern Layout: Users scan content in an F-shaped pattern — horizontal across top, then down left side, then horizontal again. Place key information along these scan lines. For content-heavy pages, lead with the most important information in the top-left quadrant.
Z-Pattern Layout: For minimal or center-focused layouts (landing pages, marketing sites), users scan in a Z — top-left to top-right, diagonally down, bottom-left to bottom-right. Place your logo top-left, CTA top-right or bottom-right, and value prop along the diagonal path.
Step 5: Apply Accessibility to Visual Design
Focus indicators: 2px minimum, 3:1 contrast against adjacent colors, visible on all interactive elements
Color-not-reliance: Never convey information through color alone — add icons, patterns, text labels
Target sizes: 44x44px minimum for touch targets on mobile
Text spacing: Ensure layouts don't break when users override text spacing (WCAG 1.4.12)
Reduced motion: Test all animations reduce gracefully via prefers-reduced-motion
Focus order: Visual order matches DOM/tab order for logical navigation
Common Pitfalls
Pitfall
Description
Prevention
Low contrast text
Light gray text (#999, #AAA) on white is unreadable
Minimum 4.5:1 contrast for all text
Too many colors
Using 10+ distinct colors creates visual noise
Limit palette to 3-5 UI colors + neutrals
Inconsistent spacing
Random padding/margin values across components
Enforce an 8px grid system
Ignoring type hierarchy
Same size/weight for headings and body
Define a clear type scale (5+ levels)
Decorative overload
Add gradients, shadows, and effects without purpose
Every visual element must serve a function
No dark mode
Light-only design that breaks in dark environments
Case Study 1: Dark Mode Redesign Reduces Eye Strain
A productivity app used a pure white (#FFFFFF) background. After implementing a proper dark mode with reduced contrast (87% text, 60% secondary, 38% disabled on #1E1E1E background), user surveys showed 40% reduction in reported eye strain during evening use. The key was using true dark grays (#1E1E1E) instead of pure black (#000000) to reduce halation on OLED screens, and reducing saturation on accent colors from 100% to 75% for large surface areas.
Method: Color system extension with dark theme overrides, tested on OLED and LCD displays
Key insight: Dark surfaces should be dark gray, not black, and accent colors need desaturation for comfort
Impact: Eye strain reports -40%, evening DAU +25%
Case Study 2: Typography Overhaul Increases Readability Scores
A news website used 14px body text with 1.4 line-height and 90ch max-width. Readability testing showed 65% comprehension. After increasing to 18px body text, 1.6 line-height, 70ch max-width, and using a more open typeface (system fonts → Inter), comprehension improved to 85%. Time-on-page increased 35% and scroll depth improved by 50%.
Method: Typography audit → scale adjustment → readability testing with 30 participants
Key insight: Readability improvements benefit all users, not just those with visual impairments
Impact: Comprehension 65% to 85%, time-on-page +35%, scroll depth +50%
Case Study 3: Spacing System Reduces Development Time
An e-commerce team had 47 distinct spacing values across their CSS. Implementing an 8px-grid spacing system with 12 values eliminated all arbitrary spacing decisions. Developer productivity for layout tasks improved by 30%, and the visual consistency score (measured by design audit) increased from 62% to 94% in 3 months.
Method: Audit all spacing → define 12-value 8px grid → codify in design tokens
Key insight: Constraining choices improves both consistency and velocity
Impact: Dev velocity +30%, visual consistency 62% to 94%
Rules
Minimum text size: 14px body, 12px caption (accessibility)
Minimum contrast: 4.5:1 text, 3:1 large text, 3:1 UI elements (WCAG AA)
Limit typeface families to 2 per interface
Line length: 60-75 characters max for body text
Spacing follows an 8px grid (4px for micro adjustments)
Color conveys meaning, not decoration — semantic naming
Never use color as the only differentiator — add text or icon
Dark mode is not just inverted colors — redesign for dark environments
Every component has hover, active, disabled, focus, error states
Borders are last resort — use spacing and background to separate elements
Consistent border radius: pick one value (4px) and use it everywhere
Visual hierarchy should be apparent at a glance — 3 levels max depth
Shadows map to z-depth layers (card, modal, toast) — 3 levels max
Test all designs in grayscale to verify hierarchy works without color
Responsive design: mobile, tablet, desktop — design from smallest first
Loading states must match final layout structure (no layout shift)
Color in Depth
Color Psychology in UI
Color choices communicate meaning and influence user behavior:
Color
Associations
Best For
Risk
Blue
Trust, stability, professionalism
Finance, healthcare, enterprise
Common — hard to differentiate
Green
Growth, health, success, wealth
Finance, environment, health
Cultural variance (some cultures: luck vs danger)
Red
Urgency, passion, error
CTAs, alerts, sales
High arousal — can cause anxiety if overused
Orange/Yellow
Energy, optimism, warmth
Entertainment, food, children
Low contrast on white — accessibility risk
Purple
Creativity, luxury, wisdom
Beauty, spiritual, premium
Gender bias perception
Black/White
Sophistication, minimalism
Luxury, fashion, tech
Can feel cold or stark without warm accent
Pink
Playful, nurturing, sweet
Beauty, fashion, children
Gender stereotypes — use with awareness
Color System Architecture
Global palette (100+ colors)
↓
Semantic tokens (30-50 colors)
↓
Component tokens (mapped to semantic)
Global palette structure:
10 neutral grays (50-900 scale) for text, backgrounds, borders
5-10 accent colors (each with 50-900 scale) for primary, secondary, tertiary
Extended palette for data visualization (8-12 categorical colors, sequential + diverging scales)
Color Contrast Calculation
WCAG contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is relative luminance of lighter color and L2 of darker color. Relative luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B (linearized sRGB values).
Tools: WebAIM Contrast Checker, Stark plugin, axe DevTools. Never guess contrast — always verify algorithmically.
Typography in Depth
Typeface Anatomy for UI Decision-Making
When evaluating typefaces for UI, assess:
x-height: Larger x-height improves readability at small sizes (body text). Small x-height = more elegant, less readable.
Aperture: Open apertures (a, c, e) improve legibility. Closed apertures can cause confusion at small sizes.
Stroke contrast: Low contrast (sans-serif, humanist) for body text. High contrast (didone) for display only.
Counter size: Open counters improve letter recognition, especially on low-resolution screens.
Numeric figures: Tabular figures (fixed-width numbers) for tables and data. Proportional figures for running text.
Web Font Loading Strategy
<!-- Preload critical font -->
<link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>
<!-- Inline small font subset in CSS -->
<style>
@font-face {
font-family: 'Inter';
src: url('/fonts/inter-var.woff2') format('woff2');
font-display: swap; /* Show fallback text immediately, swap when font loads */
unicode-range: U+0000-00FF; /* Latin subset only */
}
</style>
font-display: swap prevents invisible text (FOIT) — text renders in fallback font immediately, swaps when custom font loads
Subset fonts to Latin/ASCII for initial load, load full character set after first paint
Use variable fonts (single .woff2 file for all weights) instead of individual weight files — reduces total font download 40-60%
Preconnect to font CDN (Google Fonts, Typekit) to reduce DNS lookup time
Readability Science
Variable
Optimal Range
Impact
Line length
50-75 characters (including spaces)
Too long: eye fatigue. Too short: disjointed reading
Line height
1.5-1.7 for body, 1.2-1.3 for headings
Too tight: lines blur together. Too loose: disconnected
Font size
16-18px body, 14px minimum for UI labels
Below 14px: significant readability decrease
Paragraph spacing
1.5x line height between paragraphs
Separates thought groups without breaking flow
Column width
1-3 columns for content
More than 3: scanning becomes difficult
Contrast
4.5:1 minimum (AA), 7:1 preferred (AAA)
Below 4.5:1: significant readability decrease in suboptimal conditions
references/visual-design-color-system.md — Color System Reference
references/visual-design-dark-mode.md — Dark Mode Design Reference
Handoff
Hand off to design-design-systems for token implementation. Hand off to design-brand-identity for brand consistency. Hand off to design-accessibility for WCAG compliance audit.
1---2name: design-visual-design3description: Use when the user asks about visual design, color theory, typography, layout, visual hierarchy, spacing, proportion, or UI aesthetics. Do NOT use for: design systems (design-design-systems), UX research (design-ux-research), or prototyping (design-prototyping).4license: MIT5---67# Visual Design89## Purpose10Apply visual design principles — color theory, typography, layout grids, spacing systems, visual hierarchy, and aesthetic consistency — to create interfaces that are both beautiful and functional. Visual design serves usability: every decision about color, type, spacing, or layout should support clarity, readability, and user goals.1112## Agent Protocol1314### Trigger15Exact user phrases: "visual design", "color theory", "typography", "layout", "visual hierarchy", "spacing", "proportion", "UI aesthetics", "make it look better", "design polish", "visual polish".1617### Input Context18- Product type (dashboard, marketing site, mobile app, data-heavy tool)19- Existing brand assets or design system tokens20- Target user demographics (age, accessibility needs, cultural context)21- Platform constraints (responsive breakpoints, screen sizes, rendering engine)22- Brand personality (professional, playful, luxurious, minimalist)2324### Output Artifact25Visual design specification with color system, typography scale, spacing grid, layout principles, and accessibility requirements.2627### Completion Criteria28- [ ] Color palette defined with primary, secondary, neutral, semantic colors29- [ ] All color combinations meet WCAG AA contrast ratios (4.5:1 text)30- [ ] Typography scale established (typeface, size, weight, line-height, letter-spacing)31- [ ] Spacing system defined (4px or 8px base unit with consistent scale)32- [ ] Layout grid specified (columns, gutters, margins, breakpoints)33- [ ] Visual hierarchy defined (size, color, position, whitespace strategy)34- [ ] Accessibility requirements documented (focus indicators, reduced motion, text spacing)3536### Max Response Length37200 lines of spec, patterns, and configuration.3839## Framework/Methodology4041### Visual Design Decision Tree42```43What is the primary design goal?44├── Clarity and readability → Typography-first approach45│ Select readable typeface, generous line-height, strong hierarchy46├── Brand expression and emotion → Color-first approach47│ Start with brand palette, extend to UI semantic colors48├── Data density and precision → Layout-first approach49│ Establish grid system, information density rules, spacing constraints50└── Engagement and delight → Motion + visual hierarchy51 Leading lines, focal points, depth through shadow/layering52```5354### The Four Pillars of Visual Design5556| Pillar | Definition | Key Techniques |57|--------|------------|----------------|58| Color | Hue, saturation, value relationships | Color harmony, contrast, temperature |59| Typography | Typeface selection and text styling | Hierarchy, readability, pairings |60| Layout | Spatial arrangement of elements | Grids, alignment, proximity |61| Spacing | Whitespace management | Padding, margin, density control |6263### Visual Design Process64```65Problem → Information → Structure → Visual Design → Prototype → Validate66 ↑ ↓67 Layout wireframes Visual spec + tokens68 Content hierarchy Dark mode adaptation69 User flows Responsive behavior70```7172## Workflow7374### Step 1: Establish Color System7576Color Theory Foundations:77- **Hue**: the pigment (red, blue, green) — 360° color wheel78- **Saturation**: intensity/purity of the color — 0% (gray) to 100% (pure)79- **Lightness**: how light or dark — 0% (black) to 100% (white)80- **Temperature**: warm (reds, oranges, yellows) vs cool (blues, greens, purples)8182Color Harmonies:8384| Harmony | Composition | Effect | Best For |85|---------|-------------|--------|----------|86| Complementary | Opposite on color wheel | High contrast, energetic | CTAs, emphasis |87| Analogous | Adjacent on color wheel | Harmonious, peaceful | Backgrounds, branding |88| Triadic | Evenly spaced (120°) | Balanced, vibrant | Colorful interfaces |89| Split-complementary | Base + two adjacent to complement | High contrast, less tension | Versatile UI |90| Monochromatic | Single hue, varying lightness | Clean, sophisticated | Data viz, minimal design |9192Color Accessibility: Every text/background combination must meet WCAG AA (4.5:1 for text <18px, 3:1 for text >=18px bold). Use tools: WebAIM Contrast Checker, Stark for Figma, axe DevTools.9394Dark Mode Strategy:95- Reduce contrast slightly (text: 87% white, secondary: 60%, disabled: 38%)96- Increase saturation on accent colors to maintain vibrancy on dark backgrounds97- Reduce saturation on large surface areas to prevent eye strain98- Preserve semantic color meanings (red = error, green = success)99- Test at low brightness settings on OLED displays100101```css102:root {103 --color-primary: #2563EB;104 --color-primary-hover: #1D4ED8;105 --color-primary-light: #DBEAFE;106 --color-secondary: #7C3AED;107 --color-neutral-50: #F9FAFB;108 --color-neutral-100: #F3F4F6;109 --color-neutral-200: #E5E7EB;110 --color-neutral-500: #6B7280;111 --color-neutral-700: #374151;112 --color-neutral-900: #111827;113 --color-success: #059669;114 --color-warning: #D97706;115 --color-error: #DC2626;116 --color-info: #0284C7;117}118[data-theme="dark"] {119 --color-primary: #3B82F6;120 --color-primary-hover: #60A5FA;121 --color-primary-light: #1E3A5F;122 --color-neutral-50: #18181B;123 --color-neutral-100: #27272A;124 --color-neutral-200: #3F3F46;125 --color-neutral-500: #A1A1AA;126 --color-neutral-700: #D4D4D8;127 --color-neutral-900: #FAFAFA;128}129```130131### Step 2: Build Typography System132133Type Classification:134- **Serif**: Traditional, readable in long form — best for body text in print, headlines in digital135- **Sans-serif**: Clean, modern, screen-optimized — default for digital UI136- **Monospace**: Equal-width characters — code, data, tabular figures137- **Display**: Decorative, limited use — headlines only, never body text138139Type Pairing Principles:140- One typeface family with multiple weights is safer than two typefaces141- If pairing: contrast in structure (serif + sans-serif), not in mood142- Use the 1.25 (Major Third) or 1.333 (Perfect Fourth) modular scale143- Limit to 2 typefaces max — one for headings, one for body144145```css146:root {147 --font-heading: 'Inter', system-ui, sans-serif;148 --font-body: 'Inter', system-ui, sans-serif;149 --font-mono: 'JetBrains Mono', monospace;150151 --text-xs: 0.75rem;152 --text-sm: 0.875rem;153 --text-base: 1rem;154 --text-lg: 1.125rem;155 --text-xl: 1.25rem;156 --text-2xl: 1.5rem;157 --text-3xl: 1.875rem;158 --text-4xl: 2.25rem;159160 --leading-tight: 1.25;161 --leading-normal: 1.5;162 --leading-relaxed: 1.75;163164 --tracking-tight: -0.025em;165 --tracking-normal: 0;166 --tracking-wide: 0.05em;167}168```169170Readability Guidelines:171- Body text: 16-18px, line-height 1.5-1.7, max line length 60-75 characters172- Headings: bold weight, shorter line-height (1.2-1.3), letter-spacing tightened173- Labels: 13-14px, medium weight, letter-spacing slightly opened174- Avoid: text blocks wider than 75ch, body text under 14px, justified alignment175176### Step 3: Design Spacing System177178The 8px Grid System:179- Base unit: 8px (4px for micro-spacing)180- All margins, padding, gaps are multiples of 8px (or 4px for fine-tuning)181- Consistently applied across all components and layouts182183```css184:root {185 --space-0: 0;186 --space-0\.5: 0.125rem;187 --space-1: 0.25rem;188 --space-2: 0.5rem;189 --space-3: 0.75rem;190 --space-4: 1rem;191 --space-6: 1.5rem;192 --space-8: 2rem;193 --space-12: 3rem;194 --space-16: 4rem;195 --space-20: 5rem;196 --space-24: 6rem;197}198```199200Spacing Density:201- **Comfortable**: Generous whitespace (32-48px between sections) — content-focused, reading202- **Default**: Balanced (24-32px) — general purpose UI203- **Compact**: Tighter (8-16px) — data-heavy dashboards, tables, dense tools204205Proximity Rule: Elements that are functionally related should be visually grouped through spacing. Items within a group use tighter spacing (8-16px); groups of items use more spacing (24-40px). This replaces visible borders in many cases.206207### Step 4: Create Layout System208209Grid Systems:210211| Grid Type | Columns | Gutter | Margin | Best For |212|-----------|---------|--------|--------|----------|213| 12-col | 12 | 24px | 16-80px | General responsive web |214| 8-col | 8 | 16px | 16-48px | Mobile-first, compact |215| 6-col | 6 | 32px | 24px | Dashboard widgets |216| Fluid | Auto-fill | 16px | 16px | Content lists, galleries |217218```css219.grid {220 display: grid;221 grid-template-columns: repeat(12, 1fr);222 gap: 24px;223 padding: 0 24px;224 max-width: 1200px;225 margin: 0 auto;226}227@media (max-width: 768px) {228 .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0 16px; }229}230```231232Visual Hierarchy Tools:233- **Size**: Larger elements draw attention first — primary actions are bigger than secondary234- **Color**: Bright/high-contrast elements advance; muted/low-contrast recede235- **Weight**: Bold text stands out; regular weight recedes236- **Position**: Top-left (LTR) is primary attention zone; bottom-right is lowest237- **Whitespace**: More space around an element = more importance238- **Depth**: Shadows, elevation, and layering create focal planes239- **Texture**: Patterns, gradients, and imagery attract attention240241F-Pattern Layout: Users scan content in an F-shaped pattern — horizontal across top, then down left side, then horizontal again. Place key information along these scan lines. For content-heavy pages, lead with the most important information in the top-left quadrant.242243Z-Pattern Layout: For minimal or center-focused layouts (landing pages, marketing sites), users scan in a Z — top-left to top-right, diagonally down, bottom-left to bottom-right. Place your logo top-left, CTA top-right or bottom-right, and value prop along the diagonal path.244245### Step 5: Apply Accessibility to Visual Design246247- Focus indicators: 2px minimum, 3:1 contrast against adjacent colors, visible on all interactive elements248- Color-not-reliance: Never convey information through color alone — add icons, patterns, text labels249- Target sizes: 44x44px minimum for touch targets on mobile250- Text spacing: Ensure layouts don't break when users override text spacing (WCAG 1.4.12)251- Reduced motion: Test all animations reduce gracefully via `prefers-reduced-motion`252- Focus order: Visual order matches DOM/tab order for logical navigation253254## Common Pitfalls255256| Pitfall | Description | Prevention |257|---------|-------------|------------|258| Low contrast text | Light gray text (#999, #AAA) on white is unreadable | Minimum 4.5:1 contrast for all text |259| Too many colors | Using 10+ distinct colors creates visual noise | Limit palette to 3-5 UI colors + neutrals |260| Inconsistent spacing | Random padding/margin values across components | Enforce an 8px grid system |261| Ignoring type hierarchy | Same size/weight for headings and body | Define a clear type scale (5+ levels) |262| Decorative overload | Add gradients, shadows, and effects without purpose | Every visual element must serve a function |263| No dark mode | Light-only design that breaks in dark environments | Design both themes in parallel |264| Over-relying on color | Red-only error states that colorblind users miss | Pair color with icons, text, or patterns |265| Dense text blocks | No whitespace in long-form content | Max width 75ch, generous line-height 1.6+ |266267## Best Practices268269| Practice | Rationale |270|----------|-----------|271| 60-30-10 color rule | 60% neutral, 30% primary, 10% accent — balanced palette |272| 8px grid for all spacing | Consistent rhythm, easier handoff, no arbitrary values |273| Modular typography scale | Mathematical consistency in type sizes, not guesswork |274| Max 75ch line length | Optimal reading speed and comprehension |275| Semantic color naming | `color-primary`, not `color-blue` — survives rebrands |276| Design in grayscale first | Forces focus on hierarchy and spacing before color |277| Test on actual devices | Emulators miss brightness, glare, and viewing angle issues |278| Consider colorblind users | 8% of males have some form of color vision deficiency |279| Respect OS-level preferences | Dark mode, reduced motion, high contrast settings |280| Consistent border radii | Pick one radius (4px) and use it everywhere |281282## Templates & Tools283284### Color Palette Generator Process285```yaml286primary: "#2563EB"287harmonies:288 complementary: "#EB9D25"289 analogous: ["#2596EB", "#2563EB", "#2546EB"]290 triadic: ["#25EB9D", "#2563EB", "#EB2596"]291neutrals:292 50: "#F9FAFB" (background)293 100: "#F3F4F6" (surface)294 200: "#E5E7EB" (border)295 500: "#6B7280" (secondary text)296 700: "#374151" (body text)297 900: "#111827" (headings)298semantic:299 success: "#059669"300 warning: "#D97706"301 error: "#DC2626"302 info: "#0284C7"303```304305### Typography System Template306```yaml307typefaces:308 heading: "Inter, system-ui, sans-serif"309 body: "Inter, system-ui, sans-serif"310 mono: "JetBrains Mono, monospace"311scale:312 display: "3rem/1.2" (48px)313 h1: "2.25rem/1.3" (36px)314 h2: "1.875rem/1.3" (30px)315 h3: "1.5rem/1.4" (24px)316 h4: "1.25rem/1.4" (20px)317 body: "1rem/1.6" (16px)318 small: "0.875rem/1.5" (14px)319 caption: "0.75rem/1.5" (12px)320```321322### Design Tools323324| Tool | Purpose | Best For |325|------|---------|----------|326| Figma | Full design tool, prototyping | End-to-end visual design |327| Adobe Color | Color harmony exploration | Palette creation, harmony testing |328| WebAIM Contrast Checker | WCAG contrast verification | Accessibility validation |329| Stark | Contrast, colorblind sim | Figma accessibility plugin |330| Type Scale Calculator | Modular type scale | Typography system design |331| Coolors | Palette generator | Rapid color exploration |332| Material Design Color Tool | Color system, accessible variants | Systematic palette creation |333| Sim Daltonism | Colorblindness simulator | Accessibility testing |334335## Case Studies336337### Case Study 1: Dark Mode Redesign Reduces Eye Strain338A productivity app used a pure white (#FFFFFF) background. After implementing a proper dark mode with reduced contrast (87% text, 60% secondary, 38% disabled on #1E1E1E background), user surveys showed 40% reduction in reported eye strain during evening use. The key was using true dark grays (#1E1E1E) instead of pure black (#000000) to reduce halation on OLED screens, and reducing saturation on accent colors from 100% to 75% for large surface areas.339340Method: Color system extension with dark theme overrides, tested on OLED and LCD displays341Key insight: Dark surfaces should be dark gray, not black, and accent colors need desaturation for comfort342Impact: Eye strain reports -40%, evening DAU +25%343344### Case Study 2: Typography Overhaul Increases Readability Scores345A news website used 14px body text with 1.4 line-height and 90ch max-width. Readability testing showed 65% comprehension. After increasing to 18px body text, 1.6 line-height, 70ch max-width, and using a more open typeface (system fonts → Inter), comprehension improved to 85%. Time-on-page increased 35% and scroll depth improved by 50%.346347Method: Typography audit → scale adjustment → readability testing with 30 participants348Key insight: Readability improvements benefit all users, not just those with visual impairments349Impact: Comprehension 65% to 85%, time-on-page +35%, scroll depth +50%350351### Case Study 3: Spacing System Reduces Development Time352An e-commerce team had 47 distinct spacing values across their CSS. Implementing an 8px-grid spacing system with 12 values eliminated all arbitrary spacing decisions. Developer productivity for layout tasks improved by 30%, and the visual consistency score (measured by design audit) increased from 62% to 94% in 3 months.353354Method: Audit all spacing → define 12-value 8px grid → codify in design tokens355Key insight: Constraining choices improves both consistency and velocity356Impact: Dev velocity +30%, visual consistency 62% to 94%357358## Rules359- Minimum text size: 14px body, 12px caption (accessibility)360- Minimum contrast: 4.5:1 text, 3:1 large text, 3:1 UI elements (WCAG AA)361- Limit typeface families to 2 per interface362- Line length: 60-75 characters max for body text363- Spacing follows an 8px grid (4px for micro adjustments)364- Color conveys meaning, not decoration — semantic naming365- Never use color as the only differentiator — add text or icon366- Dark mode is not just inverted colors — redesign for dark environments367- Every component has hover, active, disabled, focus, error states368- Borders are last resort — use spacing and background to separate elements369- Consistent border radius: pick one value (4px) and use it everywhere370- Visual hierarchy should be apparent at a glance — 3 levels max depth371- Shadows map to z-depth layers (card, modal, toast) — 3 levels max372- Test all designs in grayscale to verify hierarchy works without color373- Responsive design: mobile, tablet, desktop — design from smallest first374- Loading states must match final layout structure (no layout shift)375376## Color in Depth377378### Color Psychology in UI379Color choices communicate meaning and influence user behavior:380381| Color | Associations | Best For | Risk |382|-------|-------------|----------|------|383| Blue | Trust, stability, professionalism | Finance, healthcare, enterprise | Common — hard to differentiate |384| Green | Growth, health, success, wealth | Finance, environment, health | Cultural variance (some cultures: luck vs danger) |385| Red | Urgency, passion, error | CTAs, alerts, sales | High arousal — can cause anxiety if overused |386| Orange/Yellow | Energy, optimism, warmth | Entertainment, food, children | Low contrast on white — accessibility risk |387| Purple | Creativity, luxury, wisdom | Beauty, spiritual, premium | Gender bias perception |388| Black/White | Sophistication, minimalism | Luxury, fashion, tech | Can feel cold or stark without warm accent |389| Pink | Playful, nurturing, sweet | Beauty, fashion, children | Gender stereotypes — use with awareness |390391### Color System Architecture392```393Global palette (100+ colors)394 ↓395Semantic tokens (30-50 colors)396 ↓397Component tokens (mapped to semantic)398```399400**Global palette structure**:401- 10 neutral grays (50-900 scale) for text, backgrounds, borders402- 5-10 accent colors (each with 50-900 scale) for primary, secondary, tertiary403- 4 semantic colors: success (green), warning (amber/yellow), error (red), info (blue/cyan)404- Extended palette for data visualization (8-12 categorical colors, sequential + diverging scales)405406### Color Contrast Calculation407WCAG contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is relative luminance of lighter color and L2 of darker color. Relative luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B (linearized sRGB values).408409```typescript410// Quick contrast checker411function getContrastRatio(hex1: string, hex2: string): number {412 const l1 = relativeLuminance(hexToRgb(hex1));413 const l2 = relativeLuminance(hexToRgb(hex2));414 return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);415}416```417418Tools: WebAIM Contrast Checker, Stark plugin, axe DevTools. Never guess contrast — always verify algorithmically.419420## Typography in Depth421422### Typeface Anatomy for UI Decision-Making423When evaluating typefaces for UI, assess:424- **x-height**: Larger x-height improves readability at small sizes (body text). Small x-height = more elegant, less readable.425- **Aperture**: Open apertures (a, c, e) improve legibility. Closed apertures can cause confusion at small sizes.426- **Stroke contrast**: Low contrast (sans-serif, humanist) for body text. High contrast (didone) for display only.427- **Counter size**: Open counters improve letter recognition, especially on low-resolution screens.428- **Numeric figures**: Tabular figures (fixed-width numbers) for tables and data. Proportional figures for running text.429430### Web Font Loading Strategy431```html432<!-- Preload critical font -->433<link rel="preload" href="/fonts/inter-var.woff2" as="font" type="font/woff2" crossorigin>434435<!-- Inline small font subset in CSS -->436<style>437@font-face {438 font-family: 'Inter';439 src: url('/fonts/inter-var.woff2') format('woff2');440 font-display: swap; /* Show fallback text immediately, swap when font loads */441 unicode-range: U+0000-00FF; /* Latin subset only */442}443</style>444```445446- `font-display: swap` prevents invisible text (FOIT) — text renders in fallback font immediately, swaps when custom font loads447- Subset fonts to Latin/ASCII for initial load, load full character set after first paint448- Use variable fonts (single .woff2 file for all weights) instead of individual weight files — reduces total font download 40-60%449- Preconnect to font CDN (Google Fonts, Typekit) to reduce DNS lookup time450451### Readability Science452| Variable | Optimal Range | Impact |453|----------|--------------|--------|454| Line length | 50-75 characters (including spaces) | Too long: eye fatigue. Too short: disjointed reading |455| Line height | 1.5-1.7 for body, 1.2-1.3 for headings | Too tight: lines blur together. Too loose: disconnected |456| Font size | 16-18px body, 14px minimum for UI labels | Below 14px: significant readability decrease |457| Paragraph spacing | 1.5x line height between paragraphs | Separates thought groups without breaking flow |458| Column width | 1-3 columns for content | More than 3: scanning becomes difficult |459| Contrast | 4.5:1 minimum (AA), 7:1 preferred (AAA) | Below 4.5:1: significant readability decrease in suboptimal conditions |460461## Layout Systems in Depth462463### Grid Calculation Formula464```465Column width = (Content width - (Columns - 1) * Gutter) / Columns466```467468Example: 12-column grid, 1200px content width, 24px gutter:469```470Column = (1200 - 11 * 24) / 12 = (1200 - 264) / 12 = 78px471```472473### Responsive Breakpoint Decision Tree474```475Content layout change at viewport width?476├── <640px (mobile) → Single column, stacked layout, hamburger menu477│ Touch targets: 44x44px minimum478│ Typography: body 16px, maintain readability at narrow widths479├── 640-1024px (tablet) → 2-column grid, visible navigation480│ Consider: portrait vs landscape orientation differences481├── 1024-1440px (desktop) → 12-column grid, sidebar + main content482│ Most common target — optimize here first483└── >1440px (wide) → Constrain max-width (1200-1440px) or use fluid layout484 Extra whitespace on sides; consider multi-column layouts485```486487Mobile-first approach: start with mobile layout, add complexity at each breakpoint.488489### Visual Weight and Balance490Visual weight is determined by:491- **Size**: Larger = heavier. Balance a large element with multiple small elements.492- **Color**: Saturated colors weigh more than muted. Dark weighs more than light.493- **Texture**: Pattern, gradient, shadow add visual weight.494- **Whitespace**: More whitespace around an element = more emphasis (isolation).495- **Position**: Elements at the top and left (LTR) have more perceived weight.496- **Shape**: Irregular shapes draw more attention than regular ones.497498Symmetrical balance: formal, stable. Asymmetrical balance: dynamic, interesting (requires more skill). Radial balance: powerful focal point.499500## Component State Architecture501502Every interactive component in visual design must define these visual states:503504### Button State Examples505```506Default: Solid blue bg #2563EB, white text, border-radius 8px507Hover: Lighter blue bg #3B82F6, cursor pointer508Active: Darker blue bg #1D4ED8, scale 0.97 (pressed)509Focus: Same as default + 2px blue outline #2563EB with 4px offset510Disabled: 40% opacity, no hover/active effects, cursor not-allowed511Loading: Spinner replaces text, button width preserved (prevents layout shift)512Success: Green bg #059669, checkmark icon513Error: Red bg #DC2626 (for destructive confirmation)514```515516### Input State Examples517```518Default: 1px solid border #D1D5DB, white bg519Focus: 2px solid blue #2563EB, subtle shadow520Hover: 1px solid border #9CA3AF521Error: 2px solid red #DC2626, error icon + message below522Disabled: Gray bg #F3F4F6, 40% opacity text, no interactions523Filled: 1px solid border, text content present524Active: Cursor blinking, component focused525Read-only: Gray bg, no editing possible, cursor default526```527528## Production Considerations529530### Design Token Governance531All visual design properties should be codified as design tokens:532- **Color tokens**: Namespaced by function, not appearance: `color-primary` not `color-blue`533- **Typography tokens**: `font-size-heading-1`, `font-weight-regular`, `line-height-body`534- **Spacing tokens**: `spacing-4` (4px), `spacing-8` (8px), `spacing-16` (16px)535- **Shadow tokens**: `shadow-sm`, `shadow-md`, `shadow-lg` (each with x/y/blur/spread/color)536- **Radius tokens**: `radius-sm` (4px), `radius-md` (8px), `radius-lg` (16px), `radius-full` (9999px)537- **Opacity tokens**: `opacity-disabled` (0.4), `opacity-overlay` (0.6)538- **Duration tokens**: `duration-fast` (150ms), `duration-normal` (200ms), `duration-slow` (300ms)539540### Dark Mode Architecture541Dark mode requires independent color tokens, not simple inversion:542- **Surfaces**: Dark gray `#1E1E1E` instead of pure black `#000000` (reduces halation on OLED)543- **Text**: White `#E0E0E0` (not pure white `#FFFFFF`) to reduce eye strain at night544- **Elevation**: Lighter surfaces for higher elevation (cards are lighter than background)545- **Shadows**: Shadows become internal (inset) or use light-on-dark instead of dark-on-light546- **Images**: Reduce brightness by 20-30% for photos; avoid white backgrounds in illustrations547- **Accessibility**: Maintain 4.5:1 contrast ratio on ALL text — dark mode doesn't mean lower contrast548549## Anti-Patterns550551| Anti-Pattern | Symptom | Fix |552|-------------|---------|-----|553| **Decorative overload** | Drop shadows, gradients, and borders on every element | Every visual element must serve a function. Remove decoration that doesn't aid communication |554| **Inconsistent visual language** | Different icons styles (line vs fill), different corner radii, inconsistent shadows | Adopt a design system with enforced visual rules; audit regularly |555| **80% gray text** | Light gray (#CCC, #999) body text on white background | Minimum 4.5:1 contrast. Use #666 or darker for body text |556| **No visual hierarchy** | Everything is the same size and weight | Establish 3+ levels of typographic hierarchy; use color, whitespace, and size to create focal points |557| **Ignoring the fold** | Critical content below viewport without indication | Place primary action and value proposition in the first viewport; use visual cues for scroll |558| **Color-blind inaccessible palettes** | Red-green status indicators without patterns/icons | Add icons/text/patterns to all color-coded information |559| **Stretching images** | Distorted aspect ratios | Always maintain aspect ratio; use `object-fit: cover` for containers |560| **Over-alignment** | Centering everything creates weak hierarchy | Left-align (LTR) content by default; center only for specific emphasis |561| **Border abuse** | Borders around everything instead of using spacing | Use whitespace and background color to separate content groups; borders are last resort |562| **Too many focal points** | Every element competes for attention with color/size/motion | Establish one primary action per screen; secondary actions are visually de-emphasized |563564## Tools & Deliverables565566| Deliverable | Contents | Tools |567|------------|----------|-------|568| Color palette | Primary, secondary, neutral, semantic colors with hex/HSL/RGB values | Figma, Adobe Color, Coolors |569| Typography scale | Font families, sizes, weights, line heights, letter spacing | Figma, Typescale, Google Fonts |570| Spacing system | 8px grid scale with usage rules | Figma, Token Studio |571| Layout grid | Column grid, breakpoints, responsive rules | Figma (Auto Layout), CSS Grid |572| Component library | Visual specs for each component state | Figma, Sketch |573| Icon system | Icon grid, stroke weights, sizing rules | Figma, Noun Project |574| Dark mode spec | Color overrides for dark theme | Figma, Token Studio |575576## References577 - references/color-theory.md — Color Theory Reference578 - references/layout-principles.md — Layout Principles Guide579 - references/spacing-grid.md — Spacing and Grid Systems Reference580 - references/typography.md — Typography Reference581 - references/visual-design-advanced.md — Visual Design Advanced Topics582 - references/visual-design-fundamentals.md — Visual Design Fundamentals583 - references/visual-hierarchy.md — Visual Hierarchy Reference584 - references/visual-design-color-system.md — Color System Reference585 - references/visual-design-dark-mode.md — Dark Mode Design Reference586## Handoff587Hand off to `design-design-systems` for token implementation. Hand off to `design-brand-identity` for brand consistency. Hand off to `design-accessibility` for WCAG compliance audit.
Run npx skillmds@latest add j4flmao/design-visual-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when the user asks about visual design, color theory, typography, layout, visual hierarchy, spacing, proportion, or UI aesthetics. Do NOT use for: design systems (design-design-systems), UX research (design-ux-research), or prototyping (design-prototyping). It is listed under Design & Media on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
j4flmao (@j4flmao) published this skill. Their other Agent Skills are listed on their SkillMD profile.