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).
Independent GitHub snapshot · Automated classification · Original documentation governs
name: design-visual-design
description: >
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).
version: "2.0.0"
author: "j4flmao"
license: "MIT"
compatibility:
claude-code: true
cursor: true
codex: true
windsurf: true
tags: [design, visual-design, phase-3]
Visual Design
Purpose
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.