@champpaba/claude-agent-kit 3.0.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.claude/CHANGELOG.md +707 -0
  2. package/.claude/CLAUDE.md +128 -613
  3. package/.claude/agents/_shared/pre-work-checklist.md +108 -7
  4. package/.claude/commands/cdev.md +36 -0
  5. package/.claude/commands/csetup.md +292 -1791
  6. package/.claude/commands/cview.md +364 -364
  7. package/.claude/contexts/design/accessibility.md +611 -611
  8. package/.claude/contexts/design/layout.md +400 -400
  9. package/.claude/contexts/design/responsive.md +551 -551
  10. package/.claude/contexts/design/shadows.md +522 -522
  11. package/.claude/contexts/design/typography.md +465 -465
  12. package/.claude/contexts/domain/README.md +164 -164
  13. package/.claude/contexts/patterns/agent-coordination.md +388 -388
  14. package/.claude/contexts/patterns/development-principles.md +513 -513
  15. package/.claude/contexts/patterns/error-handling.md +478 -478
  16. package/.claude/contexts/patterns/logging.md +424 -424
  17. package/.claude/contexts/patterns/tdd-classification.md +516 -516
  18. package/.claude/contexts/patterns/testing.md +413 -413
  19. package/.claude/lib/README.md +3 -3
  20. package/.claude/lib/detailed-guides/taskmaster-analysis.md +1 -1
  21. package/.claude/lib/task-analyzer.md +144 -0
  22. package/.claude/lib/tdd-workflow.md +2 -1
  23. package/.claude/lib/validation-gates.md +484 -484
  24. package/.claude/settings.local.json +42 -42
  25. package/.claude/templates/PROJECT_STATUS.template.yml +16 -41
  26. package/.claude/templates/context-template.md +45 -45
  27. package/.claude/templates/flags-template.json +42 -42
  28. package/.claude/templates/phases-sections/accessibility-test.md +17 -17
  29. package/.claude/templates/phases-sections/api-design.md +37 -37
  30. package/.claude/templates/phases-sections/backend-tests.md +16 -16
  31. package/.claude/templates/phases-sections/backend.md +37 -37
  32. package/.claude/templates/phases-sections/business-logic-validation.md +16 -16
  33. package/.claude/templates/phases-sections/component-tests.md +17 -17
  34. package/.claude/templates/phases-sections/contract-backend.md +16 -16
  35. package/.claude/templates/phases-sections/contract-frontend.md +16 -16
  36. package/.claude/templates/phases-sections/database.md +35 -35
  37. package/.claude/templates/phases-sections/e2e-tests.md +16 -16
  38. package/.claude/templates/phases-sections/fix-implementation.md +17 -17
  39. package/.claude/templates/phases-sections/frontend-integration.md +18 -18
  40. package/.claude/templates/phases-sections/manual-flow-test.md +15 -15
  41. package/.claude/templates/phases-sections/manual-ux-test.md +16 -16
  42. package/.claude/templates/phases-sections/refactor-implementation.md +17 -17
  43. package/.claude/templates/phases-sections/refactor.md +16 -16
  44. package/.claude/templates/phases-sections/regression-tests.md +15 -15
  45. package/.claude/templates/phases-sections/responsive-test.md +16 -16
  46. package/.claude/templates/phases-sections/script-implementation.md +43 -43
  47. package/.claude/templates/phases-sections/test-coverage.md +16 -16
  48. package/.claude/templates/phases-sections/user-approval.md +14 -14
  49. package/LICENSE +21 -21
  50. package/package.json +1 -1
  51. package/.claude/lib/tdd-classifier.md +0 -345
@@ -1,465 +1,465 @@
1
- # Typography System
2
-
3
- > **Purpose:** Consistent type hierarchy, readability, and typographic rhythm
4
-
5
- ---
6
-
7
- ## Type Scale (5-Level Hierarchy)
8
-
9
- **Core Principle:** Use a modular scale for harmonious font sizes
10
-
11
- ### Standard Type Scale
12
-
13
- | Level | Token | Size (rem) | Pixels | Use Case |
14
- |-------|-------|------------|--------|----------|
15
- | **H1** | `text-4xl` | 2.5rem | 40px | Hero titles, landing page headers |
16
- | **H2** | `text-3xl` | 2rem | 32px | Page titles, section headers |
17
- | **H3** | `text-2xl` | 1.5rem | 24px | Subsection titles, card headers |
18
- | **Body** | `text-base` | 1rem | 16px | Paragraphs, content, buttons |
19
- | **Small** | `text-sm` | 0.875rem | 14px | Labels, captions, metadata |
20
-
21
- ### Extended Scale (for flexibility)
22
-
23
- ```css
24
- :root {
25
- /* Tiny */
26
- --text-xs: 0.75rem; /* 12px - Fine print, badges */
27
-
28
- /* Small */
29
- --text-sm: 0.875rem; /* 14px - Labels, captions */
30
-
31
- /* Base */
32
- --text-base: 1rem; /* 16px - Body text */
33
-
34
- /* Medium */
35
- --text-lg: 1.125rem; /* 18px - Emphasized body text */
36
-
37
- /* Large */
38
- --text-xl: 1.25rem; /* 20px - Small headings */
39
- --text-2xl: 1.5rem; /* 24px - H3 */
40
- --text-3xl: 2rem; /* 32px - H2 */
41
- --text-4xl: 2.5rem; /* 40px - H1 */
42
-
43
- /* Extra Large */
44
- --text-5xl: 3rem; /* 48px - Hero (desktop) */
45
- --text-6xl: 3.75rem; /* 60px - Display (marketing) */
46
- }
47
- ```
48
-
49
- ---
50
-
51
- ## Font Weights
52
-
53
- **Standard Weights:**
54
-
55
- | Weight | Value | Use Case |
56
- |--------|-------|----------|
57
- | **Light** | 300 | Rarely used (decorative only) |
58
- | **Regular** | 400 | Body text, paragraphs |
59
- | **Medium** | 500 | Emphasized text, labels |
60
- | **Semibold** | 600 | Buttons, important labels |
61
- | **Bold** | 700 | Headings (H1-H3), strong emphasis |
62
- | **Extrabold** | 800 | Hero titles (rare) |
63
-
64
- **Implementation:**
65
- ```css
66
- :root {
67
- --font-weight-light: 300;
68
- --font-weight-regular: 400;
69
- --font-weight-medium: 500;
70
- --font-weight-semibold: 600;
71
- --font-weight-bold: 700;
72
- --font-weight-extrabold: 800;
73
- }
74
- ```
75
-
76
- **Usage Guidelines:**
77
- - ✅ Body text: Regular (400)
78
- - ✅ Headings: Bold (700)
79
- - ✅ Buttons: Semibold (600) or Medium (500)
80
- - ✅ Labels: Medium (500)
81
- - ❌ Avoid Light (300) for body text (low readability)
82
- - ❌ Avoid Extrabold (800) except for hero titles
83
-
84
- ---
85
-
86
- ## Line Height (Leading)
87
-
88
- **Rule:** Tighter for headings, looser for body text
89
-
90
- ### Standard Line Heights
91
-
92
- | Element Type | Line Height | Ratio | Use Case |
93
- |--------------|-------------|-------|----------|
94
- | **Headings** | 1.2 | Tight | Visual impact, hierarchy |
95
- | **Headings** | 1.3 | Medium | Balance (alternative) |
96
- | **Body Text** | 1.5 | Comfortable | Readability, long-form |
97
- | **Body Text** | 1.6 | Loose | Extra comfort (rare) |
98
- | **Small Text** | 1.4 | Compact | Labels, captions |
99
- | **Code** | 1.7 | Extra space | Technical content |
100
-
101
- **Implementation:**
102
- ```css
103
- :root {
104
- --leading-tight: 1.2; /* Headings */
105
- --leading-snug: 1.3; /* Headings (alternative) */
106
- --leading-normal: 1.5; /* Body text */
107
- --leading-relaxed: 1.6; /* Body text (loose) */
108
- --leading-loose: 1.7; /* Code blocks */
109
- }
110
-
111
- h1, h2, h3 {
112
- line-height: var(--leading-tight);
113
- }
114
-
115
- p, li {
116
- line-height: var(--leading-normal);
117
- }
118
-
119
- code, pre {
120
- line-height: var(--leading-loose);
121
- }
122
- ```
123
-
124
- **Why This Matters:**
125
- - Tight line height (1.2): Headings feel "punchy" and impactful
126
- - Normal line height (1.5): Body text is comfortable to read
127
- - Loose line height (1.7): Code is easier to scan
128
-
129
- ---
130
-
131
- ## Letter Spacing (Tracking)
132
-
133
- **Rule:** Looser for uppercase, tighter for display text
134
-
135
- ```css
136
- :root {
137
- --tracking-tighter: -0.05em; /* Large headings */
138
- --tracking-tight: -0.025em; /* H1-H3 */
139
- --tracking-normal: 0; /* Body text */
140
- --tracking-wide: 0.025em; /* Uppercase, small text */
141
- --tracking-wider: 0.05em; /* ALL CAPS */
142
- --tracking-widest: 0.1em; /* Extreme emphasis */
143
- }
144
-
145
- h1 {
146
- letter-spacing: var(--tracking-tighter); /* -0.05em */
147
- }
148
-
149
- .label-uppercase {
150
- text-transform: uppercase;
151
- letter-spacing: var(--tracking-wide); /* 0.025em */
152
- }
153
-
154
- .all-caps {
155
- text-transform: uppercase;
156
- letter-spacing: var(--tracking-wider); /* 0.05em */
157
- }
158
- ```
159
-
160
- **When to Use:**
161
- - ✅ Tighter tracking: Large headings (H1, Hero)
162
- - ✅ Wider tracking: Uppercase text, labels
163
- - ✅ Normal tracking: Body text, paragraphs
164
- - ❌ Avoid tight tracking on small text (hard to read)
165
-
166
- ---
167
-
168
- ## Font Families
169
-
170
- ### System Font Stack (Recommended)
171
-
172
- **Advantages:**
173
- - ✅ No web font loading (instant render)
174
- - ✅ Native OS appearance
175
- - ✅ Optimal performance
176
- - ✅ Familiar to users
177
-
178
- **Implementation:**
179
- ```css
180
- :root {
181
- /* Sans-serif (default) */
182
- --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI",
183
- Roboto, "Helvetica Neue", Arial, sans-serif;
184
-
185
- /* Monospace (code) */
186
- --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro",
187
- Menlo, Monaco, "Courier New", monospace;
188
-
189
- /* Serif (optional) */
190
- --font-serif: ui-serif, Georgia, Cambria, "Times New Roman",
191
- Times, serif;
192
- }
193
-
194
- body {
195
- font-family: var(--font-sans);
196
- }
197
-
198
- code, pre {
199
- font-family: var(--font-mono);
200
- }
201
- ```
202
-
203
- ### Web Fonts (Optional)
204
-
205
- **Popular Choices:**
206
- - **Inter**: Modern, versatile, excellent readability
207
- - **Roboto**: Clean, professional, Google's default
208
- - **Poppins**: Geometric, friendly, modern
209
- - **Open Sans**: Humanist, neutral, widely used
210
- - **Lato**: Semi-rounded, approachable
211
-
212
- **Implementation (Google Fonts):**
213
- ```html
214
- <!-- In <head> -->
215
- <link rel="preconnect" href="https://fonts.googleapis.com">
216
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
217
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
218
- ```
219
-
220
- ```css
221
- :root {
222
- --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
223
- }
224
- ```
225
-
226
- **⚠️ Performance Considerations:**
227
- - Use `font-display: swap` to avoid FOIT (Flash of Invisible Text)
228
- - Limit to 3-4 weights (e.g., 400, 500, 600, 700)
229
- - Consider variable fonts (fewer requests)
230
-
231
- ---
232
-
233
- ## Typographic Hierarchy
234
-
235
- ### Complete Heading System
236
-
237
- ```css
238
- h1 {
239
- font-size: var(--text-4xl); /* 40px */
240
- font-weight: var(--font-weight-bold); /* 700 */
241
- line-height: var(--leading-tight); /* 1.2 */
242
- letter-spacing: var(--tracking-tighter); /* -0.05em */
243
- margin-bottom: var(--spacing-6); /* 24px */
244
- }
245
-
246
- h2 {
247
- font-size: var(--text-3xl); /* 32px */
248
- font-weight: var(--font-weight-bold); /* 700 */
249
- line-height: var(--leading-tight); /* 1.2 */
250
- letter-spacing: var(--tracking-tight); /* -0.025em */
251
- margin-bottom: var(--spacing-4); /* 16px */
252
- }
253
-
254
- h3 {
255
- font-size: var(--text-2xl); /* 24px */
256
- font-weight: var(--font-weight-semibold); /* 600 */
257
- line-height: var(--leading-snug); /* 1.3 */
258
- margin-bottom: var(--spacing-4); /* 16px */
259
- }
260
-
261
- p {
262
- font-size: var(--text-base); /* 16px */
263
- font-weight: var(--font-weight-regular); /* 400 */
264
- line-height: var(--leading-normal); /* 1.5 */
265
- margin-bottom: var(--spacing-4); /* 16px */
266
- }
267
-
268
- small {
269
- font-size: var(--text-sm); /* 14px */
270
- font-weight: var(--font-weight-regular); /* 400 */
271
- line-height: var(--leading-normal); /* 1.5 */
272
- }
273
- ```
274
-
275
- ---
276
-
277
- ## Responsive Typography
278
-
279
- ### Mobile-First Scaling
280
-
281
- ```css
282
- /* Mobile (default) */
283
- h1 {
284
- font-size: 2rem; /* 32px */
285
- }
286
-
287
- h2 {
288
- font-size: 1.5rem; /* 24px */
289
- }
290
-
291
- /* Tablet (640px+) */
292
- @media (min-width: 640px) {
293
- h1 {
294
- font-size: 2.25rem; /* 36px */
295
- }
296
-
297
- h2 {
298
- font-size: 1.75rem; /* 28px */
299
- }
300
- }
301
-
302
- /* Desktop (1024px+) */
303
- @media (min-width: 1024px) {
304
- h1 {
305
- font-size: 2.5rem; /* 40px */
306
- }
307
-
308
- h2 {
309
- font-size: 2rem; /* 32px */
310
- }
311
- }
312
- ```
313
-
314
- **Scaling Pattern:**
315
- - Mobile: 80% of desktop size
316
- - Tablet: 90% of desktop size
317
- - Desktop: 100% (base size)
318
-
319
- ---
320
-
321
- ## Text Color & Contrast
322
-
323
- ### Standard Text Colors
324
-
325
- ```css
326
- :root {
327
- /* Light mode */
328
- --text-primary: rgb(17, 24, 39); /* gray-900 - Headings */
329
- --text-secondary: rgb(55, 65, 81); /* gray-700 - Body text */
330
- --text-tertiary: rgb(107, 114, 128); /* gray-500 - Muted text */
331
- --text-disabled: rgb(156, 163, 175); /* gray-400 - Disabled */
332
- }
333
-
334
- .dark {
335
- /* Dark mode */
336
- --text-primary: rgb(255, 255, 255); /* White - Headings */
337
- --text-secondary: rgb(229, 231, 235); /* gray-200 - Body */
338
- --text-tertiary: rgb(156, 163, 175); /* gray-400 - Muted */
339
- --text-disabled: rgb(75, 85, 99); /* gray-600 - Disabled */
340
- }
341
- ```
342
-
343
- **WCAG Contrast Requirements:**
344
- | Text Size | WCAG AA | WCAG AAA |
345
- |-----------|---------|----------|
346
- | Normal text (<18pt) | 4.5:1 | 7:1 |
347
- | Large text (≥18pt) | 3:1 | 4.5:1 |
348
-
349
- ---
350
-
351
- ## Common Patterns
352
-
353
- ### Article/Blog Post
354
-
355
- ```css
356
- .prose {
357
- max-width: 65ch; /* Optimal reading width */
358
- font-size: var(--text-base);
359
- line-height: var(--leading-relaxed); /* 1.6 - Extra comfort */
360
- color: var(--text-secondary);
361
- }
362
-
363
- .prose h1 {
364
- margin-top: var(--spacing-12);
365
- margin-bottom: var(--spacing-6);
366
- }
367
-
368
- .prose h2 {
369
- margin-top: var(--spacing-8);
370
- margin-bottom: var(--spacing-4);
371
- }
372
-
373
- .prose p {
374
- margin-bottom: var(--spacing-4);
375
- }
376
-
377
- .prose strong {
378
- font-weight: var(--font-weight-semibold);
379
- color: var(--text-primary);
380
- }
381
- ```
382
-
383
- ### Button Text
384
-
385
- ```css
386
- .button {
387
- font-size: var(--text-base); /* 16px */
388
- font-weight: var(--font-weight-semibold); /* 600 */
389
- line-height: 1; /* Tight for buttons */
390
- letter-spacing: var(--tracking-normal);
391
- }
392
-
393
- .button-sm {
394
- font-size: var(--text-sm); /* 14px */
395
- font-weight: var(--font-weight-medium); /* 500 */
396
- }
397
- ```
398
-
399
- ### Labels & Form Fields
400
-
401
- ```css
402
- .label {
403
- font-size: var(--text-sm); /* 14px */
404
- font-weight: var(--font-weight-medium); /* 500 */
405
- line-height: var(--leading-normal); /* 1.5 */
406
- color: var(--text-primary);
407
- margin-bottom: var(--spacing-2); /* 8px */
408
- }
409
-
410
- .input {
411
- font-size: var(--text-base); /* 16px - iOS zoom prevention */
412
- font-weight: var(--font-weight-regular); /* 400 */
413
- line-height: var(--leading-normal); /* 1.5 */
414
- }
415
- ```
416
-
417
- ---
418
-
419
- ## Best Practices
420
-
421
- ### DO:
422
- - ✅ Use modular scale (1.25x or 1.5x ratio)
423
- - ✅ Limit to 3-4 font sizes for simplicity
424
- - ✅ Use relative units (rem, em) for scalability
425
- - ✅ Test readability on mobile devices
426
- - ✅ Ensure 4.5:1 contrast for body text
427
- - ✅ Use system fonts for performance
428
- - ✅ Match line height to font size (smaller = tighter)
429
-
430
- ### DON'T:
431
- - ❌ Use more than 2 font families
432
- - ❌ Use pixel units for font sizes
433
- - ❌ Set font-size < 16px on inputs (iOS zoom)
434
- - ❌ Use low-contrast text (fails accessibility)
435
- - ❌ Use light font weights for body text
436
- - ❌ Forget responsive scaling
437
- - ❌ Use excessive letter spacing on body text
438
-
439
- ---
440
-
441
- ## Quick Reference
442
-
443
- **Type Scale:**
444
- | Element | Size | Weight | Line Height |
445
- |---------|------|--------|-------------|
446
- | H1 | 40px (2.5rem) | Bold (700) | 1.2 |
447
- | H2 | 32px (2rem) | Bold (700) | 1.2 |
448
- | H3 | 24px (1.5rem) | Semibold (600) | 1.3 |
449
- | Body | 16px (1rem) | Regular (400) | 1.5 |
450
- | Small | 14px (0.875rem) | Regular (400) | 1.5 |
451
-
452
- **Font Weights:**
453
- - Body text: 400 (Regular)
454
- - Labels: 500 (Medium)
455
- - Buttons: 600 (Semibold)
456
- - Headings: 700 (Bold)
457
-
458
- **Line Heights:**
459
- - Headings: 1.2-1.3
460
- - Body text: 1.5-1.6
461
- - Small text: 1.4-1.5
462
-
463
- ---
464
-
465
- **💡 Remember:** Good typography is invisible. It should aid readability, not distract!
1
+ # Typography System
2
+
3
+ > **Purpose:** Consistent type hierarchy, readability, and typographic rhythm
4
+
5
+ ---
6
+
7
+ ## Type Scale (5-Level Hierarchy)
8
+
9
+ **Core Principle:** Use a modular scale for harmonious font sizes
10
+
11
+ ### Standard Type Scale
12
+
13
+ | Level | Token | Size (rem) | Pixels | Use Case |
14
+ |-------|-------|------------|--------|----------|
15
+ | **H1** | `text-4xl` | 2.5rem | 40px | Hero titles, landing page headers |
16
+ | **H2** | `text-3xl` | 2rem | 32px | Page titles, section headers |
17
+ | **H3** | `text-2xl` | 1.5rem | 24px | Subsection titles, card headers |
18
+ | **Body** | `text-base` | 1rem | 16px | Paragraphs, content, buttons |
19
+ | **Small** | `text-sm` | 0.875rem | 14px | Labels, captions, metadata |
20
+
21
+ ### Extended Scale (for flexibility)
22
+
23
+ ```css
24
+ :root {
25
+ /* Tiny */
26
+ --text-xs: 0.75rem; /* 12px - Fine print, badges */
27
+
28
+ /* Small */
29
+ --text-sm: 0.875rem; /* 14px - Labels, captions */
30
+
31
+ /* Base */
32
+ --text-base: 1rem; /* 16px - Body text */
33
+
34
+ /* Medium */
35
+ --text-lg: 1.125rem; /* 18px - Emphasized body text */
36
+
37
+ /* Large */
38
+ --text-xl: 1.25rem; /* 20px - Small headings */
39
+ --text-2xl: 1.5rem; /* 24px - H3 */
40
+ --text-3xl: 2rem; /* 32px - H2 */
41
+ --text-4xl: 2.5rem; /* 40px - H1 */
42
+
43
+ /* Extra Large */
44
+ --text-5xl: 3rem; /* 48px - Hero (desktop) */
45
+ --text-6xl: 3.75rem; /* 60px - Display (marketing) */
46
+ }
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Font Weights
52
+
53
+ **Standard Weights:**
54
+
55
+ | Weight | Value | Use Case |
56
+ |--------|-------|----------|
57
+ | **Light** | 300 | Rarely used (decorative only) |
58
+ | **Regular** | 400 | Body text, paragraphs |
59
+ | **Medium** | 500 | Emphasized text, labels |
60
+ | **Semibold** | 600 | Buttons, important labels |
61
+ | **Bold** | 700 | Headings (H1-H3), strong emphasis |
62
+ | **Extrabold** | 800 | Hero titles (rare) |
63
+
64
+ **Implementation:**
65
+ ```css
66
+ :root {
67
+ --font-weight-light: 300;
68
+ --font-weight-regular: 400;
69
+ --font-weight-medium: 500;
70
+ --font-weight-semibold: 600;
71
+ --font-weight-bold: 700;
72
+ --font-weight-extrabold: 800;
73
+ }
74
+ ```
75
+
76
+ **Usage Guidelines:**
77
+ - ✅ Body text: Regular (400)
78
+ - ✅ Headings: Bold (700)
79
+ - ✅ Buttons: Semibold (600) or Medium (500)
80
+ - ✅ Labels: Medium (500)
81
+ - ❌ Avoid Light (300) for body text (low readability)
82
+ - ❌ Avoid Extrabold (800) except for hero titles
83
+
84
+ ---
85
+
86
+ ## Line Height (Leading)
87
+
88
+ **Rule:** Tighter for headings, looser for body text
89
+
90
+ ### Standard Line Heights
91
+
92
+ | Element Type | Line Height | Ratio | Use Case |
93
+ |--------------|-------------|-------|----------|
94
+ | **Headings** | 1.2 | Tight | Visual impact, hierarchy |
95
+ | **Headings** | 1.3 | Medium | Balance (alternative) |
96
+ | **Body Text** | 1.5 | Comfortable | Readability, long-form |
97
+ | **Body Text** | 1.6 | Loose | Extra comfort (rare) |
98
+ | **Small Text** | 1.4 | Compact | Labels, captions |
99
+ | **Code** | 1.7 | Extra space | Technical content |
100
+
101
+ **Implementation:**
102
+ ```css
103
+ :root {
104
+ --leading-tight: 1.2; /* Headings */
105
+ --leading-snug: 1.3; /* Headings (alternative) */
106
+ --leading-normal: 1.5; /* Body text */
107
+ --leading-relaxed: 1.6; /* Body text (loose) */
108
+ --leading-loose: 1.7; /* Code blocks */
109
+ }
110
+
111
+ h1, h2, h3 {
112
+ line-height: var(--leading-tight);
113
+ }
114
+
115
+ p, li {
116
+ line-height: var(--leading-normal);
117
+ }
118
+
119
+ code, pre {
120
+ line-height: var(--leading-loose);
121
+ }
122
+ ```
123
+
124
+ **Why This Matters:**
125
+ - Tight line height (1.2): Headings feel "punchy" and impactful
126
+ - Normal line height (1.5): Body text is comfortable to read
127
+ - Loose line height (1.7): Code is easier to scan
128
+
129
+ ---
130
+
131
+ ## Letter Spacing (Tracking)
132
+
133
+ **Rule:** Looser for uppercase, tighter for display text
134
+
135
+ ```css
136
+ :root {
137
+ --tracking-tighter: -0.05em; /* Large headings */
138
+ --tracking-tight: -0.025em; /* H1-H3 */
139
+ --tracking-normal: 0; /* Body text */
140
+ --tracking-wide: 0.025em; /* Uppercase, small text */
141
+ --tracking-wider: 0.05em; /* ALL CAPS */
142
+ --tracking-widest: 0.1em; /* Extreme emphasis */
143
+ }
144
+
145
+ h1 {
146
+ letter-spacing: var(--tracking-tighter); /* -0.05em */
147
+ }
148
+
149
+ .label-uppercase {
150
+ text-transform: uppercase;
151
+ letter-spacing: var(--tracking-wide); /* 0.025em */
152
+ }
153
+
154
+ .all-caps {
155
+ text-transform: uppercase;
156
+ letter-spacing: var(--tracking-wider); /* 0.05em */
157
+ }
158
+ ```
159
+
160
+ **When to Use:**
161
+ - ✅ Tighter tracking: Large headings (H1, Hero)
162
+ - ✅ Wider tracking: Uppercase text, labels
163
+ - ✅ Normal tracking: Body text, paragraphs
164
+ - ❌ Avoid tight tracking on small text (hard to read)
165
+
166
+ ---
167
+
168
+ ## Font Families
169
+
170
+ ### System Font Stack (Recommended)
171
+
172
+ **Advantages:**
173
+ - ✅ No web font loading (instant render)
174
+ - ✅ Native OS appearance
175
+ - ✅ Optimal performance
176
+ - ✅ Familiar to users
177
+
178
+ **Implementation:**
179
+ ```css
180
+ :root {
181
+ /* Sans-serif (default) */
182
+ --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI",
183
+ Roboto, "Helvetica Neue", Arial, sans-serif;
184
+
185
+ /* Monospace (code) */
186
+ --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro",
187
+ Menlo, Monaco, "Courier New", monospace;
188
+
189
+ /* Serif (optional) */
190
+ --font-serif: ui-serif, Georgia, Cambria, "Times New Roman",
191
+ Times, serif;
192
+ }
193
+
194
+ body {
195
+ font-family: var(--font-sans);
196
+ }
197
+
198
+ code, pre {
199
+ font-family: var(--font-mono);
200
+ }
201
+ ```
202
+
203
+ ### Web Fonts (Optional)
204
+
205
+ **Popular Choices:**
206
+ - **Inter**: Modern, versatile, excellent readability
207
+ - **Roboto**: Clean, professional, Google's default
208
+ - **Poppins**: Geometric, friendly, modern
209
+ - **Open Sans**: Humanist, neutral, widely used
210
+ - **Lato**: Semi-rounded, approachable
211
+
212
+ **Implementation (Google Fonts):**
213
+ ```html
214
+ <!-- In <head> -->
215
+ <link rel="preconnect" href="https://fonts.googleapis.com">
216
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
217
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
218
+ ```
219
+
220
+ ```css
221
+ :root {
222
+ --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
223
+ }
224
+ ```
225
+
226
+ **⚠️ Performance Considerations:**
227
+ - Use `font-display: swap` to avoid FOIT (Flash of Invisible Text)
228
+ - Limit to 3-4 weights (e.g., 400, 500, 600, 700)
229
+ - Consider variable fonts (fewer requests)
230
+
231
+ ---
232
+
233
+ ## Typographic Hierarchy
234
+
235
+ ### Complete Heading System
236
+
237
+ ```css
238
+ h1 {
239
+ font-size: var(--text-4xl); /* 40px */
240
+ font-weight: var(--font-weight-bold); /* 700 */
241
+ line-height: var(--leading-tight); /* 1.2 */
242
+ letter-spacing: var(--tracking-tighter); /* -0.05em */
243
+ margin-bottom: var(--spacing-6); /* 24px */
244
+ }
245
+
246
+ h2 {
247
+ font-size: var(--text-3xl); /* 32px */
248
+ font-weight: var(--font-weight-bold); /* 700 */
249
+ line-height: var(--leading-tight); /* 1.2 */
250
+ letter-spacing: var(--tracking-tight); /* -0.025em */
251
+ margin-bottom: var(--spacing-4); /* 16px */
252
+ }
253
+
254
+ h3 {
255
+ font-size: var(--text-2xl); /* 24px */
256
+ font-weight: var(--font-weight-semibold); /* 600 */
257
+ line-height: var(--leading-snug); /* 1.3 */
258
+ margin-bottom: var(--spacing-4); /* 16px */
259
+ }
260
+
261
+ p {
262
+ font-size: var(--text-base); /* 16px */
263
+ font-weight: var(--font-weight-regular); /* 400 */
264
+ line-height: var(--leading-normal); /* 1.5 */
265
+ margin-bottom: var(--spacing-4); /* 16px */
266
+ }
267
+
268
+ small {
269
+ font-size: var(--text-sm); /* 14px */
270
+ font-weight: var(--font-weight-regular); /* 400 */
271
+ line-height: var(--leading-normal); /* 1.5 */
272
+ }
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Responsive Typography
278
+
279
+ ### Mobile-First Scaling
280
+
281
+ ```css
282
+ /* Mobile (default) */
283
+ h1 {
284
+ font-size: 2rem; /* 32px */
285
+ }
286
+
287
+ h2 {
288
+ font-size: 1.5rem; /* 24px */
289
+ }
290
+
291
+ /* Tablet (640px+) */
292
+ @media (min-width: 640px) {
293
+ h1 {
294
+ font-size: 2.25rem; /* 36px */
295
+ }
296
+
297
+ h2 {
298
+ font-size: 1.75rem; /* 28px */
299
+ }
300
+ }
301
+
302
+ /* Desktop (1024px+) */
303
+ @media (min-width: 1024px) {
304
+ h1 {
305
+ font-size: 2.5rem; /* 40px */
306
+ }
307
+
308
+ h2 {
309
+ font-size: 2rem; /* 32px */
310
+ }
311
+ }
312
+ ```
313
+
314
+ **Scaling Pattern:**
315
+ - Mobile: 80% of desktop size
316
+ - Tablet: 90% of desktop size
317
+ - Desktop: 100% (base size)
318
+
319
+ ---
320
+
321
+ ## Text Color & Contrast
322
+
323
+ ### Standard Text Colors
324
+
325
+ ```css
326
+ :root {
327
+ /* Light mode */
328
+ --text-primary: rgb(17, 24, 39); /* gray-900 - Headings */
329
+ --text-secondary: rgb(55, 65, 81); /* gray-700 - Body text */
330
+ --text-tertiary: rgb(107, 114, 128); /* gray-500 - Muted text */
331
+ --text-disabled: rgb(156, 163, 175); /* gray-400 - Disabled */
332
+ }
333
+
334
+ .dark {
335
+ /* Dark mode */
336
+ --text-primary: rgb(255, 255, 255); /* White - Headings */
337
+ --text-secondary: rgb(229, 231, 235); /* gray-200 - Body */
338
+ --text-tertiary: rgb(156, 163, 175); /* gray-400 - Muted */
339
+ --text-disabled: rgb(75, 85, 99); /* gray-600 - Disabled */
340
+ }
341
+ ```
342
+
343
+ **WCAG Contrast Requirements:**
344
+ | Text Size | WCAG AA | WCAG AAA |
345
+ |-----------|---------|----------|
346
+ | Normal text (<18pt) | 4.5:1 | 7:1 |
347
+ | Large text (≥18pt) | 3:1 | 4.5:1 |
348
+
349
+ ---
350
+
351
+ ## Common Patterns
352
+
353
+ ### Article/Blog Post
354
+
355
+ ```css
356
+ .prose {
357
+ max-width: 65ch; /* Optimal reading width */
358
+ font-size: var(--text-base);
359
+ line-height: var(--leading-relaxed); /* 1.6 - Extra comfort */
360
+ color: var(--text-secondary);
361
+ }
362
+
363
+ .prose h1 {
364
+ margin-top: var(--spacing-12);
365
+ margin-bottom: var(--spacing-6);
366
+ }
367
+
368
+ .prose h2 {
369
+ margin-top: var(--spacing-8);
370
+ margin-bottom: var(--spacing-4);
371
+ }
372
+
373
+ .prose p {
374
+ margin-bottom: var(--spacing-4);
375
+ }
376
+
377
+ .prose strong {
378
+ font-weight: var(--font-weight-semibold);
379
+ color: var(--text-primary);
380
+ }
381
+ ```
382
+
383
+ ### Button Text
384
+
385
+ ```css
386
+ .button {
387
+ font-size: var(--text-base); /* 16px */
388
+ font-weight: var(--font-weight-semibold); /* 600 */
389
+ line-height: 1; /* Tight for buttons */
390
+ letter-spacing: var(--tracking-normal);
391
+ }
392
+
393
+ .button-sm {
394
+ font-size: var(--text-sm); /* 14px */
395
+ font-weight: var(--font-weight-medium); /* 500 */
396
+ }
397
+ ```
398
+
399
+ ### Labels & Form Fields
400
+
401
+ ```css
402
+ .label {
403
+ font-size: var(--text-sm); /* 14px */
404
+ font-weight: var(--font-weight-medium); /* 500 */
405
+ line-height: var(--leading-normal); /* 1.5 */
406
+ color: var(--text-primary);
407
+ margin-bottom: var(--spacing-2); /* 8px */
408
+ }
409
+
410
+ .input {
411
+ font-size: var(--text-base); /* 16px - iOS zoom prevention */
412
+ font-weight: var(--font-weight-regular); /* 400 */
413
+ line-height: var(--leading-normal); /* 1.5 */
414
+ }
415
+ ```
416
+
417
+ ---
418
+
419
+ ## Best Practices
420
+
421
+ ### DO:
422
+ - ✅ Use modular scale (1.25x or 1.5x ratio)
423
+ - ✅ Limit to 3-4 font sizes for simplicity
424
+ - ✅ Use relative units (rem, em) for scalability
425
+ - ✅ Test readability on mobile devices
426
+ - ✅ Ensure 4.5:1 contrast for body text
427
+ - ✅ Use system fonts for performance
428
+ - ✅ Match line height to font size (smaller = tighter)
429
+
430
+ ### DON'T:
431
+ - ❌ Use more than 2 font families
432
+ - ❌ Use pixel units for font sizes
433
+ - ❌ Set font-size < 16px on inputs (iOS zoom)
434
+ - ❌ Use low-contrast text (fails accessibility)
435
+ - ❌ Use light font weights for body text
436
+ - ❌ Forget responsive scaling
437
+ - ❌ Use excessive letter spacing on body text
438
+
439
+ ---
440
+
441
+ ## Quick Reference
442
+
443
+ **Type Scale:**
444
+ | Element | Size | Weight | Line Height |
445
+ |---------|------|--------|-------------|
446
+ | H1 | 40px (2.5rem) | Bold (700) | 1.2 |
447
+ | H2 | 32px (2rem) | Bold (700) | 1.2 |
448
+ | H3 | 24px (1.5rem) | Semibold (600) | 1.3 |
449
+ | Body | 16px (1rem) | Regular (400) | 1.5 |
450
+ | Small | 14px (0.875rem) | Regular (400) | 1.5 |
451
+
452
+ **Font Weights:**
453
+ - Body text: 400 (Regular)
454
+ - Labels: 500 (Medium)
455
+ - Buttons: 600 (Semibold)
456
+ - Headings: 700 (Bold)
457
+
458
+ **Line Heights:**
459
+ - Headings: 1.2-1.3
460
+ - Body text: 1.5-1.6
461
+ - Small text: 1.4-1.5
462
+
463
+ ---
464
+
465
+ **💡 Remember:** Good typography is invisible. It should aid readability, not distract!