| name | frontend-design |
| description | **Philosophy:** Every pixel has purpose. Restraint is luxury. User psychology drives decisions. |
Frontend Design System
Philosophy: Every pixel has purpose. Restraint is luxury. User psychology drives decisions.
Core Principle: THINK, don't memorize. ASK, don't assume.
๐ฏ Selective Reading Rule (MANDATORY)
Read REQUIRED files always, OPTIONAL only when needed:
๐ด ux-psychology.md = ALWAYS READ. Others = only if relevant.
๐ง Runtime Scripts
Execute these for audits (don't read, just run):
| Script | Purpose | Usage |
|---|
scripts/ux_audit.py | UX Psychology & Accessibility Audit | python scripts/ux_audit.py <project_path> |
โ ๏ธ CRITICAL: ASK BEFORE ASSUMING (MANDATORY)
STOP! If the user's request is open-ended, DO NOT default to your favorites.
When User Prompt is Vague, ASK:
Color not specified? Ask:
"What color palette do you prefer? (blue/green/orange/neutral/other?)"
Style not specified? Ask:
"What style are you going for? (minimal/bold/retro/futuristic/organic?)"
Layout not specified? Ask:
"Do you have a layout preference? (single column/grid/asymmetric/full-width?)"
โ DEFAULT TENDENCIES TO AVOID (ANTI-SAFE HARBOR):
| AI Default Tendency | Why It's Bad | Think Instead |
|---|
| Bento Grids (Modern Clichรฉ) | Used in every AI design | Why does this content NEED a grid? |
| Hero Split (Left/Right) | Predictable & Boring | How about Massive Typography or Vertical Narrative? |
| Mesh/Aurora Gradients | The "new" lazy background | What's a radical color pairing? |
| Glassmorphism | AI's idea of "premium" | How about solid, high-contrast flat? |
| Deep Cyan / Fintech Blue | Safe harbor from purple ban | Why not Red, Black, or Neon Green? |
| "Orchestrate / Empower" | AI-generated copywriting | How would a human say this? |
| Dark background + neon glow | Overused, "AI look" | What does the BRAND actually need? |
| Rounded everything | Generic/Safe | Where can I use sharp, brutalist edges? |
๐ด "Every 'safe' structure you choose brings you one step closer to a generic template. TAKE RISKS."
1. Constraint Analysis (ALWAYS FIRST)
Before any design work, ANSWER THESE or ASK USER:
| Constraint | Question | Why It Matters |
|---|
| Timeline | How much time? | Determines complexity |
| Content | Ready or placeholder? | Affects layout flexibility |
| Brand | Existing guidelines? | May dictate colors/fonts |
| Tech | What stack? | Affects capabilities |
| Audience | Who exactly? | Drives all visual decisions |
Audience โ Design Approach
| Audience | Think About |
|---|
| Gen Z | Bold, fast, mobile-first, authentic |
| Millennials | Clean, minimal, value-driven |
| Gen X | Familiar, trustworthy, clear |
| Boomers | Readable, high contrast, simple |
| B2B | Professional, data-focused, trust |
| Luxury | Restrained elegance, whitespace |
2. UX Psychology Principles
Core Laws (Internalize These)
| Law | Principle | Application |
|---|
| Hick's Law | More choices = slower decisions | Limit options, use progressive disclosure |
| Fitts' Law | Bigger + closer = easier to click | Size CTAs appropriately |
| Miller's Law | ~7 items in working memory | Chunk content into groups |
| Von Restorff | Different = memorable | Make CTAs visually distinct |
| Serial Position | First/last remembered most | Key info at start/end |
Emotional Design Levels
VISCERAL (instant) โ First impression: colors, imagery, overall feel
BEHAVIORAL (use) โ Using it: speed, feedback, efficiency
REFLECTIVE (memory) โ After: "I like what this says about me"
Trust Building
- Security indicators on sensitive actions
- Social proof where relevant
- Clear contact/support access
- Consistent, professional design
- Transparent policies
3. Layout Principles
Golden Ratio (ฯ = 1.618)
Use for proportional harmony:
โโโ Content : Sidebar = roughly 62% : 38%
โโโ Each heading size = previous ร 1.618 (for dramatic scale)
โโโ Spacing can follow: sm โ md โ lg (each ร 1.618)
8-Point Grid Concept
All spacing and sizing in multiples of 8:
โโโ Tight: 4px (half-step for micro)
โโโ Small: 8px
โโโ Medium: 16px
โโโ Large: 24px, 32px
โโโ XL: 48px, 64px, 80px
โโโ Adjust based on content density
Key Sizing Principles
| Element | Consideration |
|---|
| Touch targets | Minimum comfortable tap size |
| Buttons | Height based on importance hierarchy |
| Inputs | Match button height for alignment |
| Cards | Consistent padding, breathable |
| Reading width | 45-75 characters optimal |
4. Color Principles
60-30-10 Rule
60% โ Primary/Background (calm, neutral base)
30% โ Secondary (supporting areas)
10% โ Accent (CTAs, highlights, attention)
Color Psychology (For Decision Making)
| If You Need... | Consider Hues | Avoid |
|---|
| Trust, calm | Blue family | Aggressive reds |
| Growth, nature | Green family | Industrial grays |
| Energy, urgency | Orange, red | Passive blues |
| Luxury, creativity | Deep Teal, Gold, Emerald | Cheap-feeling brights |
| Clean, minimal | Neutrals | Overwhelming color |
Selection Process
- What's the industry? (narrows options)
- What's the emotion? (picks primary)
- Light or dark mode? (sets foundation)
- ASK USER if not specified
For detailed color theory: color-system.md
5. Typography Principles
Scale Selection
| Content Type | Scale Ratio | Feel |
|---|
| Dense UI | 1.125-1.2 | Compact, efficient |
| General web | 1.25 | Balanced (most common) |
| Editorial | 1.333 | Readable, spacious |
| Hero/display | 1.5-1.618 | Dramatic impact |
Pairing Concept
Contrast + Harmony:
โโโ DIFFERENT enough for hierarchy
โโโ SIMILAR enough for cohesion
โโโ Usually: display + neutral, or serif + sans
Readability Rules
- Line length: 45-75 characters optimal
- Line height: 1.4-1.6 for body text
- Contrast: Check WCAG requirements
- Size: 16px+ for body on web
For detailed typography: typography-system.md
6. Visual Effects Principles
Glassmorphism (When Appropriate)
Key properties:
โโโ Semi-transparent background
โโโ Backdrop blur
โโโ Subtle border for definition
โโโ โ ๏ธ **WARNING:** Standard blue/white glassmorphism is a modern clichรฉ. Use it radically or not at all.
Shadow Hierarchy
Elevation concept:
โโโ Higher elements = larger shadows
โโโ Y-offset > X-offset (light from above)
โโโ Multiple layers = more realistic
โโโ Dark mode: may need glow instead
Gradient Usage
Harmonious gradients:
โโโ Adjacent colors on wheel (analogous)
โโโ OR same hue, different lightness
โโโ Avoid harsh complementary pairs
โโโ ๐ซ **NO Mesh/Aurora Gradients** (floating blobs)
โโโ VARY from project to project radically
For complete effects guide: visual-effects.md
7. Animation Principles
Timing Concept
Duration based on:
โโโ Distance (further = longer)
โโโ Size (larger = slower)
โโโ Importance (critical = clear)
โโโ Context (urgent = fast, luxury = slow)
Easing Selection
| Action | Easing | Why |
|---|
| Entering | Ease-out | Decelerate, settle in |
| Leaving | Ease-in | Accelerate, exit |
| Emphasis | Ease-in-out | Smooth, deliberate |
| Playful | Bounce | Fun, energetic |
Performance
- Animate only transform and opacity
- Respect reduced-motion preference
- Test on low-end devices
For animation patterns: animation-guide.md, for advanced: motion-graphics.md
8. "Wow Factor" Checklist
Premium Indicators
Trust Builders
Emotional Triggers
9. Anti-Patterns (What NOT to Do)
โ Lazy Design Indicators
- Default system fonts without consideration
- Stock imagery that doesn't match
- Inconsistent spacing
- Too many competing colors
- Walls of text without hierarchy
- Inaccessible contrast
โ AI Tendency Patterns (AVOID!)
- Same colors every project
- Dark + neon as default
- Purple/violet everything (PURPLE BAN โ
)
- Bento grids for simple landing pages
- Mesh Gradients & Glow Effects
- Same layout structure / Vercel clone
- Not asking user preferences
โ Dark Patterns (Unethical)
- Hidden costs
- Fake urgency
- Forced actions
- Deceptive UI
- Confirmshaming
10. Decision Process Summary
For EVERY design task:
1. CONSTRAINTS
โโโ What's the timeline, brand, tech, audience?
โโโ If unclear โ ASK
2. CONTENT
โโโ What content exists?
โโโ What's the hierarchy?
3. STYLE DIRECTION
โโโ What's appropriate for context?
โโโ If unclear โ ASK (don't default!)
4. EXECUTION
โโโ Apply principles above
โโโ Check against anti-patterns
5. REVIEW
โโโ "Does this serve the user?"
โโโ "Is this different from my defaults?"
โโโ "Would I be proud of this?"
Reference Files
For deeper guidance on specific areas:
Related Skills
| Skill | When to Use |
|---|
| frontend-design (this) | Before coding - Learn design principles (color, typography, UX psychology) |
| web-design-guidelines | After coding - Audit for accessibility, performance, and best practices |
Post-Design Workflow
After implementing your design, run the audit:
1. DESIGN โ Read frontend-design principles โ YOU ARE HERE
2. CODE โ Implement the design
3. AUDIT โ Run web-design-guidelines review
4. FIX โ Address findings from audit
Next Step: After coding, use web-design-guidelines skill to audit your implementation for accessibility, focus states, animations, and performance issues.
Remember: Design is THINKING, not copying. Every project deserves fresh consideration based on its unique context and users. Avoid the Modern SaaS Safe Harbor!
5. Next.js 16+ Modern Form Patterns
[!IMPORTANT]
For Next.js 16+ projects, use the native next/form component instead of standard HTML <form> for all GET-based search/filter operations.
The <Form> Component Advantage
- Automatic Client Navigation: Performs client-side transitions on submit.
- Progressive Enhancement: Works even without JavaScript.
- URL Sync: Automatically encodes input values into search params.
Implementation Example (Search Bar)
import Form from 'next/form'
export default function SearchBar() {
return (
<Form action="/search" className="flex gap-2">
<input
name="q"
placeholder="Search products..."
className="border p-2"
/>
<button type="submit">Search</button>
</Form>
)
}
When to use <Form> vs. standard <form>:
- Use
next/form for: Search, Filtering, Sorting, Pagination (GET requests).
- Use standard
<form> for: Mutations, Login, Data Entry (POST requests via Server Actions).
Animation Guidelines Reference
Animation principles and timing psychology - learn to decide, not copy.
No fixed durations to memorize - understand what affects timing.
1. Duration Principles
What Affects Timing
Factors that determine animation speed:
โโโ DISTANCE: Further travel = longer duration
โโโ SIZE: Larger elements = slower animations
โโโ COMPLEXITY: Complex = slower to process
โโโ IMPORTANCE: Critical actions = clear feedback
โโโ CONTEXT: Urgent = fast, luxurious = slow
Duration Ranges by Purpose
| Purpose | Range | Why |
|---|
| Instant feedback | 50-100ms | Below perception threshold |
| Micro-interactions | 100-200ms | Quick but noticeable |
| Standard transitions | 200-300ms | Comfortable pace |
| Complex animations | 300-500ms | Time to follow |
| Page transitions | 400-600ms | Smooth handoff |
| Wow/Premium Effects | 800ms+ | Dramatic, organic spring-based, layered |
Choosing Duration
Ask yourself:
- How far is the element moving?
- How important is it to notice this change?
- Is the user waiting, or is this background?
2. Easing Principles
What Easing Does
Easing = how speed changes over time
โโโ Linear: constant speed (mechanical, robotic)
โโโ Ease-out: fast start, slow end (natural entry)
โโโ Ease-in: slow start, fast end (natural exit)
โโโ Ease-in-out: slow both ends (smooth, deliberate)
When to Use Each
| Easing | Best For | Feels Like |
|---|
| Ease-out | Elements entering | Arriving, settling |
| Ease-in | Elements leaving | Departing, exiting |
| Ease-in-out | Emphasis, loops | Deliberate, smooth |
| Linear | Continuous motion | Mechanical, constant |
| Bounce/Elastic | Playful UI | Fun, energetic |
The Pattern
.enter {
animation-timing-function: ease-out;
}
.exit {
animation-timing-function: ease-in;
}
.continuous {
animation-timing-function: ease-in-out;
}
3. Micro-Interaction Principles
What Makes Good Micro-Interactions
Purpose of micro-interactions:
โโโ FEEDBACK: Confirm the action happened
โโโ GUIDANCE: Show what's possible
โโโ STATUS: Indicate current state
โโโ DELIGHT: Small moments of joy
Button States
Hover โ slight visual change (lift, color, scale)
Active โ pressed feeling (scale down, shadow change)
Focus โ clear indicator (outline, ring)
Loading โ progress indicator (spinner, skeleton)
Success โ confirmation (check, color)
Principles
- Respond immediately (under 100ms perception)
- Match the action (press =
scale(0.95), hover = translateY(-4px) + glow)
- Be bold but smooth (Usta iลi hissettir)
- Be consistent (same actions = same feedback)
4. Loading States Principles
Types by Context
| Situation | Approach |
|---|
| Quick load (<1s) | No indicator needed |
| Medium (1-3s) | Spinner or simple animation |
| Long (3s+) | Progress bar or skeleton |
| Unknown duration | Indeterminate indicator |
Skeleton Screens
Purpose: Reduce perceived wait time
โโโ Show layout shape immediately
โโโ Animate subtly (shimmer, pulse)
โโโ Replace with content when ready
โโโ Feels faster than spinner
Progress Indicators
When to show progress:
โโโ User-initiated action
โโโ File uploads/downloads
โโโ Multi-step processes
โโโ Long operations
When NOT needed:
โโโ Very quick operations
โโโ Background tasks
โโโ Initial page loads (skeleton better)
5. Page Transitions Principles
Transition Strategy
Simple rule: exit fast, enter slower
โโโ Outgoing content fades quickly
โโโ Incoming content animates in
โโโ Avoids "everything moving at once"
Common Patterns
| Pattern | When to Use |
|---|
| Fade | Safe default, works everywhere |
| Slide | Sequential navigation (prev/next) |
| Scale | Opening/closing modals |
| Shared element | Maintaining visual continuity |
Direction Matching
Navigation direction = animation direction
โโโ Forward โ slide from right
โโโ Backward โ slide from left
โโโ Deeper โ scale up from center
โโโ Back up โ scale down
6. Scroll Animation Principles
Progressive Reveal
Content appears as user scrolls:
โโโ Reduces initial cognitive load
โโโ Rewards exploration
โโโ Must not feel sluggish
โโโ Option to disable (accessibility)
Trigger Points
| When to Trigger | Effect |
|---|
| Just entering viewport | Standard reveal |
| Centered in viewport | For emphasis |
| Partially visible | Earlier reveal |
| Fully visible | Late trigger |
Animation Properties
- Fade in (opacity)
- Slide up (transform)
- Scale (transform)
- Combination of above
Performance
- Use Intersection Observer
- Animate only transform/opacity
- Reduce on mobile if needed
7. Hover Effects Principles
Matching Effect to Action
| Element | Effect | Intent |
|---|
| Clickable card | Lift + shadow | "This is interactive" |
| Button | Color/brightness change | "Press me" |
| Image | Zoom/scale | "View closer" |
| Link | Underline/color | "Navigate here" |
Principles
- Signal interactivity - hover shows it's clickable
- Don't overdo it - subtle changes work
- Match importance - bigger change = more important
- Touch alternatives - hover doesn't work on mobile
8. Feedback Animation Principles
Success States
Celebrate appropriately:
โโโ Minor action โ subtle check/color
โโโ Major action โ more pronounced animation
โโโ Completion โ satisfying animation
โโโ Match brand personality
Error States
Draw attention without panic:
โโโ Color change (semantic red)
โโโ Shake animation (brief!)
โโโ Focus on error field
โโโ Clear messaging
Timing
- Success: slightly longer (enjoy the moment)
- Error: quick (don't delay action)
- Loading: continuous until complete
9. Performance Principles
What's Cheap to Animate
GPU-accelerated (FAST):
โโโ transform: translate, scale, rotate
โโโ opacity: 0 to 1
CPU-intensive (SLOW):
โโโ width, height
โโโ top, left, right, bottom
โโโ margin, padding
โโโ border-radius changes
โโโ box-shadow changes
Optimization Strategies
- Animate transform/opacity whenever possible
- Avoid layout triggers (size/position changes)
- Use will-change sparingly (hints to browser)
- Test on low-end devices (not just dev machine)
Respecting User Preferences
@media (prefers-reduced-motion: reduce) {
}
10. Animation Decision Checklist
Before adding animation:
Anti-Patterns
- โ Same timing values every project
- โ Animation for animation's sake
- โ Ignoring reduced-motion preference
- โ Animating expensive properties
- โ Too many things animating at once
- โ Delays that frustrate users
Remember: Animation is communication. Every motion should have meaning and serve the user experience.
Color System Reference
Color theory principles, selection process, and decision-making guidelines.
No memorized hex codes - learn to THINK about color.
1. Color Theory Fundamentals
The Color Wheel
YELLOW
โ
Yellow- โ Yellow-
Green โ Orange
โฒ โ โฑ
โฒ โ โฑ
GREEN โโโโโโโโโโโ โ โโโโโโโโโโโ ORANGE
โฑ โ โฒ
โฑ โ โฒ
Blue- โ Red-
Green โ Orange
โ
RED
โ
PURPLE
โฑ โฒ
Blue- Red-
Purple Purple
โฒ โฑ
BLUE
Color Relationships
| Scheme | How to Create | When to Use |
|---|
| Monochromatic | Pick ONE hue, vary only lightness/saturation | Minimal, professional, cohesive |
| Analogous | Pick 2-3 ADJACENT hues on wheel | Harmonious, calm, nature-inspired |
| Complementary | Pick OPPOSITE hues on wheel | High contrast, vibrant, attention |
| Split-Complementary | Base + 2 colors adjacent to complement | Dynamic but balanced |
| Triadic | 3 hues EQUIDISTANT on wheel | Vibrant, playful, creative |
How to Choose a Scheme:
- What's the project mood? Calm โ Analogous. Bold โ Complementary.
- How many colors needed? Minimal โ Monochromatic. Complex โ Triadic.
- Who's the audience? Conservative โ Monochromatic. Young โ Triadic.
2. The 60-30-10 Rule
Distribution Principle
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ 60% PRIMARY (Background, large areas) โ
โ โ Should be neutral or calming โ
โ โ Carries the overall tone โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโค
โ โ โ
โ 30% SECONDARY โ 10% ACCENT โ
โ (Cards, sections, headers) โ (CTAs, โ
โ โ Supports without dominating โ highlights)โ
โ โ โ Draws โ
โ โ attentionโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
Implementation Pattern
:root {
--color-bg:
--color-surface:
--color-secondary:
--color-accent:
}
3. Color Psychology - Meaning & Selection
How to Choose Based on Context
| If Project Is... | Consider These Hues | Why |
|---|
| Finance, Tech, Healthcare | Blues, Teals | Trust, stability, calm |
| Eco, Wellness, Nature | Greens, Earth tones | Growth, health, organic |
| Food, Energy, Youth | Orange, Yellow, Warm | Appetite, excitement, warmth |
| Luxury, Beauty, Creative | Deep Teal, Gold, Black | Sophistication, premium |
| Urgency, Sales, Alerts | Red, Orange | Action, attention, passion |
Emotional Associations (For Decision Making)
| Hue Family | Positive Associations | Cautions |
|---|
| Blue | Trust, calm, professional | Can feel cold, corporate |
| Green | Growth, nature, success | Can feel boring if overused |
| Red | Passion, urgency, energy | High arousal, use sparingly |
| Orange | Warmth, friendly, creative | Can feel cheap if saturated |
| Purple | โ ๏ธ BANNED - AI overuses this! | Use Deep Teal/Maroon/Emerald instead |
| Yellow | Optimism, attention, happy | Hard to read, use as accent |
| Black | Elegance, power, modern | Can feel heavy |
| White | Clean, minimal, open | Can feel sterile |
Selection Process:
- What industry? โ Narrow to 2-3 hue families
- What emotion? โ Pick primary hue
- What contrast? โ Decide light vs dark mode
- ASK USER โ Confirm before proceeding
4. Palette Generation Principles
From a Single Color (HSL Method)
Instead of memorizing hex codes, learn to manipulate HSL:
HSL = Hue, Saturation, Lightness
Hue (0-360): The color family
0/360 = Red
60 = Yellow
120 = Green
180 = Cyan
240 = Blue
300 = Purple
Saturation (0-100%): Color intensity
Low = Muted, sophisticated
High = Vibrant, energetic
Lightness (0-100%): Brightness
0% = Black
50% = Pure color
100% = White
Generating a Full Palette
Given ANY base color, create a scale:
Lightness Scale:
50 (lightest) โ L: 97%
100 โ L: 94%
200 โ L: 86%
300 โ L: 74%
400 โ L: 66%
500 (base) โ L: 50-60%
600 โ L: 48%
700 โ L: 38%
800 โ L: 30%
900 (darkest) โ L: 20%
Saturation Adjustments
| Context | Saturation Level |
|---|
| Professional/Corporate | Lower (40-60%) |
| Playful/Youth | Higher (70-90%) |
| Dark Mode | Reduce by 10-20% |
| Accessibility | Ensure contrast, may need adjustment |
5. Context-Based Selection Guide
Instead of Copying Palettes, Follow This Process:
Step 1: Identify the Context
What type of project?
โโโ E-commerce โ Need trust + urgency balance
โโโ SaaS/Dashboard โ Need low-fatigue, data focus
โโโ Health/Wellness โ Need calming, natural feel
โโโ Luxury/Premium โ Need understated elegance
โโโ Creative/Portfolio โ Need personality, memorable
โโโ Other โ ASK the user
Step 2: Select Primary Hue Family
Based on context, pick ONE:
- Blue family (trust)
- Green family (growth)
- Warm family (energy)
- Neutral family (elegant)
- OR ask user preference
Step 3: Decide Light/Dark Mode
Consider:
- User preference?
- Industry standard?
- Content type? (text-heavy = light preferred)
- Time of use? (evening app = dark option)
Step 4: Generate Palette Using Principles
- Use HSL manipulation
- Follow 60-30-10 rule
- Check contrast (WCAG)
- Test with actual content
6. Dark Mode Principles
Key Rules (No Fixed Codes)
- Never pure black โ Use very dark gray with slight hue
- Never pure white text โ Use 87-92% lightness
- Reduce saturation โ Vibrant colors strain eyes in dark mode
- Elevation = brightness โ Higher elements slightly lighter
Contrast in Dark Mode
Background layers (darker โ lighter as elevation increases):
Layer 0 (base) โ Darkest
Layer 1 (cards) โ Slightly lighter
Layer 2 (modals) โ Even lighter
Layer 3 (popups) โ Lightest dark
Adapting Colors for Dark Mode
| Light Mode | Dark Mode Adjustment |
|---|
| High saturation accent | Reduce saturation 10-20% |
| Pure white background | Dark gray with brand hue tint |
| Black text | Light gray (not pure white) |
| Colorful backgrounds | Desaturated, darker versions |
7. Accessibility Guidelines
Contrast Requirements (WCAG)
| Level | Normal Text | Large Text |
|---|
| AA (minimum) | 4.5:1 | 3:1 |
| AAA (enhanced) | 7:1 | 4.5:1 |
How to Check Contrast
- Convert colors to luminance
- Calculate ratio: (lighter + 0.05) / (darker + 0.05)
- Adjust until ratio meets requirement
Safe Patterns
| Use Case | Guideline |
|---|
| Text on light bg | Use lightness 35% or less |
| Text on dark bg | Use lightness 85% or more |
| Primary on white | Ensure dark enough variant |
| Buttons | High contrast between bg and text |
8. Color Selection Checklist
Before finalizing any color choice, verify:
9. Anti-Patterns to Avoid
โ DON'T:
- Copy the same hex codes every project
- Default to purple/violet (AI tendency)
- Default to dark mode + neon (AI tendency)
- Use pure black (#000000) backgrounds
- Use pure white (#FFFFFF) text on dark
- Ignore user's industry context
- Skip asking user preference
โ
DO:
- Generate fresh palette per project
- Ask user about color preferences
- Consider industry and audience
- Use HSL for flexible manipulation
- Test contrast and accessibility
- Offer light AND dark options
Remember: Colors are decisions, not defaults. Every project deserves thoughtful selection based on its unique context.
Decision Trees & Context Templates
Context-based design THINKING, not fixed solutions.
These are decision GUIDES, not copy-paste templates.
For UX psychology principles (Hick's, Fitts', etc.) see: ux-psychology.md
โ ๏ธ How to Use This File
This file helps you DECIDE, not copy.
- Decision trees โ Help you THINK through options
- Templates โ Show STRUCTURE and PRINCIPLES, not exact values
- Always ask user preferences before applying
- Generate fresh palettes based on context, don't copy hex codes
- Apply UX laws from ux-psychology.md to validate decisions
1. Master Decision Tree
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WHAT ARE YOU BUILDING? โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
E-COMMERCE SaaS/APP CONTENT
- Product pages - Dashboard - Blog
- Checkout - Tools - Portfolio
- Catalog - Admin - Landing
โ โ โ
โผ โผ โผ
PRINCIPLES: PRINCIPLES: PRINCIPLES:
- Trust - Functionality - Storytelling
- Action - Clarity - Emotion
- Urgency - Efficiency - Creativity
2. Audience Decision Tree
Who is your target user?
TARGET AUDIENCE
โ
โโโ Gen Z (18-25)
โ โโโ Colors: Bold, vibrant, unexpected combinations
โ โโโ Type: Large, expressive, variable
โ โโโ Layout: Mobile-first, vertical, snackable
โ โโโ Effects: Motion, gamification, interactive
โ โโโ Approach: Authentic, fast, no corporate feel
โ
โโโ Millennials (26-41)
โ โโโ Colors: Muted, earthy, sophisticated
โ โโโ Type: Clean, readable, functional
โ โโโ Layout: Responsive, card-based, organized
โ โโโ Effects: Subtle, purposeful only
โ โโโ Approach: Value-driven, transparent, sustainable
โ
โโโ Gen X (42-57)
โ โโโ Colors: Professional, trusted, conservative
โ โโโ Type: Familiar, clear, no-nonsense
โ โโโ Layout: Traditional hierarchy, predictable
โ โโโ Effects: Minimal, functional feedback
โ โโโ Approach: Direct, efficient, reliable
โ
โโโ Boomers (58+)
โ โโโ Colors: High contrast, simple, clear
โ โโโ Type: Large sizes, high readability
โ โโโ Layout: Simple, linear, uncluttered
โ โโโ Effects: None or very minimal
โ โโโ Approach: Clear, detailed, trustworthy
โ
โโโ B2B / Enterprise
โโโ Colors: Professional palette, muted
โโโ Type: Clean, data-friendly, scannable
โโโ Layout: Grid-based, organized, efficient
โโโ Effects: Professional, subtle
โโโ Approach: Expert, solution-focused, ROI-driven
3. Color Selection Decision Tree
Instead of fixed hex codes, use this process:
WHAT EMOTION/ACTION DO YOU WANT?
โ
โโโ Trust & Security
โ โโโ Consider: Blue family, professional neutrals
โ โ ASK user for specific shade preference
โ
โโโ Growth & Health
โ โโโ Consider: Green family, natural tones
โ โ ASK user if eco/nature/wellness focus
โ
โโโ Urgency & Action
โ โโโ Consider: Warm colors (orange/red) as ACCENTS
โ โ Use sparingly, ASK if appropriate
โ
โโโ Luxury & Premium
โ โโโ Consider: Deep darks, metallics, restrained palette
โ โ ASK about brand positioning
โ
โโโ Creative & Playful
โ โโโ Consider: Multi-color, unexpected combinations
โ โ ASK about brand personality
โ
โโโ Calm & Minimal
โโโ Consider: Neutrals with single accent
โ ASK what accent color fits brand
The Process:
- Identify the emotion needed
- Narrow to color FAMILY
- ASK user for preference within family
- Generate fresh palette using HSL principles
4. Typography Decision Tree
WHAT'S THE CONTENT TYPE?
โ
โโโ Data-Heavy (Dashboard, SaaS)
โ โโโ Style: Sans-serif, clear, compact
โ โโโ Scale: Tighter ratio (1.125-1.2)
โ โโโ Priority: Scannability, density
โ
โโโ Editorial (Blog, Magazine)
โ โโโ Style: Serif heading + Sans body works well
โ โโโ Scale: More dramatic (1.333+)
โ โโโ Priority: Reading comfort, hierarchy
โ
โโโ Modern Tech (Startup, SaaS Marketing)
โ โโโ Style: Geometric or humanist sans
โ โโโ Scale: Balanced (1.25)
โ โโโ Priority: Modern feel, clarity
โ
โโโ Luxury (Fashion, Premium)
โ โโโ Style: Elegant serif or thin sans
โ โโโ Scale: Dramatic (1.5-1.618)
โ โโโ Priority: Sophistication, whitespace
โ
โโโ Playful (Kids, Games, Casual)
โโโ Style: Rounded, friendly fonts
โโโ Scale: Varied, expressive
โโโ Priority: Fun, approachable, readable
Selection Process:
- Identify content type
- Choose style DIRECTION
- ASK user if they have brand fonts
- Select fonts that match direction
5. E-commerce Guidelines {#e-commerce}
Key Principles (Not Fixed Rules)
- Trust first: How will you show security?
- Action-oriented: Where are the CTAs?
- Scannable: Can users compare quickly?
Color Thinking:
E-commerce typically needs:
โโโ Trust color (often blue family) โ ASK preference
โโโ Clean background (white/neutral) โ depends on brand
โโโ Action accent (for CTAs, sales) โ depends on urgency level
โโโ Success/error semantics โ standard conventions work
โโโ Brand integration โ ASK about existing colors
Layout Principles:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HEADER: Brand + Search + Cart โ
โ (Keep essential actions visible) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ TRUST ZONE: Why trust this site? โ
โ (Shipping, returns, security - if applicable) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HERO: Primary message or offer โ
โ (Clear CTA, single focus) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CATEGORIES: Easy navigation โ
โ (Visual, filterable, scannable) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PRODUCTS: Easy comparison โ
โ (Price, rating, quick actions visible) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SOCIAL PROOF: Why others trust โ
โ (Reviews, testimonials - if available) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FOOTER: All the details โ
โ (Policies, contact, trust badges) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Psychology to Apply:
- Hick's Law: Limit navigation choices
- Fitts' Law: Size CTAs appropriately
- Social proof: Show where relevant
- Scarcity: Use honestly if at all
6. SaaS Dashboard Guidelines {#saas}
Key Principles
- Functional first: Data clarity over decoration
- Calm UI: Reduce cognitive load
- Consistent: Predictable patterns
Color Thinking:
Dashboard typically needs:
โโโ Background: Light OR dark (ASK preference)
โโโ Surface: Slight contrast from background
โโโ Primary accent: For key actions
โโโ Data colors: Success/warning/danger semantics
โโโ Muted: For secondary information
Layout Principles:
Consider these patterns (not mandated):
OPTION A: Sidebar + Content
โโโ Fixed sidebar for navigation
โโโ Main area for content
OPTION B: Top nav + Content
โโโ Horizontal navigation
โโโ More horizontal content space
OPTION C: Collapsed + Expandable
โโโ Icon-only sidebar expands
โโโ Maximum content area
โ ASK user about their navigation preference
Psychology to Apply:
- Hick's Law: Group navigation items
- Miller's Law: Chunk information
- Cognitive Load: Whitespace, consistency
7. Landing Page Guidelines {#landing-page}
Key Principles
- Hero-centric: First impression matters most
- Single focus: One primary CTA
- Emotional: Connect before selling
Color Thinking:
Landing page typically needs:
โโโ Brand primary: Hero background or accent
โโโ Clean secondary: Most of page
โโโ CTA color: Stands out from everything
โโโ Supporting: For sections, testimonials
โโโ ASK about brand colors first!
Structure Principles:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Navigation: Minimal, CTA visible โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HERO: Hook + Value + CTA โ
โ (Most important section, biggest impact) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PROBLEM: What pain do they have? โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SOLUTION: How you solve it โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PROOF: Why believe you? โ
โ (Testimonials, logos, stats) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HOW: Simple explanation of process โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PRICING: If applicable โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FAQ: Address objections โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FINAL CTA: Repeat main action โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Psychology to Apply:
- Visceral: Beautiful hero impression
- Serial Position: Key info top/bottom
- Social Proof: Testimonials work
8. Portfolio Guidelines {#portfolio}
Key Principles
- Personality: Show who you are
- Work-focused: Let projects speak
- Memorable: Stand out from templates
Color Thinking:
Portfolio is personal - many options:
โโโ Minimal: Neutrals + one signature accent
โโโ Bold: Unexpected color choices
โโโ Dark: Moody, artistic feel
โโโ Light: Clean, professional feel
โโโ ASK about personal brand identity!
Structure Principles:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Navigation: Unique to your personality โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ INTRO: Who you are, what you do โ
โ (Make it memorable, not generic) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ WORK: Featured projects โ
โ (Large, visual, interactive) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ABOUT: Personal story โ
โ (Creates connection) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CONTACT: Easy to reach โ
โ (Clear, direct) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Psychology to Apply:
- Von Restorff: Be uniquely memorable
- Reflective: Personal story creates connection
- Emotional: Personality over professionalism
9. Pre-Design Checklists
Before Starting ANY Design
Before Choosing Colors
Before Finalizing Layout
Before Delivery
10. Complexity Estimation
Quick Projects (Hours)
Simple landing page
Small portfolio
Basic form
Single component
โ Approach: Minimal decisions, focused execution
Medium Projects (Days)
Multi-page site
Dashboard with modules
E-commerce category
Complex forms
โ Approach: Establish tokens, custom components
Large Projects (Weeks)
Full SaaS application
E-commerce platform
Custom design system
Complex workflows
โ Approach: Full design system, documentation, testing
Remember: These templates show STRUCTURE and THINKING process. Every project needs fresh color, typography, and styling decisions based on its unique context. ASK when unclear.
Motion Graphics Reference
Advanced animation techniques for premium web experiences - Lottie, GSAP, SVG, 3D, Particles.
Learn the principles, create WOW effects.
1. Lottie Animations
What is Lottie?
JSON-based vector animations:
โโโ Exported from After Effects via Bodymovin
โโโ Lightweight (smaller than GIF/video)
โโโ Scalable (vector-based, no pixelation)
โโโ Interactive (control playback, segments)
โโโ Cross-platform (web, iOS, Android, React Native)
When to Use Lottie
| Use Case | Why Lottie? |
|---|
| Loading animations | Branded, smooth, lightweight |
| Empty states | Engaging illustrations |
| Onboarding flows | Complex multi-step animations |
| Success/Error feedback | Delightful micro-interactions |
| Animated icons | Consistent cross-platform |
Principles
- Keep file size under 100KB for performance
- Use loop sparingly (avoid distraction)
- Provide static fallback for reduced-motion
- Lazy load animation files when possible
Sources
- LottieFiles.com (free library)
- After Effects + Bodymovin (custom)
- Figma plugins (export from design)
2. GSAP (GreenSock)
What Makes GSAP Different
Professional timeline-based animation:
โโโ Precise control over sequences
โโโ ScrollTrigger for scroll-driven animations
โโโ MorphSVG for shape transitions
โโโ Physics-based easing
โโโ Works with any DOM element
Core Concepts
| Concept | Purpose |
|---|
| Tween | Single AโB animation |
| Timeline | Sequenced/overlapping animations |
| ScrollTrigger | Scroll position controls playback |
| Stagger | Cascade effect across elements |
When to Use GSAP
- โ
Complex sequenced animations
- โ
Scroll-triggered reveals
- โ
Precise timing control needed
- โ
SVG morphing effects
- โ Simple hover/focus effects (use CSS)
- โ Performance-critical mobile (heavier)
Principles
- Use timeline for orchestration (not individual tweens)
- Stagger delay: 0.05-0.15s between items
- ScrollTrigger: start at 70-80% viewport entry
- Kill animations on unmount (prevent memory leaks)
3. SVG Animations
Types of SVG Animation
| Type | Technique | Use Case |
|---|
| Line Drawing | stroke-dashoffset | Logo reveals, signatures |
| Morph | Path interpolation | Icon transitions |
| Transform | rotate, scale, translate | Interactive icons |
| Color | fill/stroke transition | State changes |
Line Drawing Principles
How stroke-dashoffset drawing works:
โโโ Set dasharray to path length
โโโ Set dashoffset equal to dasharray (hidden)
โโโ Animate dashoffset to 0 (revealed)
โโโ Create "drawing" effect
When to Use SVG Animations
- โ
Logo reveals, brand moments
- โ
Icon state transitions (hamburger โ X)
- โ
Infographics, data visualization
- โ
Interactive illustrations
- โ Photo-realistic content (use video)
- โ Very complex scenes (performance)
Principles
- Get path length dynamically for accuracy
- Duration: 1-3s for full drawings
- Easing: ease-out for natural feel
- Simple fills complement, don't compete
4. 3D CSS Transforms
Core Properties
CSS 3D Space:
โโโ perspective: depth of 3D field (500-1500px typical)
โโโ transform-style: preserve-3d (enable children 3D)
โโโ rotateX/Y/Z: rotation per axis
โโโ translateZ: move toward/away from viewer
โโโ backface-visibility: show/hide back side
Common 3D Patterns
| Pattern | Use Case |
|---|
| Card flip | Reveals, flashcards, product views |
| Tilt on hover | Interactive cards, 3D depth |
| Parallax layers | Hero sections, immersive scrolling |
| 3D carousel | Image galleries, sliders |
Principles
- Perspective: 800-1200px for subtle, 400-600px for dramatic
- Keep transforms simple (rotate + translate)
- Ensure backface-visibility: hidden for flips
- Test on Safari (different rendering)
5. Particle Effects
Types of Particle Systems
| Type | Feel | Use Case |
|---|
| Geometric | Tech, network | SaaS, tech sites |
| Confetti | Celebration | Success moments |
| Snow/Rain | Atmospheric | Seasonal, mood |
| Dust/Bokeh | Dreamy | Photography, luxury |
| Fireflies | Magical | Games, fantasy |
Libraries
| Library | Best For |
|---|
| tsParticles | Configurable, lightweight |
| particles.js | Simple backgrounds |
| Canvas API | Custom, maximum control |
| Three.js | Complex 3D particles |
Principles
- Default: 30-50 particles (not overwhelming)
- Movement: slow, organic (speed 0.5-2)
- Opacity: 0.3-0.6 (don't compete with content)
- Connections: subtle lines for "network" feel
- โ ๏ธ Disable or reduce on mobile
When to Use
- โ
Hero backgrounds (atmospheric)
- โ
Success celebrations (confetti burst)
- โ
Tech visualization (connected nodes)
- โ Content-heavy pages (distraction)
- โ Low-powered devices (battery drain)
6. Scroll-Driven Animations
Native CSS (Modern)
CSS Scroll Timelines:
โโโ animation-timeline: scroll() - document scroll
โโโ animation-timeline: view() - element in viewport
โโโ animation-range: entry/exit thresholds
โโโ No JavaScript required
Principles
| Trigger Point | Use Case |
|---|
| Entry 0% | When element starts entering |
| Entry 50% | When half visible |
| Cover 50% | When centered in viewport |
| Exit 100% | When fully exited |
Best Practices
- Reveal animations: start at ~25% entry
- Parallax: continuous scroll progress
- Sticky elements: use cover range
- Always test scroll performance
7. Performance Principles
GPU vs CPU Animation
CHEAP (GPU-accelerated):
โโโ transform (translate, scale, rotate)
โโโ opacity
โโโ filter (use sparingly)
EXPENSIVE (triggers reflow):
โโโ width, height
โโโ top, left, right, bottom
โโโ padding, margin
โโโ complex box-shadow
Optimization Checklist
8. Motion Graphics Decision Tree
What animation do you need?
โ
โโโ Complex branded animation?
โ โโโ Lottie (After Effects export)
โ
โโโ Sequenced scroll-triggered?
โ โโโ GSAP + ScrollTrigger
โ
โโโ Logo/icon animation?
โ โโโ SVG animation (stroke or morph)
โ
โโโ Interactive 3D effect?
โ โโโ CSS 3D Transforms (simple) or Three.js (complex)
โ
โโโ Atmospheric background?
โ โโโ tsParticles or Canvas
โ
โโโ Simple entrance/hover?
โโโ CSS @keyframes or Framer Motion
9. Anti-Patterns
| โ Don't | โ
Do |
|---|
| Animate everything at once | Stagger and sequence |
| Use heavy libraries for simple effects | Start with CSS |
| Ignore reduced-motion | Always provide fallback |
| Block main thread | Optimize for 60fps |
| Same particles every project | Match brand/context |
| Complex effects on mobile | Feature detection |
10. Quick Reference
| Effect | Tool | Performance |
|---|
| Loading spinner | CSS/Lottie | Light |
| Staggered reveal | GSAP/Framer | Medium |
| SVG path draw | CSS stroke | Light |
| 3D card flip | CSS transforms | Light |
| Particle background | tsParticles | Heavy |
| Scroll parallax | GSAP ScrollTrigger | Medium |
| Shape morphing | GSAP MorphSVG | Medium |
Remember: Motion graphics should enhance, not distract. Every animation must serve a PURPOSEโfeedback, guidance, delight, or storytelling.
Typography System Reference
Typography principles and decision-making - learn to think, not memorize.
No fixed font names or sizes - understand the system.
1. Modular Scale Principles
What is a Modular Scale?
A mathematical relationship between font sizes:
โโโ Pick a BASE size (usually body text)
โโโ Pick a RATIO (multiplier)
โโโ Generate all sizes using: base ร ratio^n
Common Ratios and When to Use
| Ratio | Value | Feeling | Best For |
|---|
| Minor Second | 1.067 | Very subtle | Dense UI, small screens |
| Major Second | 1.125 | Subtle | Compact interfaces |
| Minor Third | 1.2 | Comfortable | Mobile apps, cards |
| Major Third | 1.25 | Balanced | General web (most common) |
| Perfect Fourth | 1.333 | Noticeable | Editorial, blogs |
| Perfect Fifth | 1.5 | Dramatic | Headlines, marketing |
| Golden Ratio | 1.618 | Maximum impact | Hero sections, display |
Generate Your Scale
Given: base = YOUR_BASE_SIZE, ratio = YOUR_RATIO
Scale:
โโโ xs: base รท ratioยฒ
โโโ sm: base รท ratio
โโโ base: YOUR_BASE_SIZE
โโโ lg: base ร ratio
โโโ xl: base ร ratioยฒ
โโโ 2xl: base ร ratioยณ
โโโ 3xl: base ร ratioโด
โโโ ... continue as needed
Choosing Base Size
| Context | Base Size Range | Why |
|---|
| Mobile-first | 16-18px | Readability on small screens |
| Desktop app | 14-16px | Information density |
| Editorial | 18-21px | Long-form reading comfort |
| Accessibility focus | 18px+ | Easier to read |
2. Font Pairing Principles
What Makes Fonts Work Together
Contrast + Harmony:
โโโ Different ENOUGH to create hierarchy
โโโ Similar ENOUGH to feel cohesive
โโโ Usually: serif + sans, or display + neutral
Pairing Strategies
| Strategy | How | Result |
|---|
| Contrast | Serif heading + Sans body | Classic, editorial feel |
| Same Family | One variable font, different weights | Cohesive, modern |
| Same Designer | Fonts by same foundry | Often harmonious proportions |
| Era Match | Fonts from same time period | Historical consistency |
What to Look For
When pairing, compare:
โโโ x-height (height of lowercase letters)
โโโ Letter width (narrow vs wide)
โโโ Stroke contrast (thin/thick variation)
โโโ Overall mood (formal vs casual)
Safe Pairing Patterns
| Heading Style | Body Style | Mood |
|---|
| Geometric sans | Humanist sans | Modern, friendly |
| Display serif | Clean sans | Editorial, sophisticated |
| Neutral sans | Same sans | Minimal, tech |
| Bold geometric | Light geometric | Contemporary |
Avoid
- โ Two decorative fonts together
- โ Similar fonts that conflict
- โ More than 2-3 font families
- โ Fonts with very different x-heights
3. Line Height Principles
The Relationship
Line height depends on:
โโโ Font size (larger text = less line height needed)
โโโ Line length (longer lines = more line height)
โโโ Font design (some fonts need more space)
โโโ Content type (headings vs body)
Guidelines by Context
| Content Type | Line Height Range | Why |
|---|
| Headings | 1.1 - 1.3 | Short lines, want compact |
| Body text | 1.4 - 1.6 | Comfortable reading |
| Long-form | 1.6 - 1.8 | Maximum readability |
| UI elements | 1.2 - 1.4 | Space efficiency |
Adjustment Factors
- Longer line length โ Increase line height
- Larger font size โ Decrease line height ratio
- All caps โ May need more line height
- Tight tracking โ May need more line height
4. Line Length Principles
Optimal Reading Width
The sweet spot: 45-75 characters per line
โโโ < 45: Too choppy, breaks flow
โโโ 45-75: Comfortable reading
โโโ > 75: Eye tracking strain
How to Measure
max-width: 65ch;
Context Adjustments
| Context | Character Range |
|---|
| Desktop article | 60-75 characters |
| Mobile | 35-50 characters |
| Sidebar text | 30-45 characters |
| Wide monitors | Still cap at ~75ch |
5. Responsive Typography Principles
The Problem
Fixed sizes don't scale well:
โโโ Desktop size too big on mobile
โโโ Mobile size too small on desktop
โโโ Breakpoint jumps feel jarring
Fluid Typography (clamp)
font-size: clamp(
MINIMUM_SIZE,
FLUID_CALCULATION,
MAXIMUM_SIZE
);
Scaling Strategy
| Element | Scaling Behavior |
|---|
| Body text | Slight scaling (1rem โ 1.125rem) |
| Subheadings | Moderate scaling |
| Headings | More dramatic scaling |
| Display text | Most dramatic scaling |
6. Weight and Emphasis Principles
Semantic Weight Usage
| Weight Range | Name | Use For |
|---|
| 300-400 | Light/Normal | Body text, paragraphs |
| 500 | Medium | Subtle emphasis |
| 600 | Semibold | Subheadings, labels |
| 700 | Bold | Headings, strong emphasis |
| 800-900 | Heavy/Black | Display, hero text |
Creating Contrast
Good contrast = skip at least 2 weight levels
โโโ 400 body + 700 heading = good
โโโ 400 body + 500 emphasis = subtle
โโโ 600 heading + 700 subheading = too similar
Avoid
- โ Too many weights (max 3-4 per page)
- โ Adjacent weights for hierarchy (400/500)
- โ Heavy weights for long text
7. Letter Spacing (Tracking)
Principles
Large text (headings): tighter tracking
โโโ Letters are big, gaps feel larger
โโโ Slight negative tracking looks better
Small text (body): normal or slightly wider
โโโ Improves readability at small sizes
โโโ Never negative for body text
ALL CAPS: always wider tracking
โโโ Uppercase lacks ascenders/descenders
โโโ Needs more space to feel right
Adjustment Guidelines
| Context | Tracking Adjustment |
|---|
| Display/Hero | -2% to -4% |
| Headings | -1% to -2% |
| Body text | 0% (normal) |
| Small text | +1% to +2% |
| ALL CAPS | +5% to +10% |
8. Hierarchy Principles
Visual Hierarchy Through Type
Ways to create hierarchy:
โโโ SIZE (most obvious)
โโโ WEIGHT (bold stands out)
โโโ COLOR (contrast levels)
โโโ SPACING (margins separate sections)
โโโ POSITION (top = important)
Typical Hierarchy
| Level | Characteristics |
|---|
| Primary (H1) | Largest, boldest, most distinct |
| Secondary (H2) | Noticeably smaller but still bold |
| Tertiary (H3) | Medium size, may use weight only |
| Body | Standard size and weight |
| Caption/Meta | Smaller, often lighter color |
Testing Hierarchy
Ask: "Can I tell what's most important at a glance?"
If squinting at the page, the hierarchy should still be clear.
9. Readability Psychology
F-Pattern Reading
Users scan in F-pattern:
โโโ Across the top (first line)
โโโ Down the left side
โโโ Across again (subheading)
โโโ Continue down left
Implication: Key info on left and in headings
Chunking for Comprehension
- Short paragraphs (3-4 lines max)
- Clear subheadings
- Bullet points for lists
- White space between sections
Cognitive Ease
- Familiar fonts = easier reading
- High contrast = less strain
- Consistent patterns = predictable
10. Typography Selection Checklist
Before finalizing typography:
Anti-Patterns
- โ Same fonts every project
- โ Too many font families
- โ Ignoring readability for style
- โ Fixed sizes without responsiveness
- โ Decorative fonts for body text
Remember: Typography is about communication clarity. Choose based on content needs and audience, not personal preference.
UX Psychology Reference
Deep dive into UX laws, emotional design, trust building, and behavioral psychology.
1. Core UX Laws
Hick's Law
Principle: The time to make a decision increases logarithmically with the number of choices.
Decision Time = a + b ร logโ(n + 1)
Where n = number of choices
Application:
- Navigation: Max 5-7 top-level items
- Forms: Break into steps (progressive disclosure)
- Options: Default selections when possible
- Filters: Prioritize most-used, hide advanced
Example:
โ Bad: 15 menu items in one nav
โ
Good: 5 main categories + "More"
โ Bad: 20 form fields at once
โ
Good: 3-step wizard with 5-7 fields each
Fitts' Law
Principle: Time to reach a target = function of distance and size.
MT = a + b ร logโ(1 + D/W)
Where D = distance, W = width
Application:
- CTAs: Make primary buttons larger (min 44px height)
- Touch targets: 44ร44px minimum on mobile
- Placement: Important actions near natural cursor position
- Corners: "Magic corners" (infinite edge = easy to hit)
Button Sizing:
.btn-primary { height: 48px; padding: 0 24px; }
.btn-secondary { height: 40px; padding: 0 16px; }
.btn-tertiary { height: 36px; padding: 0 12px; }
@media (hover: none) {
.btn { min-height: 44px; min-width: 44px; }
}
Miller's Law
Principle: Average person can hold 7ยฑ2 chunks in working memory.
Application:
- Lists: Group into chunks of 5-7 items
- Navigation: Max 7 menu items
- Content: Break long content with headings
- Phone numbers: 555-123-4567 (chunked)
Chunking Example:
โ 5551234567
โ
555-123-4567
โ Long paragraph of text without breaks
โ
Short paragraphs
With bullet points
And subheadings
Von Restorff Effect (Isolation Effect)
Principle: An item that stands out is more likely to be remembered.
Application:
- CTA buttons: Distinct color from other elements
- Pricing: Highlight recommended plan
- Important info: Visual differentiation
- New features: Badge or callout
Example:
.btn { background: #E5E7EB; }
.btn-primary { background: #3B82F6; }
.pricing-card { border: 1px solid #E5E7EB; }
.pricing-card.popular {
border: 2px solid #3B82F6;
box-shadow: var(--shadow-lg);
}
Serial Position Effect
Principle: Items at the beginning (primacy) and end (recency) of a list are remembered best.
Application:
- Navigation: Most important items first and last
- Lists: Key info at top and bottom
- Forms: Most critical fields at start
- CTAs: Repeat at top and bottom of long pages
Example:
Navigation: Home | [key items] | Contact
Long landing page:
- CTA at hero (top)
- Content sections
- CTA repeated at bottom
Jakobโs Law
Principle: Users spend most of their time on other sites. They prefer your site to work the same way as all the other sites they already know.
Application:
- Patterns: Use standard placement for search bars and carts.
- Mental Models: Leverage familiar icons (e.g., a magnifying glass).
- Vocabulary: Use "Log In" instead of "Enter the Portal."
- Layout: Keep the logo in the top-left for "Home" navigation.
- Interaction: Swiping right to go back/next should feel native.
- Feedback: Standard colors (Red = Error, Green = Success).
Example:
โ Bad: A website where clicking the logo takes you to an "About Us" page.
โ
Good: Clicking the logo always returns the user to the Homepage.
โ Bad: Using a "Star" icon to represent "Delete."
โ
Good: Using a "Trash Can" icon to represent "Delete."
Teslerโs Law (Conservation of Complexity)
Principle: For any system, there is a certain amount of complexity which cannot be reduced, only shifted from user to software.
Application:
- Backend: Let the system handle formatting (e.g., currency).
- Detection: Auto-detect card type or city via ZIP code.
- Automation: Pre-fill returning user data.
- Personalization: Show only relevant fields based on previous answers.
- Defaults: Smart defaults for common settings.
- Integration: Use SSO (Social Logins) to offload registration friction.
Example:
โ Bad: Making users type "USD $" before every price field in a form.
โ
Good: The app automatically prefixing the "$" based on the user's location.
โ Bad: Forcing users to manually select their "Card Type" (Visa/Mastercard).
โ
Good: Detecting the card type automatically from the first four digits entered.
Parkinsonโs Law
Principle: Any task will inflate until all available time is spent.
Application:
- Efficiency: Use "Auto-save" to reduce task completion time.
- Speed: Limit the steps in a conversion funnel.
- Clarity: Use clear labels to prevent "hover-poking" for meaning.
- Feedback: Real-time validation to stop users from wasting time on errors.
- Onboarding: Quick "Express" setup for power users.
- Constraints: Set character limits on inputs to focus thoughts.
Example:
โ Bad: A 10-page registration form that allows users to browse away and lose data.
โ
Good: A "One-Tap Sign In" using Google or Apple ID.
โ Bad: Giving a user an indefinite amount of time to fill out a bio.
โ
Good: Providing a "Suggested Bios" feature to help them finish in seconds.
Doherty Threshold
Principle: Productivity skyrockets when a computer and its users interact at a pace (<400ms) that ensures neither has to wait on the other.
Application:
- Feedback: Use immediate visual cues for clicks.
- Loading: Use skeleton screens for perceivable performance.
- Optimism: Update UI before the server responds (Optimistic UI).
- Motion: Use micro-animations to mask slight delays.
- Caching: Pre-load next pages or assets in the background.
- Prioritization: Load text content before heavy high-res images.
Example:
โ Bad: A button that does nothing for 2 seconds after being clicked.
โ
Good: A button that immediately changes color and shows a "Loading" spinner.
โ Bad: A blank white screen that appears while data is fetching.
โ
Good: A skeleton screen showing the gray outlines of where content will appear.
Postelโs Law (Robustness Principle)
Principle: Be conservative in what you do, be liberal in what you accept from others.
Application:
- Error Handling: Don't error out for a missing space or dash.
- Formatting: Accept dates in DD/MM/YYYY or MM/DD/YYYY.
- Inputs: Strip trailing/leading white space automatically.
- Fallbacks: Use default avatars if a user hasn't uploaded a photo.
- Search: Accept typos and provide "Did you mean...?" suggestions.
- Accessibility: Ensure the site works across all browsers and devices.
Example:
โ Bad: Rejecting a phone number because the user put a space in it.
โ
Good: Accepting the input and stripping the spaces automatically.
โ Bad: Forcing users to type "January" instead of "01" or "Jan."
โ
Good: A date field that understands all three formats.
Occamโs Razor
Principle: Among competing hypotheses that predict equally well, the one with the fewest assumptions should be selected. The simplest solution is usually the best.
Application:
- Logic: Remove unnecessary clicks.
- Visuals: Use only as many fonts/colors as strictly necessary.
- Function: If one field can do the work of two, combine them.
- Copy: Use the shortest possible text to convey meaning.
- Layout: Remove decorative elements that don't serve a goal.
- Flow: Avoid branching paths unless absolutely required.
Example:
โ Bad: A "Login" button that opens a new page, then email, then password.
โ
Good: A single login modal that asks for both on one screen.
โ Bad: Using 5 different font sizes and 4 colors on a single card.
โ
Good: Using 2 font sizes and 1 accent color.
2. Visual Perception (Gestalt Principles)
Law of Proximity
Principle: Objects that are near, or proximate to each other, tend to be grouped together.
Application:
- Grouping: Keep labels physically close to input fields.
- Spacing: Larger margins between unrelated content blocks.
- Cards: Text inside a card should be closer to its image than the border.
- Footers: Cluster legal links together away from social links.
- Navigation: Group "User" settings separate from "App" settings.
- Forms: Group Address fields together, separate from Credit Card fields.
Example:
โ Bad: Large, equal gaps between every line of text in a form.
โ
Good: Tight spacing between a label and its input, with larger gaps between pairs.
โ Bad: A "Submit" button floating in the middle of a page, far from the form.
โ
Good: The "Submit" button placed directly under the last input field.
Law of Similarity
Principle: The human eye tends to perceive similar elements in a design as a complete picture, shape, or group, even if those elements are separated.
Application:
- Consistency: Consistent colors for all clickable links.
- Iconography: All icons in a set should have the same stroke weight.
- Buttons: Same shape/size for buttons with the same importance.
- Typography: Use the same H2 style for all section headers.
- Feedback: All "Delete" actions should use the same color (e.g. Red).
- States: Hover and Active states must be consistent across the app.
Example:
โ Bad: Some links are blue, some are green, and some are just bold black.
โ
Good: Every clickable text element in the app is the same shade of Blue.
โ Bad: Using a "Blue Button" for "Submit" and the same "Blue Button" for "Cancel."
โ
Good: "Submit" is Solid Blue; "Cancel" is a Blue Outline (Ghost Button).
Law of Common Region
Principle: Elements tend to be perceived into groups if they are sharing an area with a clearly defined boundary.
Application:
- Containerizing: Use cards to group images and titles.
- Borders: Use lines to separate the sidebar from the main feed.
- Backgrounds: Use a different background color for the footer.
- Modals: Use a distinct box to separate pop-ups from the page.
- Lists: Alternating background colors (zebra striping) for rows.
- Header: A solid bar across the top to group navigation items.
Example:
โ Bad: A list of news articles where the text and image of different stories overlap.
โ
Good: Each article is contained within its own white card on a light gray background.
โ Bad: A footer that has the same background color as the main body.
โ
Good: A dark-themed footer that clearly separates legal links from page content.
Law of Uniform Connectedness
Principle: Elements that are visually connected (e.g., via lines, arrows) are perceived as more related than elements with no connection.
Application:
- Flow: Use lines to connect steps in a progress wizard.
- Menus: Dropdowns that "touch" or connect to their parent button.
- Graphs: Lines connecting data points in a chart.
- Relationship: Connecting a toggle switch to the text it controls.
- Hierarchy: Tree structures for file directories.
- Forms: Connecting a "Credit Card" radio button to the fieldset below it.
Example:
โ Bad: A 3-step setup where the numbers "1", "2", and "3" are scattered.
โ
Good: A horizontal line connecting "1", "2", and "3" to show a sequence.
โ Bad: Floating dropdown menus that don't touch the button that opened them.
โ
Good: A dropdown menu that visually "attaches" to the parent button.
Law of Prรคgnanz (Simplicity)
Principle: People will perceive and interpret ambiguous or complex images as the simplest form possible, because it is the interpretation that requires the least cognitive effort.
Application:
- Clarity: Use clear, geometric icons for navigation.
- Reduction: Remove unnecessary 3D textures or shadows.
- Shapes: Prefer standard rectangles/circles over complex polygons.
- Focus: Use high-contrast silhouettes for primary actions.
- Logos: Simple brand marks that are recognizable at small sizes.
- UX: One main goal per page to keep the "mental shape" simple.
Example:
โ Bad: A hyper-realistic 3D illustration of a file folder for the "Files" icon.
โ
Good: A simple 2D outline of a folder.
โ Bad: A multi-colored, complex logo used as a loading spinner.
โ
Good: A simple, single-color circular ring.
Law of Figure/Ground
Principle: The eye differentiates an object from its surrounding area. a form, silhouette, or shape is perceived as figure (object), while the surrounding area is perceived as ground (background).
Application:
- Focus: Use overlays (scrims) for modals to pop the content.
- Depth: Drop shadows to imply the "figure" is sitting above the "ground."
- Contrast: Light text on dark ground (or vice versa).
- Blur: Use background blur to emphasize foreground text.
- Navigation: Floating sticky headers that stay above the page content.
- Hover: Elevate cards slightly on hover to define them as the figure.
Example:
โ Bad: A popup window that has no shadow or border, blending into the page.
โ
Good: A modal with a drop shadow and a dimmed background overlay.
โ Bad: White text placed directly over a busy, multi-colored photograph.
โ
Good: White text placed over a dark semi-transparent "scrim."
Law of Focal Point
Principle: Whatever stands out visually will capture and hold the viewerโs attention first.
Application:
- Entry: Place the primary value proposition at the focal point.
- Color: Use one high-vibrancy "Action Color" against a neutral UI.
- Movement: Use subtle animation on the CTA to draw the eye.
- Size: The most important statistic should be the largest font.
- Typography: Use bold weights for headers and standard weights for body.
- Direction: Use arrows or gaze (images of people looking at a button).
Example:
โ Bad: A homepage with 5 buttons of the same size and color.
โ
Good: One large "Get Started" button in a bright color.
โ Bad: A dashboard where "Total Revenue" is the same size as "System Version."
โ
Good: "Total Revenue" displayed in huge, bold numbers at the top center.
3. Cognitive Biases & Behavior
Zeigarnik Effect
Principle: People remember uncompleted or interrupted tasks better than completed tasks.
Application:
- Gamification: Use "Profile 60% complete" bars.
- Engagement: Tease the next module in a learning path.
- Retention: Show a "To-Do" list of features yet to be explored.
- Feedback: Persistent badges for unread messages.
- Momentum: Show "Next" steps immediately after completing one.
- Shopping: "Finish your order" reminders in the cart.
Example:
โ Bad: A silent onboarding process that gives no indication of what's left.
โ
Good: A checklist that shows "3 of 5 steps finished."
โ Bad: An e-learning app that shows a checkmark even if a video was half-watched.
โ
Good: A progress ring that stays half-full until the video is finished.
Goal Gradient Effect
Principle: The tendency to approach a goal increases with proximity to the goal.
Application:
- Momentum: Give users "Artificial Advancement" (e.g. 2 free stamps).
- Progress: Break a 10-field form into two 5-field steps.
- Feedback: Celebrate milestones halfway through a task.
- Motivation: Show the user how close they are to a reward/status.
- Navigation: Use breadcrumbs to show how close they are to the end.
- Loading: Speed up the loading animation as it nears 100%.
Example:
โ Bad: A progress bar that starts at 0% and feels like a long climb.
โ
Good: A bar that starts at 20% because the user "started" by opening the app.
โ Bad: A checkout flow where the "Final Review" feels like a surprise 5th step.
โ
Good: Clearly labeling the steps: "Shipping > Payment > Almost Done!"
Peak-End Rule
Principle: People judge an experience largely based on how they felt at its peak (the most intense point) and at its end, rather than the total sum or average of every moment.
Application:
- Success: Make the "Order Confirmed" screen memorable.
- Delight: Add confetti or a unique animation at the point of value.
- Support: Ensure the final interaction with a chat bot is helpful.
- Unboarding: Even when a user leaves, make the final exit clean.
- Onboarding: End the first session with a clear "Win."
- Error Handling: Turn a 404 page into a fun, helpful interaction.
Example:
โ Bad: After a 20-minute tax filing process, the app just says "Submitted."
โ
Good: A "Congratulations!" screen with a summary of the refund amount.
โ Bad: A game that ends with a simple "Game Over" text in plain font.
โ
Good: A summary screen showing high scores with celebratory music.
Aesthetic-Usability Effect
Principle: Users often perceive aesthetically pleasing design as design thatโs more usable.
Application:
- Trust: High-fidelity visuals buy "trust credit" for minor bugs.
- Branding: Consistent high-quality imagery build professionalism.
- Engagement: Beautiful interfaces keep users exploring longer.
- Patience: Users are more forgiving of load times if the UI is pretty.
- Confidence: Clean design makes complex tools feel more manageable.
- Loyalty: People form emotional bonds with beautiful products.
Example:
โ Bad: A banking app with misaligned text and clashing 1990s colors.
โ
Good: A sleek, modern banking app with smooth animations.
โ Bad: Using low-resolution, pixelated stock photos.
โ
Good: Using high-definition, custom brand illustrations.
Anchoring Bias
Principle: Users rely heavily on the first piece of information offered (the "anchor") when making decisions.
Application:
- Pricing: Show the original price crossed out.
- Tiers: Put the most expensive "Enterprise" plan on the far left.
- Sorting: Highlight "Most Popular" as the first recommendation.
- Discounts: State the "Save 20%" before showing the final price.
- Limits: "Limit 12 per customer" anchors the idea that it's high value.
- Defaults: Start with a high "Suggested Donation" amount.
Example:
โ Bad: Only showing the price "$49."
โ
Good: Showing "~~$99~~ $49 (50% Off)."
โ Bad: Sorting a list of laptops from cheapest to most expensive.
โ
Good: Showing a high-end "Pro" model first to make others seem cheap.
Social Proof
Principle: People copy the actions of others in an attempt to undertake behavior in a given situation.
Application:
- Validation: Display "Join 50,000+ others."
- Reviews: Star ratings and verified customer testimonials.
- Logos: "Trusted by" section showing partner brands.
- Live Feed: "Sarah just bought this 5 mins ago" notifications.
- Activity: "300 people are currently viewing this item."
- Certificates: Industry awards and security badges.
Example:
โ Bad: A signup page with just a form.
โ
Good: A signup page that says "Join 2 million designers."
โ Bad: Anonymous reviews with no names or photos.
โ
Good: Reviews that include a face, a name, and a "Verified Buyer" tag.
Scarcity Principle
Principle: Humans place a higher value on an object that is scarce, and a lower value on those that are in abundance.
Application:
- Urgency: "Only 2 items left in stock."
- Time: Ticking countdown timers for sales.
- Access: "Invite-only" betas or exclusive tiers.
- Seasonality: "Summer Edition" products.
- Low Stock: "Back in stock soon - pre-order now."
- Demand: "In high demand - 10 people have this in their cart."
Example:
โ Bad: A sale that never ends and has no countdown.
โ
Good: A "Deal of the Day" with a ticking timer.
โ Bad: Showing a product is available with no stock count.
โ
Good: "Only 3 left at this price!"
Authority Bias
Principle: The tendency to attribute greater accuracy to the opinion of an authority figure and be more influenced by that opinion.
Application:
- Expertise: Use "Expert-verified" or professional headshots.
- Certifications: Trust seals (Norton, ISO, HIPAA).
- Media: "As seen on TechCrunch/Forbes" logos.
- Endorsements: Testimonials from industry leaders or influencers.
- Language: Confident, professional, and accurate copy.
- History: "Established in 1950" to imply longevity and trust.
Example:
โ Bad: A health blog written by "Admin."