Design Guide
Core Philosophy
Apply modern, minimal design principles focused on clarity, consistency, and professionalism. Every UI element should serve a purpose, with intentional use of space, color, and typography.
Design Principles
1. Clean and Minimal Layout
Whitespace is essential
- Use generous padding and margins
- Avoid cluttered interfaces
- Group related elements with clear visual separation
- Remove unnecessary decorative elements
Visual hierarchy
- Establish clear content priority through size and spacing
- Use whitespace to guide attention
- Limit elements per section (3-7 items optimal)
2. Color System
Base palette
- Primary background: Off-white (#FAFAFA, #F5F5F5) or pure white (#FFFFFF)
- Text colors:
- Primary: Dark gray (#1A1A1A, #2D2D2D)
- Secondary: Medium gray (#6B6B6B, #737373)
- Tertiary: Light gray (#A0A0A0, #B3B3B3)
- Borders and dividers: Very light gray (#E5E5E5, #EBEBEB)
Accent color
- Choose ONE accent color for the entire interface
- Use sparingly for CTAs, links, and important interactive elements
- Recommended: Teal (#0D9488), Emerald (#059669), Indigo (#4F46E5), or custom brand color
- Apply to: Primary buttons, active states, key icons
Forbidden patterns
- No purple-blue gradients
- No rainbow or multi-color gradients
- No more than 3 colors total (base grays + one accent)
- No bright, saturated colors for large areas
3. Spacing System (8px Grid)
Consistent spacing units
- 8px: Compact spacing (icon padding, tight elements)
- 16px: Default spacing (between related elements, button padding)
- 24px: Medium spacing (section padding, card content)
- 32px: Large spacing (between sections)
- 48px: XL spacing (major section breaks)
- 64px: XXL spacing (page sections, hero spacing)
Application
- All margins, padding, gaps use these values exclusively
- Component dimensions follow 8px increments when possible
- Line heights: 1.5 for body, 1.2 for headings
4. Typography
Font selection
- Maximum 2 fonts: one for headings, one for body (or same for both)
- System fonts acceptable:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif
- Web fonts: Inter, Poppins, Work Sans, DM Sans
Size hierarchy
- Body text: 16px minimum (never below 14px)
- Small text: 14px (metadata, captions)
- Headings:
- H1: 32-48px
- H2: 24-32px
- H3: 20-24px
- H4: 18-20px
Weight and style
- Avoid excessive bold text
- Use weight variations (400, 500, 600, 700) for hierarchy
- Letter-spacing: -0.02em for large headings, 0 for body
5. Shadows and Depth
Subtle elevation
- Light shadow:
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06)
- Medium shadow:
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05)
- Avoid heavy, dramatic shadows
When to use
- Cards and modals: light to medium shadow
- Buttons: very subtle shadow on rest, slightly elevated on hover
- Dropdowns and popovers: medium shadow
6. Borders and Corners
Border radius
- Subtle rounding: 4-8px for most elements
- Medium rounding: 12-16px for cards and large containers
- Not everything needs rounding (tables, data grids can remain sharp)
Border usage
- Use either borders OR shadows, not both on the same element
- Thin borders: 1px solid with light gray (#E5E5E5)
- Input focus: 2px solid with accent color
7. Interactive States
Required states for all interactive elements
Buttons
/* Default */
background: accent-color;
color: white;
padding: 12px 24px;
border-radius: 6px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
/* Hover */
background: slightly-darker-accent;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
transform: translateY(-1px);
/* Active */
transform: translateY(0);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
/* Disabled */
background: light-gray;
color: medium-gray;
cursor: not-allowed;
opacity: 0.6;
Links
- Default: Accent color, no underline
- Hover: Underline, slightly darker
- Visited: Same as default (or slightly muted)
Form inputs
- Default: 1px border, light gray
- Focus: 2px border, accent color, subtle glow
- Error: Red border (#DC2626), error message below
- Disabled: Gray background, reduced opacity
8. Mobile-First Approach
Responsive thinking
- Design for mobile viewport first (320px-768px)
- Scale up to tablet (768px-1024px) and desktop (1024px+)
- Touch targets: Minimum 44x44px for buttons and interactive elements
- Stack vertically on mobile, consider horizontal on desktop
Breakpoints
/* Mobile: base styles */
/* Tablet: 768px */
/* Desktop: 1024px */
/* Large desktop: 1440px */
Component Patterns
Buttons
Good example
<button class="btn-primary">
Save Changes
</button>
<style>
.btn-primary {
background: #0D9488;
color: white;
padding: 12px 24px;
border-radius: 6px;
border: none;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: all 0.15s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
background: #0F766E;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
.btn-primary:disabled {
background: #D1D5DB;
color: #9CA3AF;
cursor: not-allowed;
transform: none;
}
</style>
Bad example
/* Avoid */
.btn-bad {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 5px 10px; /* Too small */
border-radius: 25px; /* Too rounded */
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5); /* Too heavy */
text-transform: uppercase;
letter-spacing: 2px;
}
Cards
Good example
<div class="card">
<h3 class="card-title">Dashboard</h3>
<p class="card-description">View your analytics and metrics</p>
</div>
<style>
.card {
background: white;
border: 1px solid #E5E5E5;
border-radius: 8px;
padding: 24px;
transition: border-color 0.2s ease;
}
.card:hover {
border-color: #D1D5DB;
}
.card-title {
font-size: 20px;
font-weight: 600;
margin-bottom: 8px;
color: #1A1A1A;
}
.card-description {
font-size: 16px;
color: #6B6B6B;
}
</style>
Bad example
/* Avoid */
.card-bad {
background: linear-gradient(to right, #fa709a, #fee140);
border: 3px solid purple;
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
border-radius: 30px;
}
Forms
Good example
<form class="form">
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" placeholder="you@example.com">
<span class="form-hint">We'll never share your email</span>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" class="error">
<span class="form-error">Password must be at least 8 characters</span>
</div>
</form>
<style>
.form-group {
margin-bottom: 24px;
}
label {
display: block;
font-size: 14px;
font-weight: 500;
color: #2D2D2D;
margin-bottom: 8px;
}
input {
width: 100%;
padding: 12px 16px;
border: 1px solid #D1D5DB;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.2s ease;
}
input:focus {
outline: none;
border-color: #0D9488;
box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
input.error {
border-color: #DC2626;
}
.form-hint {
font-size: 14px;
color: #6B6B6B;
margin-top: 4px;
display: block;
}
.form-error {
font-size: 14px;
color: #DC2626;
margin-top: 4px;
display: block;
}
</style>
Anti-Patterns to Avoid
Visual crimes
- Rainbow gradients or multiple bright colors
- Text smaller than 14px (except in rare cases)
- Inconsistent spacing (mixing random pixel values)
- Every element in a different color
- Heavy drop shadows everywhere
- Over-animation and excessive transitions
- Centered text for long paragraphs
- Poor color contrast (text on similar-colored backgrounds)
Structural issues
- No clear visual hierarchy
- Cluttered layouts with no breathing room
- Missing interactive states
- Inconsistent component styling
- Mixing design patterns (e.g., outlined buttons with filled buttons randomly)
Implementation Checklist
Before finalizing any UI component or page, verify:
When to Break These Rules
Rules can be broken with explicit user request or specific brand requirements. Document the deviation and ensure consistency in the exception.
1---2name: design-guide3description: Modern UI design principles and guidelines for building clean, professional interfaces. Use when creating any UI components, layouts, web pages, or interactive elements including buttons, forms, cards, navigation, or complete applications. Applies to HTML, CSS, React, Vue, Svelte, and any frontend framework. Ensures consistent, minimal, and accessible design patterns.4---5
6# Design Guide
7
8## Core Philosophy
9
10Apply modern, minimal design principles focused on clarity, consistency, and professionalism. Every UI element should serve a purpose, with intentional use of space, color, and typography.
11
12## Design Principles
13
14### 1. Clean and Minimal Layout
15
16**Whitespace is essential**
17- Use generous padding and margins
18- Avoid cluttered interfaces
19- Group related elements with clear visual separation
20- Remove unnecessary decorative elements
21
22**Visual hierarchy**
23- Establish clear content priority through size and spacing
24- Use whitespace to guide attention
25- Limit elements per section (3-7 items optimal)
26
27### 2. Color System
28
29**Base palette**
30- Primary background: Off-white (#FAFAFA, #F5F5F5) or pure white (#FFFFFF)
31- Text colors:
32 - Primary: Dark gray (#1A1A1A, #2D2D2D)
33 - Secondary: Medium gray (#6B6B6B, #737373)
34 - Tertiary: Light gray (#A0A0A0, #B3B3B3)
35- Borders and dividers: Very light gray (#E5E5E5, #EBEBEB)
36
37**Accent color**
38- Choose ONE accent color for the entire interface
39- Use sparingly for CTAs, links, and important interactive elements
40- Recommended: Teal (#0D9488), Emerald (#059669), Indigo (#4F46E5), or custom brand color
41- Apply to: Primary buttons, active states, key icons
42
43**Forbidden patterns**
44- No purple-blue gradients
45- No rainbow or multi-color gradients
46- No more than 3 colors total (base grays + one accent)
47- No bright, saturated colors for large areas
48
49### 3. Spacing System (8px Grid)
50
51**Consistent spacing units**
52- 8px: Compact spacing (icon padding, tight elements)
53- 16px: Default spacing (between related elements, button padding)
54- 24px: Medium spacing (section padding, card content)
55- 32px: Large spacing (between sections)
56- 48px: XL spacing (major section breaks)
57- 64px: XXL spacing (page sections, hero spacing)
58
59**Application**
60- All margins, padding, gaps use these values exclusively
61- Component dimensions follow 8px increments when possible
62- Line heights: 1.5 for body, 1.2 for headings
63
64### 4. Typography
65
66**Font selection**
67- Maximum 2 fonts: one for headings, one for body (or same for both)
68- System fonts acceptable: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`
69- Web fonts: Inter, Poppins, Work Sans, DM Sans
70
71**Size hierarchy**
72- Body text: 16px minimum (never below 14px)
73- Small text: 14px (metadata, captions)
74- Headings:
75 - H1: 32-48px
76 - H2: 24-32px
77 - H3: 20-24px
78 - H4: 18-20px
79
80**Weight and style**
81- Avoid excessive bold text
82- Use weight variations (400, 500, 600, 700) for hierarchy
83- Letter-spacing: -0.02em for large headings, 0 for body
84
85### 5. Shadows and Depth
86
87**Subtle elevation**
88- Light shadow: `box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06)`
89- Medium shadow: `box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05)`
90- Avoid heavy, dramatic shadows
91
92**When to use**
93- Cards and modals: light to medium shadow
94- Buttons: very subtle shadow on rest, slightly elevated on hover
95- Dropdowns and popovers: medium shadow
96
97### 6. Borders and Corners
98
99**Border radius**
100- Subtle rounding: 4-8px for most elements
101- Medium rounding: 12-16px for cards and large containers
102- Not everything needs rounding (tables, data grids can remain sharp)
103
104**Border usage**
105- Use either borders OR shadows, not both on the same element
106- Thin borders: 1px solid with light gray (#E5E5E5)
107- Input focus: 2px solid with accent color
108
109### 7. Interactive States
110
111**Required states for all interactive elements**
112
113**Buttons**
114```css
115/* Default */
116background: accent-color;
117color: white;
118padding: 12px 24px;
119border-radius: 6px;
120box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
121
122/* Hover */
123background: slightly-darker-accent;
124box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
125transform: translateY(-1px);
126
127/* Active */
128transform: translateY(0);
129box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
130
131/* Disabled */
132background: light-gray;
133color: medium-gray;
134cursor: not-allowed;
135opacity: 0.6;
136```
137
138**Links**
139- Default: Accent color, no underline
140- Hover: Underline, slightly darker
141- Visited: Same as default (or slightly muted)
142
143**Form inputs**
144- Default: 1px border, light gray
145- Focus: 2px border, accent color, subtle glow
146- Error: Red border (#DC2626), error message below
147- Disabled: Gray background, reduced opacity
148
149### 8. Mobile-First Approach
150
151**Responsive thinking**
152- Design for mobile viewport first (320px-768px)
153- Scale up to tablet (768px-1024px) and desktop (1024px+)
154- Touch targets: Minimum 44x44px for buttons and interactive elements
155- Stack vertically on mobile, consider horizontal on desktop
156
157**Breakpoints**
158```css
159/* Mobile: base styles */
160/* Tablet: 768px */
161/* Desktop: 1024px */
162/* Large desktop: 1440px */
163```
164
165## Component Patterns
166
167### Buttons
168
169**Good example**
170```html
171<button class="btn-primary">
172 Save Changes
173</button>
174
175<style>
176.btn-primary {
177 background: #0D9488;
178 color: white;
179 padding: 12px 24px;
180 border-radius: 6px;
181 border: none;
182 font-size: 16px;
183 font-weight: 500;
184 cursor: pointer;
185 transition: all 0.15s ease;
186 box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
187}
188
189.btn-primary:hover {
190 background: #0F766E;
191 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
192 transform: translateY(-1px);
193}
194
195.btn-primary:disabled {
196 background: #D1D5DB;
197 color: #9CA3AF;
198 cursor: not-allowed;
199 transform: none;
200}
201</style>
202```
203
204**Bad example**
205```css
206/* Avoid */
207.btn-bad {
208 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
209 padding: 5px 10px; /* Too small */
210 border-radius: 25px; /* Too rounded */
211 box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5); /* Too heavy */
212 text-transform: uppercase;
213 letter-spacing: 2px;
214}
215```
216
217### Cards
218
219**Good example**
220```html
221<div class="card">
222 <h3 class="card-title">Dashboard</h3>
223 <p class="card-description">View your analytics and metrics</p>
224</div>
225
226<style>
227.card {
228 background: white;
229 border: 1px solid #E5E5E5;
230 border-radius: 8px;
231 padding: 24px;
232 transition: border-color 0.2s ease;
233}
234
235.card:hover {
236 border-color: #D1D5DB;
237}
238
239.card-title {
240 font-size: 20px;
241 font-weight: 600;
242 margin-bottom: 8px;
243 color: #1A1A1A;
244}
245
246.card-description {
247 font-size: 16px;
248 color: #6B6B6B;
249}
250</style>
251```
252
253**Bad example**
254```css
255/* Avoid */
256.card-bad {
257 background: linear-gradient(to right, #fa709a, #fee140);
258 border: 3px solid purple;
259 box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
260 border-radius: 30px;
261}
262```
263
264### Forms
265
266**Good example**
267```html
268<form class="form">
269 <div class="form-group">
270 <label for="email">Email Address</label>
271 <input type="email" id="email" placeholder="you@example.com">
272 <span class="form-hint">We'll never share your email</span>
273 </div>
274
275 <div class="form-group">
276 <label for="password">Password</label>
277 <input type="password" id="password" class="error">
278 <span class="form-error">Password must be at least 8 characters</span>
279 </div>
280</form>
281
282<style>
283.form-group {
284 margin-bottom: 24px;
285}
286
287label {
288 display: block;
289 font-size: 14px;
290 font-weight: 500;
291 color: #2D2D2D;
292 margin-bottom: 8px;
293}
294
295input {
296 width: 100%;
297 padding: 12px 16px;
298 border: 1px solid #D1D5DB;
299 border-radius: 6px;
300 font-size: 16px;
301 transition: border-color 0.2s ease;
302}
303
304input:focus {
305 outline: none;
306 border-color: #0D9488;
307 box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
308}
309
310input.error {
311 border-color: #DC2626;
312}
313
314.form-hint {
315 font-size: 14px;
316 color: #6B6B6B;
317 margin-top: 4px;
318 display: block;
319}
320
321.form-error {
322 font-size: 14px;
323 color: #DC2626;
324 margin-top: 4px;
325 display: block;
326}
327</style>
328```
329
330## Anti-Patterns to Avoid
331
332**Visual crimes**
333- Rainbow gradients or multiple bright colors
334- Text smaller than 14px (except in rare cases)
335- Inconsistent spacing (mixing random pixel values)
336- Every element in a different color
337- Heavy drop shadows everywhere
338- Over-animation and excessive transitions
339- Centered text for long paragraphs
340- Poor color contrast (text on similar-colored backgrounds)
341
342**Structural issues**
343- No clear visual hierarchy
344- Cluttered layouts with no breathing room
345- Missing interactive states
346- Inconsistent component styling
347- Mixing design patterns (e.g., outlined buttons with filled buttons randomly)
348
349## Implementation Checklist
350
351Before finalizing any UI component or page, verify:
352
353- [ ] Spacing follows 8px grid system
354- [ ] Maximum 3 colors used (grays + one accent)
355- [ ] All text is 16px minimum (14px acceptable for metadata)
356- [ ] Interactive elements have hover, active, and disabled states
357- [ ] Shadows are subtle (not heavy or dramatic)
358- [ ] No gradients used (unless explicitly requested)
359- [ ] Typography hierarchy is clear
360- [ ] Mobile viewport considered (touch targets 44px+)
361- [ ] Color contrast meets accessibility standards (4.5:1 minimum)
362- [ ] Consistent border radius values throughout
363
364## When to Break These Rules
365
366Rules can be broken with explicit user request or specific brand requirements. Document the deviation and ensure consistency in the exception.