Article Title
Lead paragraph that summarizes the article content and draws the reader in.
Regular paragraph text with optimal line height for reading...
Section Heading
More content follows with consistent spacing...
import { Meta, Typeset } from 'storybook/blocks'; # Typography System Typography creates hierarchy, improves readability, and establishes visual rhythm throughout the interface. ## Typography Principles 1. **Readability First**: Optimize for long-form reading and scanning 2. **Clear Hierarchy**: Use size and weight to establish importance 3. **Consistent Scale**: Follow modular scale for harmonic sizing 4. **Responsive**: Adjust sizes for different screen sizes ## Font Families ### Primary: Inter Inter is our primary font for all UI text. It's designed for screens with excellent legibility at small sizes. ```css font-family: 'Inter', system-ui, sans-serif; ``` **Use for:** - Body text - UI elements (buttons, labels, inputs) - Headings (when simplicity is preferred) ### Display: Playfair Display Playfair Display adds elegance for large display text and special emphasis. ```css font-family: 'Playfair Display', Georgia, serif; ``` **Use for:** - Hero headlines - Marketing content - Special callouts - Spiritual/philosophical contexts ### Mono: JetBrains Mono JetBrains Mono is used for code, technical content, and fixed-width displays. ```css font-family: 'JetBrains Mono', 'Fira Code', monospace; ``` **Use for:** - Code blocks - Technical identifiers - Timestamps - Version numbers ## Type Scale Our type scale follows a modular progression for consistent hierarchy. | Token | Size | Line Height | Use | |-------|------|-------------|-----| | `xs` | 12px | 16px | Captions, labels | | `sm` | 14px | 20px | Secondary text, meta | | `base` | 16px | 24px | Body text | | `lg` | 18px | 28px | Lead paragraphs | | `xl` | 20px | 28px | H5 | | `2xl` | 24px | 32px | H4 | | `3xl` | 30px | 36px | H3 | | `4xl` | 36px | 40px | H2 | | `5xl` | 48px | 48px | H1 | | `6xl` | 60px | 60px | Display | | `7xl` | 72px | 72px | Hero | | `8xl` | 96px | 96px | Jumbo | | `9xl` | 128px | 128px | Maximum | ## Font Weights | Token | Weight | Use | |-------|--------|-----| | `thin` | 100 | Decorative only | | `light` | 300 | Large display text | | `normal` | 400 | Body text | | `medium` | 500 | Emphasis, labels | | `semibold` | 600 | Subheadings, buttons | | `bold` | 700 | Headings, strong emphasis | | `extrabold` | 800 | Hero text | | `black` | 900 | Maximum impact | ## Heading Styles ### H1 - Page Title ```tsx
Lead paragraph introduces the section with larger, slightly muted text.
``` ### Body Standard body text for content. ```tsxBody text is optimized for reading with appropriate line height and contrast for extended passages.
``` ### Small Secondary information and meta content. ```tsxSmall text for secondary information like timestamps and metadata.
``` ### Caption Minimal size for labels and captions. ```tsx Caption or label text ``` ## Line Heights | Token | Value | Use | |-------|-------|-----| | `none` | 1 | Single line text only | | `tight` | 1.25 | Headings | | `snug` | 1.375 | Compact layouts | | `normal` | 1.5 | Body text | | `relaxed` | 1.625 | Long-form reading | | `loose` | 2 | Maximum readability | ## Letter Spacing | Token | Value | Use | |-------|-------|-----| | `tighter` | -0.05em | Large display text | | `tight` | -0.025em | Headings | | `normal` | 0 | Body text | | `wide` | 0.025em | Small caps, labels | | `wider` | 0.05em | All caps | | `widest` | 0.1em | Decorative uppercase | ## Practical Examples ### Article Layout ```tsxLead paragraph that summarizes the article content and draws the reader in.
Regular paragraph text with optimal line height for reading...
More content follows with consistent spacing...
Body text that grows on larger screens
``` ## Typography Tokens in Code ```tsx import { fontSizes, fontWeights, lineHeights } from '@/design-system/tokens'; // Access typography values console.log(fontSizes['2xl']); // '1.5rem' console.log(fontWeights.semibold); // 600 console.log(lineHeights.normal); // 1.5 ``` ## Best Practices ### Do - Use semantic HTML elements (h1-h6, p, etc.) - Maintain consistent heading hierarchy (don't skip levels) - Use appropriate line height for content type - Test readability on actual devices - Apply negative letter-spacing to large headings ### Don't - Use more than 2-3 font sizes on a single view - Mix font families without purpose - Use thin weights for small body text - Create text lines longer than 75 characters - Justify text (use left alignment) ## Accessibility - Minimum body text size: 16px - Minimum line height for body: 1.5 - Color contrast: 4.5:1 for normal text, 3:1 for large text - Allow users to resize text up to 200% - Don't use font size as the only indicator of hierarchy