Sub topic 6
Contrast: make differences obvious
This chapter assumes you know basic typography vocabulary (typeface, size, weight, line spacing) and have used a layout tool such as Figma or Canva. It also assumes you have read the earlier chapters on visual hierarchy and proximity.
What contrast does
Contrast is a clear, deliberate difference between two elements. If two things differ, make them differ a lot. If they are the same, make them identical.
Contrast does two jobs:
- It tells the reader which element matters most, so it builds visual hierarchy.
- It adds interest, so the page does not look like a wall of similar text.
The most common error is timid contrast. A heading at 18px next to body text at 16px, or two similar typefaces side by side, looks like a mistake rather than a choice. The reader cannot tell whether the difference means anything.
Tools for creating contrast
You can create contrast with several properties. The strongest layouts usually change two or three of them at once.
| Property | Weak contrast | Strong contrast |
|---|---|---|
| Size | 16px and 18px | 16px and 24px or more |
| Weight | Regular and medium | Regular and bold |
| Color | Dark gray and black | Dark text and a saturated accent |
| Typeface | Two similar sans-serif faces | A serif heading with a sans-serif body |
| Space | 12px and 16px gaps | 8px and 32px gaps |
| Case | Sentence case and Title Case | Sentence case and uppercase labels |
Size and weight
Size and weight are the fastest tools. In the card example from the proximity chapter, the heading is 1.5rem at weight 700, while the body is 1rem at weight 400. That gap is large enough that nobody has to guess which line is the title.
.card h2 {
margin: 0;
font-size: 1.5rem;
font-weight: 700;
}
.card p {
margin: 0;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
}Color
Color draws the eye to one spot. Use a single accent color for the element you most want clicked or read, such as a primary button. If five items are bright, none of them stands out.
Typeface
Pair typefaces only when the difference is obvious. A serif with a sans-serif works well. Two sans-serif faces that are almost alike do not. When in doubt, use one family and create contrast with size and weight instead.
A diagram of the decision
Contrast must stay readable
Contrast serves reading. Light gray text on a white background has a lot of style and very little legibility. The Web Content Accessibility Guidelines (WCAG) set minimum color contrast ratios:
- 4.5:1 for normal body text.
- 3:1 for large text (about 24px regular or 19px bold) and for interface components such as button borders.
Check your pairs with a contrast checker, which is built into the browser developer tools and into many Figma plugins. Do not rely on your own eyes, because screens and lighting vary.
:root {
--color-text: #1a1a1a;
--color-accent: #0b5fff;
}
.button {
background: var(--color-accent);
color: #ffffff;
}White on #0b5fff passes the 4.5:1 ratio for body text, and #1a1a1a on white passes by a wide margin.
Common errors
- Too many contrasts. If every line has a different size, weight, and color, the page has no hierarchy. Pick one clear top level and let the rest stay quiet.
- Contrast by color alone. Some readers cannot tell certain colors apart. Add a size, weight, or shape difference as well.
- Low-contrast text. Gray-on-gray looks refined in a mockup and fails in real use.
- Near-matches. Two sizes or two grays that are almost the same read as a mistake.
Try it
Exercise
A page has a title at 20px regular and body text at 16px regular, both in dark gray. Name two properties you could change to give the title stronger contrast, and say what values you would pick.
Show answer
Increase the size and the weight. For example, set the title to 32px (about 2x the body size) and bold (700), keeping the body at 16px and 400. You could also change the title color to black or an accent color, as long as it keeps a contrast ratio of at least 4.5:1 against the background (3:1 is enough for large text).
Exercise
A designer makes a button label light gray (#b0b0b0) on a white background because it looks elegant. What is the problem, and how would you fix it?
Show answer
The color contrast ratio is far below the WCAG minimum (about 2:1 against the 4.5:1 needed for normal text), so many readers will struggle to see it. Darken the text, for example to #1a1a1a, or put white text on a dark or saturated button background, and confirm the ratio with a contrast checker.