Readable typography for the web: 7 practical rules
Line length, line height, contrast and hierarchy: the basics of text that is pleasant to read on any screen.
Content is king, but typography is its throne. Here are seven rules I apply in every project.
- Line length between 60 and 75 characters.
- Line height between 1.5 and 1.7 for body text.
- Contrast of at least 4.5:1 (WCAG AA).
- Base font size of at least 16px.
- Clear hierarchy between headings and paragraphs.
- Generous spacing between sections.
- Few fonts: one or two at most.
The typography plugin
With just the prose class, the @tailwindcss/typography plugin applies carefully tuned typographic settings, and dark:prose-invert adapts them to the dark theme.
Good design goes unnoticed: you only notice it when it's missing.