Responsive Typography Patterns
What you'll learn: How to adjust your type scale, line height, and spacing across different screen sizes so text reads beautifully on both phones and desktops.
Why Typography Changes Across Devices
Imagine reading a book held at arm's length versus six inches from your face—you'd want different font sizes for comfort! The same principle applies to screens. A heading that's perfectly sized on a desktop can feel overwhelming on a phone, while body text optimized for mobile might seem tiny on a large monitor.
The Core Pattern
Responsive typography means adjusting multiple properties at different breakpoints to maintain readability and visual hierarchy. You'll typically modify:
- Type scale: Headings and body sizes shrink on smaller screens
- Line height: Tighter leading works better at large sizes; smaller text needs more breathing room
- Spacing: Margins and padding between typographic elements adapt to viewport width
Practical Application
Think of it as three connected dials you turn together:
/* Mobile-first baseline */
body {
font-size: 1rem;
line-height: 1.6;
}
h1 {
font-size: 2rem;
line-height: 1.2;
margin-bottom: 1rem;
}
/* Tablet adjustments */
@media (min-width: 768px) {
h1 {
font-size: 2.5rem;
line-height: 1.15;
margin-bottom: 1.5rem;
}
}
/* Desktop refinements */
@media (min-width: 1200px) {
h1 {
font-size: 3rem;
line-height: 1.1;
margin-bottom: 2rem;
}
}
Notice how all three properties scale together: as the heading grows, line height tightens slightly (larger text needs less space), and bottom margin increases proportionally.
Key Takeaway: Responsive typography patterns coordinate type scale, line height, and spacing adjustments across breakpoints to ensure optimal readability and hierarchy at every screen size.