@elsahafy/ux-mcp-server 2.0.0 → 4.0.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.
@@ -0,0 +1,509 @@
1
+ {
2
+ "name": "Typography System",
3
+ "description": "Comprehensive guide to creating type scales, font pairing, hierarchy, and responsive typography for web and mobile interfaces",
4
+ "fundamentals": {
5
+ "type_anatomy": {
6
+ "baseline": "Invisible line where letters sit",
7
+ "cap_height": "Height of capital letters",
8
+ "x_height": "Height of lowercase 'x'",
9
+ "ascender": "Part that extends above x-height (like 'b', 'd')",
10
+ "descender": "Part that extends below baseline (like 'g', 'y')",
11
+ "leading": "Vertical space between lines (line-height in CSS)",
12
+ "tracking": "Horizontal spacing between all characters (letter-spacing)",
13
+ "kerning": "Space between specific character pairs"
14
+ },
15
+ "font_classifications": {
16
+ "serif": {
17
+ "description": "Letters with decorative strokes (serifs)",
18
+ "characteristics": "Traditional, formal, elegant, readable in print",
19
+ "examples": ["Georgia", "Times New Roman", "Merriweather", "Playfair Display"],
20
+ "use_for": "Body text in long-form content, headings, traditional brands"
21
+ },
22
+ "sans_serif": {
23
+ "description": "Letters without decorative strokes",
24
+ "characteristics": "Modern, clean, simple, readable on screens",
25
+ "examples": ["Helvetica", "Arial", "Inter", "Roboto", "Open Sans"],
26
+ "use_for": "UI text, body copy on screen, modern brands"
27
+ },
28
+ "monospace": {
29
+ "description": "Fixed-width characters",
30
+ "characteristics": "Each character same width, technical feel",
31
+ "examples": ["Courier", "Monaco", "Fira Code", "Source Code Pro"],
32
+ "use_for": "Code, technical content, tabular data"
33
+ },
34
+ "display": {
35
+ "description": "Decorative fonts for large sizes",
36
+ "characteristics": "Unique, expressive, attention-grabbing",
37
+ "examples": ["Bebas Neue", "Abril Fatface", "Lobster"],
38
+ "use_for": "Large headings only, short text, branding"
39
+ },
40
+ "handwriting": {
41
+ "description": "Script or cursive fonts",
42
+ "characteristics": "Personal, elegant, or casual",
43
+ "examples": ["Dancing Script", "Pacifico", "Kalam"],
44
+ "use_for": "Accents, quotes, signatures (sparingly)"
45
+ }
46
+ }
47
+ },
48
+ "type_scale": {
49
+ "description": "Systematic progression of font sizes",
50
+ "ratios": {
51
+ "minor_second": {
52
+ "ratio": 1.067,
53
+ "feel": "Subtle, gentle",
54
+ "use": "Small interfaces, dense layouts"
55
+ },
56
+ "major_second": {
57
+ "ratio": 1.125,
58
+ "feel": "Conservative, readable",
59
+ "use": "Body-heavy sites, documentation"
60
+ },
61
+ "minor_third": {
62
+ "ratio": 1.2,
63
+ "feel": "Balanced, versatile",
64
+ "use": "General purpose, most common"
65
+ },
66
+ "major_third": {
67
+ "ratio": 1.25,
68
+ "feel": "Clear hierarchy",
69
+ "use": "Marketing sites, blogs"
70
+ },
71
+ "perfect_fourth": {
72
+ "ratio": 1.333,
73
+ "feel": "Strong contrast",
74
+ "use": "Editorial, content-focused"
75
+ },
76
+ "augmented_fourth": {
77
+ "ratio": 1.414,
78
+ "feel": "Dramatic",
79
+ "use": "High contrast needed"
80
+ },
81
+ "perfect_fifth": {
82
+ "ratio": 1.5,
83
+ "feel": "Very dramatic",
84
+ "use": "Large screens, hero sections"
85
+ },
86
+ "golden_ratio": {
87
+ "ratio": 1.618,
88
+ "feel": "Classic, harmonious",
89
+ "use": "Large displays, special projects"
90
+ }
91
+ },
92
+ "recommended_ratio": "1.2 (minor third) for general use",
93
+ "example_scale": {
94
+ "base": "16px (1rem)",
95
+ "ratio": 1.2,
96
+ "sizes": {
97
+ "xs": "0.694rem (11.1px)",
98
+ "sm": "0.833rem (13.3px)",
99
+ "base": "1rem (16px)",
100
+ "lg": "1.2rem (19.2px)",
101
+ "xl": "1.44rem (23px)",
102
+ "2xl": "1.728rem (27.6px)",
103
+ "3xl": "2.074rem (33.2px)",
104
+ "4xl": "2.488rem (39.8px)",
105
+ "5xl": "2.986rem (47.8px)"
106
+ }
107
+ },
108
+ "calculating_scale": {
109
+ "formula": "size = base × ratio^n",
110
+ "example": "16px × 1.2^2 = 23.04px",
111
+ "tools": [
112
+ "https://typescale.com",
113
+ "https://www.modularscale.com"
114
+ ]
115
+ }
116
+ },
117
+ "hierarchy": {
118
+ "levels": {
119
+ "h1": {
120
+ "purpose": "Page title, main heading",
121
+ "size": "2.5-3.5rem (40-56px)",
122
+ "weight": "700-900 (Bold/Black)",
123
+ "usage": "One per page",
124
+ "line_height": "1.1-1.2"
125
+ },
126
+ "h2": {
127
+ "purpose": "Section headers",
128
+ "size": "2-2.5rem (32-40px)",
129
+ "weight": "600-700 (SemiBold/Bold)",
130
+ "usage": "Multiple per page",
131
+ "line_height": "1.2-1.3"
132
+ },
133
+ "h3": {
134
+ "purpose": "Subsection headers",
135
+ "size": "1.5-2rem (24-32px)",
136
+ "weight": "600-700",
137
+ "line_height": "1.3-1.4"
138
+ },
139
+ "h4": {
140
+ "purpose": "Minor headings",
141
+ "size": "1.25-1.5rem (20-24px)",
142
+ "weight": "600",
143
+ "line_height": "1.4"
144
+ },
145
+ "h5_h6": {
146
+ "purpose": "Smallest headings",
147
+ "size": "1-1.25rem (16-20px)",
148
+ "weight": "600",
149
+ "usage": "Rare, use sparingly"
150
+ },
151
+ "body": {
152
+ "purpose": "Main text content",
153
+ "size": "1rem (16px) - never smaller",
154
+ "weight": "400 (Regular)",
155
+ "line_height": "1.5-1.7",
156
+ "max_width": "60-75 characters per line"
157
+ },
158
+ "small": {
159
+ "purpose": "Secondary text, captions",
160
+ "size": "0.875rem (14px)",
161
+ "weight": "400",
162
+ "usage": "Captions, disclaimers, metadata"
163
+ },
164
+ "tiny": {
165
+ "purpose": "Legal text, footnotes",
166
+ "size": "0.75rem (12px)",
167
+ "weight": "400",
168
+ "min_size": "Don't go below 12px for accessibility"
169
+ }
170
+ },
171
+ "contrast_techniques": {
172
+ "size": "Large vs small text",
173
+ "weight": "Bold vs regular",
174
+ "color": "Dark vs light (maintain 4.5:1 contrast)",
175
+ "case": "UPPERCASE vs Sentence case (use sparingly)",
176
+ "spacing": "Tight vs loose letter-spacing",
177
+ "style": "Different font families for contrast"
178
+ }
179
+ },
180
+ "font_pairing": {
181
+ "principles": {
182
+ "contrast": "Pair fonts with clear differences",
183
+ "harmony": "Should work together, not clash",
184
+ "purpose": "Each font should have clear role"
185
+ },
186
+ "safe_combinations": {
187
+ "serif_sans": {
188
+ "description": "Most common and safe",
189
+ "pattern": "Serif for headings, sans-serif for body (or vice versa)",
190
+ "examples": [
191
+ "Playfair Display + Open Sans",
192
+ "Merriweather + Lato",
193
+ "Georgia + Helvetica",
194
+ "Spectral + Karla"
195
+ ]
196
+ },
197
+ "sans_sans": {
198
+ "description": "Modern, clean look",
199
+ "pattern": "Geometric for headings, humanist for body",
200
+ "examples": [
201
+ "Montserrat + Open Sans",
202
+ "Poppins + Inter",
203
+ "Raleway + Roboto"
204
+ ],
205
+ "tip": "Ensure enough contrast in weight/width"
206
+ },
207
+ "serif_serif": {
208
+ "description": "Traditional, elegant",
209
+ "pattern": "Display serif for headings, text serif for body",
210
+ "examples": [
211
+ "Playfair Display + Crimson Text",
212
+ "Abril Fatface + Lora"
213
+ ],
214
+ "tip": "Use different styles (old-style vs modern)"
215
+ },
216
+ "monospace_accent": {
217
+ "description": "Technical or modern edge",
218
+ "pattern": "Monospace for code/accents, sans-serif for main text",
219
+ "examples": [
220
+ "Fira Code + Fira Sans",
221
+ "Source Code Pro + Source Sans Pro"
222
+ ]
223
+ }
224
+ },
225
+ "superfamilies": {
226
+ "description": "Font families with multiple styles (serif, sans, mono)",
227
+ "benefits": "Guaranteed harmony, maintained proportions",
228
+ "examples": [
229
+ "IBM Plex (Sans, Serif, Mono)",
230
+ "Source (Sans Pro, Serif Pro, Code Pro)",
231
+ "Alegreya (Regular, Sans)",
232
+ "Roboto (Regular, Slab, Mono)"
233
+ ]
234
+ },
235
+ "rules": {
236
+ "limit_fonts": "2-3 font families maximum",
237
+ "test_together": "Always preview pairings together",
238
+ "check_weights": "Ensure both fonts have needed weights",
239
+ "consider_x_height": "Similar x-heights work better together",
240
+ "avoid_similar": "Don't pair fonts that are too similar"
241
+ }
242
+ },
243
+ "readability": {
244
+ "line_length": {
245
+ "optimal": "45-75 characters per line",
246
+ "ideal": "60-66 characters",
247
+ "css": "max-width: 65ch; (ch = character width)",
248
+ "mobile": "Shorter OK (35-50 characters)",
249
+ "avoid": "Very long lines (>85 characters) cause eye fatigue"
250
+ },
251
+ "line_height": {
252
+ "body_text": "1.5-1.7 (150-170%)",
253
+ "headings": "1.1-1.3 (tighter for large text)",
254
+ "ui_elements": "1.3-1.5",
255
+ "formula": "Smaller text needs more line-height",
256
+ "css": "line-height: 1.6; (unitless preferred)"
257
+ },
258
+ "letter_spacing": {
259
+ "body_text": "0 (default) to slight positive",
260
+ "all_caps": "+0.05em to +0.1em (always increase)",
261
+ "headings": "Slight negative (-0.01em to -0.03em) for large text",
262
+ "small_text": "Slight positive (+0.01em to +0.02em)",
263
+ "css": "letter-spacing: 0.05em;"
264
+ },
265
+ "paragraph_spacing": {
266
+ "between_paragraphs": "1em (equal to font size)",
267
+ "alternative": "Text indent for first line (1.5em)",
268
+ "avoid": "Both indent and spacing (choose one)"
269
+ },
270
+ "text_alignment": {
271
+ "left": "Default, best for readability",
272
+ "right": "Rarely for UI (RTL languages)",
273
+ "center": "Short text only (headings, CTAs)",
274
+ "justify": "Avoid for web (creates rivers, poor on small screens)"
275
+ },
276
+ "font_size": {
277
+ "minimum": "16px for body text (mobile and desktop)",
278
+ "mobile": "Never below 16px (prevents zoom on iOS)",
279
+ "optimal_body": "16-18px",
280
+ "large_screens": "18-21px for comfortable reading",
281
+ "accessibility": "Allow users to increase text size"
282
+ }
283
+ },
284
+ "responsive_typography": {
285
+ "fluid_typography": {
286
+ "description": "Font size scales smoothly between breakpoints",
287
+ "css_clamp": "font-size: clamp(1rem, 2.5vw, 2rem);",
288
+ "explanation": "clamp(minimum, preferred, maximum)",
289
+ "example": {
290
+ "h1": "font-size: clamp(2rem, 5vw, 4rem);",
291
+ "body": "font-size: clamp(1rem, 1.5vw, 1.125rem);"
292
+ },
293
+ "tools": ["https://utopia.fyi", "https://fluid-type-scale.com"]
294
+ },
295
+ "breakpoint_scales": {
296
+ "mobile": {
297
+ "breakpoint": "< 640px",
298
+ "base_size": "16px",
299
+ "scale_ratio": "1.125-1.2",
300
+ "considerations": ["Smaller screens", "Thumb reach", "Scrolling"]
301
+ },
302
+ "tablet": {
303
+ "breakpoint": "640px - 1024px",
304
+ "base_size": "16px",
305
+ "scale_ratio": "1.2-1.25"
306
+ },
307
+ "desktop": {
308
+ "breakpoint": "> 1024px",
309
+ "base_size": "18px",
310
+ "scale_ratio": "1.25-1.333",
311
+ "considerations": ["Viewing distance", "Screen size", "Content density"]
312
+ }
313
+ },
314
+ "mobile_first": {
315
+ "approach": "Design type for mobile, enhance for larger screens",
316
+ "css_example": ".heading {\n font-size: 1.5rem; /* mobile */\n}\n\n@media (min-width: 768px) {\n .heading {\n font-size: 2.5rem; /* desktop */\n }\n}"
317
+ }
318
+ },
319
+ "web_fonts": {
320
+ "formats": {
321
+ "woff2": "Modern, best compression (use this)",
322
+ "woff": "Fallback for older browsers",
323
+ "ttf_otf": "Avoid for web (larger files)"
324
+ },
325
+ "loading_strategies": {
326
+ "font_display": {
327
+ "auto": "Browser default",
328
+ "swap": "Show fallback, swap when loaded (recommended)",
329
+ "block": "Invisible text for ~3s (FOIT - Flash of Invisible Text)",
330
+ "fallback": "Show fallback after 100ms",
331
+ "optional": "Only use font if cached"
332
+ },
333
+ "recommended": "font-display: swap;",
334
+ "css": "@font-face {\n font-family: 'MyFont';\n src: url('font.woff2') format('woff2');\n font-display: swap;\n}"
335
+ },
336
+ "preloading": {
337
+ "critical_fonts": "Preload fonts used above fold",
338
+ "html": "<link rel='preload' href='font.woff2' as='font' type='font/woff2' crossorigin>",
339
+ "limit": "Only preload 1-2 most critical fonts"
340
+ },
341
+ "self_hosting": {
342
+ "pros": ["Better performance", "Privacy", "Reliability"],
343
+ "cons": ["Manual updates", "Setup required"],
344
+ "tools": ["https://google-webfonts-helper.herokuapp.com"]
345
+ },
346
+ "google_fonts": {
347
+ "pros": ["Easy setup", "Free", "Regularly updated"],
348
+ "cons": ["External dependency", "Privacy concerns (GDPR)"],
349
+ "optimize": "Only include weights you need",
350
+ "example": "<link href='https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap' rel='stylesheet'>"
351
+ },
352
+ "font_subsetting": {
353
+ "description": "Include only characters you need",
354
+ "benefits": "Smaller file size, faster loading",
355
+ "example": "Latin only vs Latin + Cyrillic + Greek",
356
+ "tools": ["Glyphhanger", "Font Squirrel"]
357
+ },
358
+ "variable_fonts": {
359
+ "description": "Single file with multiple weights/styles",
360
+ "benefits": ["One file vs many", "Smooth animations", "Smaller total size"],
361
+ "examples": ["Inter Variable", "Recursive", "Source Sans Variable"],
362
+ "css": "font-variation-settings: 'wght' 650;"
363
+ }
364
+ },
365
+ "accessibility": {
366
+ "contrast": {
367
+ "wcag_aa": "4.5:1 for normal text, 3:1 for large text (18px+)",
368
+ "wcag_aaa": "7:1 for normal text, 4.5:1 for large text",
369
+ "large_text": "18px+ or 14px+ bold",
370
+ "tool": "Use contrast checker tools"
371
+ },
372
+ "font_size": {
373
+ "minimum": "16px for body text",
374
+ "allow_scaling": "Use rem, not px (respects user preferences)",
375
+ "zoom": "Support 200% zoom without breaking layout"
376
+ },
377
+ "font_choice": {
378
+ "avoid": "Overly decorative fonts for body text",
379
+ "prefer": "Simple, clear, distinguishable characters",
380
+ "dyslexia": "Consider dyslexia-friendly fonts (OpenDyslexic, Comic Sans alternative)"
381
+ },
382
+ "all_caps": {
383
+ "avoid": "Hard to read, especially for dyslexic users",
384
+ "limit": "Short text only (buttons, labels)",
385
+ "never": "Don't use for paragraphs or long headings"
386
+ },
387
+ "text_images": {
388
+ "avoid": "Don't put text in images (not scalable, not translatable)",
389
+ "use_html": "Real text is always better",
390
+ "exception": "Logos (but provide alt text)"
391
+ }
392
+ },
393
+ "css_implementation": {
394
+ "font_family_stack": {
395
+ "pattern": "Primary, fallback, generic",
396
+ "example": "font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;",
397
+ "system_fonts": {
398
+ "apple": "-apple-system, BlinkMacSystemFont",
399
+ "windows": "'Segoe UI'",
400
+ "android": "Roboto",
401
+ "linux": "Ubuntu, Cantarell",
402
+ "generic": "sans-serif, serif, monospace"
403
+ },
404
+ "system_font_stack": "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;"
405
+ },
406
+ "css_custom_properties": {
407
+ "approach": "Define type scale as CSS variables",
408
+ "example": ":root {\n --font-size-xs: 0.75rem;\n --font-size-sm: 0.875rem;\n --font-size-base: 1rem;\n --font-size-lg: 1.125rem;\n --font-size-xl: 1.25rem;\n \n --font-weight-normal: 400;\n --font-weight-medium: 500;\n --font-weight-bold: 700;\n \n --line-height-tight: 1.25;\n --line-height-normal: 1.5;\n --line-height-relaxed: 1.75;\n}",
409
+ "usage": "font-size: var(--font-size-lg);"
410
+ },
411
+ "utility_classes": {
412
+ "example": ".text-xs { font-size: 0.75rem; }\n.text-sm { font-size: 0.875rem; }\n.text-base { font-size: 1rem; }\n.text-lg { font-size: 1.125rem; }\n\n.font-normal { font-weight: 400; }\n.font-bold { font-weight: 700; }",
413
+ "frameworks": "Tailwind CSS has built-in type scale utilities"
414
+ }
415
+ },
416
+ "common_patterns": {
417
+ "hero_heading": {
418
+ "size": "4-6rem (64-96px) on desktop",
419
+ "weight": "700-900",
420
+ "line_height": "1-1.1",
421
+ "considerations": ["Large and bold", "Short text only", "Reduce size significantly on mobile"]
422
+ },
423
+ "article_body": {
424
+ "font": "Serif or humanist sans-serif",
425
+ "size": "18-21px",
426
+ "line_height": "1.6-1.7",
427
+ "line_length": "60-70 characters",
428
+ "paragraph_spacing": "1.5em"
429
+ },
430
+ "ui_text": {
431
+ "font": "Sans-serif",
432
+ "size": "14-16px",
433
+ "line_height": "1.4-1.5",
434
+ "weight": "400-600"
435
+ },
436
+ "button_text": {
437
+ "size": "14-16px",
438
+ "weight": "500-600",
439
+ "letter_spacing": "+0.01em to +0.02em",
440
+ "case": "Sentence case preferred"
441
+ },
442
+ "labels": {
443
+ "size": "12-14px",
444
+ "weight": "500-600",
445
+ "case": "Sentence case",
446
+ "color": "Slightly muted (70-80% opacity)"
447
+ }
448
+ },
449
+ "testing": {
450
+ "checklist": [
451
+ "Test on actual devices (not just browser resize)",
452
+ "Check readability at arm's length",
453
+ "Test with different user font size preferences",
454
+ "Verify contrast ratios",
455
+ "Test with screen readers",
456
+ "Check at 200% zoom",
457
+ "Test with long text (German, Finnish)",
458
+ "Verify line length isn't too long",
459
+ "Check text doesn't overflow containers",
460
+ "Test on different browsers"
461
+ ],
462
+ "tools": [
463
+ "Contrast checker: WebAIM Contrast Checker",
464
+ "Type scale: typescale.com",
465
+ "Font pairing: fontpair.co",
466
+ "Web font analyzer: wakamaifondue.com",
467
+ "Readability: Hemingway Editor"
468
+ ]
469
+ },
470
+ "best_practices": [
471
+ "Start with 16px base font size (never smaller)",
472
+ "Use modular scale for consistent sizes",
473
+ "Limit to 2-3 font families maximum",
474
+ "Choose fonts with multiple weights (400, 600, 700 minimum)",
475
+ "Prefer web-safe or Google Fonts for reliability",
476
+ "Use rem units for font sizes (respects user preferences)",
477
+ "Maintain 4.5:1 contrast ratio minimum",
478
+ "Keep line length 45-75 characters",
479
+ "Use 1.5-1.7 line-height for body text",
480
+ "Increase letter-spacing for ALL CAPS",
481
+ "Test typography on real devices",
482
+ "Left-align body text (don't justify)",
483
+ "Use system fonts for performance",
484
+ "Preload critical fonts only",
485
+ "Include font-display: swap",
486
+ "Create visual hierarchy with size, weight, and color",
487
+ "Don't use more than 3-4 font sizes for body content",
488
+ "Make headings significantly larger than body",
489
+ "Use font weights consistently (don't mix randomly)",
490
+ "Test with long and short text"
491
+ ],
492
+ "anti_patterns": [
493
+ "Body text smaller than 16px",
494
+ "Too many different font families (> 3)",
495
+ "Overuse of decorative fonts",
496
+ "ALL CAPS for long text",
497
+ "Justified text on web",
498
+ "Insufficient line-height (< 1.4)",
499
+ "Too long line lengths (> 85 characters)",
500
+ "Poor contrast",
501
+ "Text in images",
502
+ "Not loading fallback fonts",
503
+ "Using px units for all font sizes",
504
+ "Skipping font preloading",
505
+ "Loading unnecessary font weights",
506
+ "Not testing on mobile devices",
507
+ "Mixing too many font weights"
508
+ ]
509
+ }