Typography, color, and readability
Create type and color tokens with clear hierarchy and sufficient contrast.
- Difficulty
- beginner
- Time
- 40 minutes
- Last verified
- 9/21/2026
What you will build
Create type and color tokens with clear hierarchy and sufficient contrast.
Understand the idea first
Rem units respect user font settings.
Build it step by step
:root {
--ink: #172033;
--muted: #526077;
--accent: #c2410c;
--surface: #ffffff;
}
body {
font-family: system-ui, sans-serif;
color: var(--ink);
line-height: 1.65;
}
p {
max-width: 68ch;
}
.meta {
color: var(--muted);
font-size: 0.875rem;
}- Create four color variables and replace repeated color literals.
- Set a system font and line height.
- Limit paragraphs to 68ch and test at 200% zoom.
- Check text, muted text, and link contrast in DevTools.
Read the important lines
- Rem units respect user font settings.
- Color must not be the only status cue.
- Links need a recognizable treatment beyond a slight color shift.
Common mistakes and what to check
| Symptom | What to check |
|---|---|
| Muted text is unreadable | Increase foreground/background contrast. |
| Text clips when zoomed | Remove fixed height and allow growth. |
Practice without copying
Create a minimal type scale for headings, body, metadata, and links; test at 200% zoom.
Check the answer after you try
No text overlaps or clips; muted text remains readable and links have a clear cue.
Completion check
- I produced the required visible result
- I can explain the input, processing, and output
- I tested normal, edge, and failure cases