Design Fundamentals
Purpose
Create distinctive, beautiful UIs through intentional aesthetic choices backed by solid technical foundation.
Design Thinking
Choose Aesthetic Direction
Before coding, commit to clear aesthetic tone:
Minimal/Refined:
- Generous whitespace, restrained color palette
- Elegant serif or geometric sans-serif fonts
- Subtle interactions, high contrast
Bold/Vibrant:
- Saturated colors, strong contrasts
- Display fonts with personality
- Energetic interactions, dynamic layouts
Playful/Friendly:
- Rounded shapes, warm color palette
- Approachable fonts, comfortable spacing
- Delightful micro-interactions
Retro/Nostalgic:
- Period-specific typography
- Vintage color schemes, textured backgrounds
Organic/Natural:
- Earthy tones, soft shapes, flowing layouts
- Natural imagery, gentle transitions
Principle: Intentionality > intensity. Commit fully to chosen direction.
Avoid Generic AI Aesthetics
Never use these clichés:
❌ Purple gradients on white backgrounds
❌ System fonts everywhere (Inter, Roboto, Arial)
❌ Predictable 12-column grid layouts
❌ Safe, evenly-distributed color palettes
❌ Cookie-cutter card layouts
❌ Rounded corners on everything
Instead, be distinctive:
✅ Choose beautiful, characterful fonts
✅ Commit to bold colors OR refined neutrals
✅ Create unexpected layouts (asymmetry, overlap, diagonal flow)
✅ Use dominant colors with sharp accents
✅ Add visual details (textures, gradients, patterns, depth)
✅ Break the grid intentionally
Technical Foundation
Spacing System
Principle: Consistent scale creates visual rhythm and professionalism.
Choose ONE base unit and multiply:
- Smaller base (4): Finer control, granular spacing
- Larger base (8): Simpler system, bolder spacing
Build your scale:
- Start with base unit (4, 6, 8, or whatever fits)
- Create scale: base × 1, 2, 3, 4, 6, 8, 12, 16, 24
- Stick to scale values (avoid arbitrary in-between values)
Guidelines:
- Tighter spacing for related items
- Generous spacing separates major sections
- Whitespace = breathing room and importance
- Choose scale matching your aesthetic
Typography
Creative Direction:
- Choose distinctive, characterful fonts (not system fonts)
- Pair display font (headings) with refined body font
- Font conveys personality: geometric = modern, serif = elegant, rounded = friendly
- Avoid overused fonts: Inter, Roboto, Arial, Helvetica
Technical Specs:
- Body text: Readable size (typically 16px+, adjust based on font)
- Line height: 1.5-1.6 for body, 1.2-1.3 for headings
- Line length: 50-75 characters optimal
- Type scale: Choose ratio for consistent hierarchy
- Subtle/refined: Smaller ratio (1.2)
- Balanced: Medium ratio (1.25)
- Bold/dramatic: Larger ratio (1.333+)
Font Weights:
- Regular (400): Body text
- Semibold (600): Emphasis, subheadings
- Bold (700): Headings, strong emphasis
- Limit to 3-4 weights maximum
Hierarchy Levels:
- Primary: Page titles, main CTAs
- Secondary: Section headings, important actions
- Tertiary: Body text, labels
- Quaternary: Metadata, captions, helper text
Color System
Creative Direction:
- Commit to aesthetic: bold OR refined (not timid middle)
- Use dominant colors with sharp accents
- Color conveys mood: warm (energy), cool (calm), muted (sophistication)
- Consider color psychology for brand personality
Technical Specs:
- Primary: Main brand color for CTAs, key actions (1 color)
- Neutrals: Text, borders, backgrounds (5-7 shades from light to dark)
- Semantic: Success (green), error (red), warning (yellow), info (blue)
- Limit: 3-4 brand colors maximum
Contrast Requirements (WCAG AA - required for accessibility):
- Normal text: 4.5:1 minimum
- Large text: 3:1 minimum
- UI components: 3:1 minimum
- Use contrast checker tools to verify
Guidelines:
- Test all text/background combinations
- Don't rely on color alone (add icons, labels, patterns)
- Each color needs light/dark variants
Visual Hierarchy
Principle: Guide attention through size, weight, contrast, and spacing.
Create clear levels:
- Use size differences (headings larger than body)
- Use weight differences (bold for emphasis)
- Use spacing (more space = more importance)
- Use color sparingly for hierarchy
Hierarchy Techniques:
- Size: Primary elements significantly larger (2-3x+ size difference)
- Proximity: Group related items close, separate groups with generous space
- Contrast: Important elements use stronger contrast
- Alignment: Consistent alignment creates order
Spatial Composition
Layout Patterns
Create interest through:
- Asymmetry: Break symmetry for dynamic feel
- Overlap: Layer elements for depth
- Diagonal flow: Guide eye with angled layouts
- Whitespace: Generous negative space OR controlled density (intentional)
- Grid breaking: Intentionally break grid for emphasis
Alignment:
- Left-align text for readability (LTR languages)
- Center-align sparingly (titles, empty states)
- Right-align numbers in tables
- Be consistent within sections
Accessibility Essentials
Apply to every UI component — not optional.
Semantic HTML First
<button> for actions, <a> for navigation — never <div> with click handler
- Headings
<h1>→<h6> in order, don't skip levels
- Landmarks:
<nav>, <main>, <header>, <footer>
Focus
- Never remove focus outline — use
:focus-visible to hide for mouse, show for keyboard
- Minimum 2px outline, 3:1 contrast ratio
- Modals: move focus in on open, trap inside, return to trigger on close, Escape closes
ARIA (use only when semantic HTML insufficient)
- Icon-only buttons:
aria-label="Close"
- Toggles/dropdowns:
aria-expanded="true/false"
- Dynamic content (toasts, errors):
aria-live="polite" or "assertive" for urgent
- Error fields:
aria-invalid="true" + aria-describedby pointing to error message
Touch Targets
- Minimum 44×44px for all interactive elements
- 8px spacing between targets
Visual Details
Add Depth and Atmosphere
Backgrounds:
- Gradient meshes (soft, blended colors)
- Noise textures (subtle grain, paper texture)
- Geometric patterns (shapes, grids, dots)
- Layered transparencies (depth through layers)
Details:
- Shadows for elevation (subtle for cards, stronger for modals)
- Borders for definition (thin, subtle color difference)
- Subtle animations (hover states, quick transitions)
Validation Checklist
Creative:
Technical:
Key Takeaway
Distinctive + Correct = Beautiful UI
Technical correctness (spacing, contrast, hierarchy) ensures usability and professionalism.
Creative direction (aesthetic, fonts, colors, layouts) ensures memorability and distinctiveness.
Great design requires both: intentional aesthetic choices executed with technical precision.
Focus on intentionality - commit fully to chosen direction, then execute with consistency.
Avoid generic AI aesthetics through bold or refined choices, never timid middle ground.
1---2name: frontend-design-fundamentals3description: Base design skill for ALL frontend/UI work: spacing, typography, colors, visual hierarchy. Use when: any frontend/UI task — styling, CSS, components, layouts, animations. Keywords: frontend, UI, CSS, styling, layout, spacing, typography, card, button, form, dashboard, animation, hover, shadow Do NOT use for: backend, DevOps, React performance (→ react-best-practices).4---56# Design Fundamentals78## Purpose9Create distinctive, beautiful UIs through intentional aesthetic choices backed by solid technical foundation.1011---1213## Design Thinking1415### Choose Aesthetic Direction1617**Before coding, commit to clear aesthetic tone:**1819**Minimal/Refined:**20- Generous whitespace, restrained color palette21- Elegant serif or geometric sans-serif fonts22- Subtle interactions, high contrast2324**Bold/Vibrant:**25- Saturated colors, strong contrasts26- Display fonts with personality27- Energetic interactions, dynamic layouts2829**Playful/Friendly:**30- Rounded shapes, warm color palette31- Approachable fonts, comfortable spacing32- Delightful micro-interactions3334**Retro/Nostalgic:**35- Period-specific typography36- Vintage color schemes, textured backgrounds3738**Organic/Natural:**39- Earthy tones, soft shapes, flowing layouts40- Natural imagery, gentle transitions4142**Principle:** Intentionality > intensity. Commit fully to chosen direction.4344---4546### Avoid Generic AI Aesthetics4748**Never use these clichés:**4950❌ Purple gradients on white backgrounds51❌ System fonts everywhere (Inter, Roboto, Arial)52❌ Predictable 12-column grid layouts53❌ Safe, evenly-distributed color palettes54❌ Cookie-cutter card layouts55❌ Rounded corners on everything5657**Instead, be distinctive:**5859✅ Choose beautiful, characterful fonts60✅ Commit to bold colors OR refined neutrals61✅ Create unexpected layouts (asymmetry, overlap, diagonal flow)62✅ Use dominant colors with sharp accents63✅ Add visual details (textures, gradients, patterns, depth)64✅ Break the grid intentionally6566---6768## Technical Foundation6970### Spacing System7172**Principle:** Consistent scale creates visual rhythm and professionalism.7374**Choose ONE base unit and multiply:**75- Smaller base (4): Finer control, granular spacing76- Larger base (8): Simpler system, bolder spacing7778**Build your scale:**79- Start with base unit (4, 6, 8, or whatever fits)80- Create scale: base × 1, 2, 3, 4, 6, 8, 12, 16, 2481- Stick to scale values (avoid arbitrary in-between values)8283**Guidelines:**84- Tighter spacing for related items85- Generous spacing separates major sections86- Whitespace = breathing room and importance87- Choose scale matching your aesthetic8889---9091### Typography9293**Creative Direction:**94- Choose distinctive, characterful fonts (not system fonts)95- Pair display font (headings) with refined body font96- Font conveys personality: geometric = modern, serif = elegant, rounded = friendly97- Avoid overused fonts: Inter, Roboto, Arial, Helvetica9899**Technical Specs:**100- **Body text**: Readable size (typically 16px+, adjust based on font)101- **Line height**: 1.5-1.6 for body, 1.2-1.3 for headings102- **Line length**: 50-75 characters optimal103- **Type scale**: Choose ratio for consistent hierarchy104 - Subtle/refined: Smaller ratio (1.2)105 - Balanced: Medium ratio (1.25)106 - Bold/dramatic: Larger ratio (1.333+)107108**Font Weights:**109- Regular (400): Body text110- Semibold (600): Emphasis, subheadings111- Bold (700): Headings, strong emphasis112- Limit to 3-4 weights maximum113114**Hierarchy Levels:**115- Primary: Page titles, main CTAs116- Secondary: Section headings, important actions117- Tertiary: Body text, labels118- Quaternary: Metadata, captions, helper text119120---121122### Color System123124**Creative Direction:**125- Commit to aesthetic: bold OR refined (not timid middle)126- Use dominant colors with sharp accents127- Color conveys mood: warm (energy), cool (calm), muted (sophistication)128- Consider color psychology for brand personality129130**Technical Specs:**131- **Primary**: Main brand color for CTAs, key actions (1 color)132- **Neutrals**: Text, borders, backgrounds (5-7 shades from light to dark)133- **Semantic**: Success (green), error (red), warning (yellow), info (blue)134- **Limit**: 3-4 brand colors maximum135136**Contrast Requirements (WCAG AA - required for accessibility):**137- Normal text: 4.5:1 minimum138- Large text: 3:1 minimum139- UI components: 3:1 minimum140- Use contrast checker tools to verify141142**Guidelines:**143- Test all text/background combinations144- Don't rely on color alone (add icons, labels, patterns)145- Each color needs light/dark variants146147---148149### Visual Hierarchy150151**Principle:** Guide attention through size, weight, contrast, and spacing.152153**Create clear levels:**154- Use size differences (headings larger than body)155- Use weight differences (bold for emphasis)156- Use spacing (more space = more importance)157- Use color sparingly for hierarchy158159**Hierarchy Techniques:**160- **Size**: Primary elements significantly larger (2-3x+ size difference)161- **Proximity**: Group related items close, separate groups with generous space162- **Contrast**: Important elements use stronger contrast163- **Alignment**: Consistent alignment creates order164165---166167## Spatial Composition168169### Layout Patterns170171**Create interest through:**172- **Asymmetry**: Break symmetry for dynamic feel173- **Overlap**: Layer elements for depth174- **Diagonal flow**: Guide eye with angled layouts175- **Whitespace**: Generous negative space OR controlled density (intentional)176- **Grid breaking**: Intentionally break grid for emphasis177178**Alignment:**179- Left-align text for readability (LTR languages)180- Center-align sparingly (titles, empty states)181- Right-align numbers in tables182- Be consistent within sections183184---185186## Accessibility Essentials187188**Apply to every UI component — not optional.**189190### Semantic HTML First191- `<button>` for actions, `<a>` for navigation — never `<div>` with click handler192- Headings `<h1>`→`<h6>` in order, don't skip levels193- Landmarks: `<nav>`, `<main>`, `<header>`, `<footer>`194195### Focus196- Never remove focus outline — use `:focus-visible` to hide for mouse, show for keyboard197- Minimum 2px outline, 3:1 contrast ratio198- **Modals**: move focus in on open, trap inside, return to trigger on close, Escape closes199200### ARIA (use only when semantic HTML insufficient)201- Icon-only buttons: `aria-label="Close"`202- Toggles/dropdowns: `aria-expanded="true/false"`203- Dynamic content (toasts, errors): `aria-live="polite"` or `"assertive"` for urgent204- Error fields: `aria-invalid="true"` + `aria-describedby` pointing to error message205206### Touch Targets207- Minimum 44×44px for all interactive elements208- 8px spacing between targets209210---211212## Visual Details213214### Add Depth and Atmosphere215216**Backgrounds:**217- Gradient meshes (soft, blended colors)218- Noise textures (subtle grain, paper texture)219- Geometric patterns (shapes, grids, dots)220- Layered transparencies (depth through layers)221222**Details:**223- Shadows for elevation (subtle for cards, stronger for modals)224- Borders for definition (thin, subtle color difference)225- Subtle animations (hover states, quick transitions)226227---228229## Validation Checklist230231**Creative:**232- [ ] Clear aesthetic direction chosen233- [ ] Distinctive, characterful fonts (not generic)234- [ ] Cohesive color palette (bold OR refined)235- [ ] Unexpected layouts or intentional grid breaks236- [ ] Visual details add atmosphere237238**Technical:**239- [ ] Spacing follows consistent scale240- [ ] Font sizes use type scale241- [ ] Color contrast meets WCAG AA (verify with checker)242- [ ] Line length readable243- [ ] Visual hierarchy clear244- [ ] Alignment consistent and intentional245- [ ] Limited brand color palette246247---248249## Key Takeaway250251**Distinctive + Correct = Beautiful UI**252253Technical correctness (spacing, contrast, hierarchy) ensures usability and professionalism.254Creative direction (aesthetic, fonts, colors, layouts) ensures memorability and distinctiveness.255256Great design requires both: intentional aesthetic choices executed with technical precision.257258Focus on intentionality - commit fully to chosen direction, then execute with consistency.259Avoid generic AI aesthetics through bold or refined choices, never timid middle ground.