Sub topic 6
Contrast: Make Differences Obvious
What this chapter assumes
You should know basic typography vocabulary (typeface, size, weight, line spacing). You should also be able to place headings, body text, images, and buttons in a tool such as Figma, Canva, or InDesign, or in CSS. The CSS examples need only basic selectors and properties.
What contrast does
Contrast is the difference between two elements, made large enough that a reader sees it at once. It does two jobs:
- It sets the order of reading. The reader's eye goes to the most different element first. That element is your entry point.
- It labels the role of each element. A large bold line reads as a title. A small gray line reads as a caption. The reader doesn't have to think about it.
Contrast is the main tool for building visual hierarchy. Proximity groups items, and contrast ranks them.
The core rule: be clearly different or be the same
If two elements are meant to differ, make them differ by a lot. If they are meant to match, make them match exactly. The weak case is a small difference, such as 16px next to 18px text, or two similar dark grays. A small difference looks like a mistake. The reader can't tell whether you meant it, so it creates tension without giving any information.
A rough check: if you have to look carefully to see the difference, it isn't contrast yet.
The tools of contrast
You can create contrast along several axes. Most strong layouts use two or three at once.
| Axis | Weak (timid) | Strong |
|---|---|---|
| Size | 16px vs 18px | 16px vs 32px or more |
| Weight | Regular vs medium | Regular (400) vs bold (700) or heavier |
| Color and value | Dark gray vs slightly darker gray | Near-black text vs a saturated accent on a pale background |
| Typeface | Two similar sans-serif faces | A serif heading with a sans-serif body |
| Space | Equal gaps everywhere | Tight groups inside wide empty areas |
| Shape and form | Two rectangles of similar proportions | A tall narrow image against a wide text block |
Size
Size is the most reliable axis. Large elements get read first. Keep the steps between sizes consistent by using a type scale, where each level is the previous one multiplied by a fixed ratio. A ratio of about 1.25 (major third) gives subtle steps. A ratio of 1.5 or higher gives dramatic ones. For body text at 16px, a ratio of 1.5 gives 24px, 36px, and 54px.
Don't use many steps. Three or four sizes in one layout is usually enough. Each extra size dilutes the hierarchy.
Weight
Weight adds contrast without changing the size, which helps when space is tight, as in a table row or a form label. Use weights that are at least 300 units apart in the numeric scale (for example 400 and 700). A 400 beside a 500 is a timid difference in most typefaces.
Be careful with very thin weights (100 to 200) at small sizes. They lose contrast against the background and also against the surrounding heavier text, so they read as faint rather than quiet.
Color and value
Color contrast has two parts. Hue is the color family (red, blue). Value is how light or dark a color is. Value does most of the work. Convert your layout to grayscale: if the hierarchy disappears, you relied on hue alone. A red heading and a green button can look identical in grayscale.
Value contrast is also what makes text legible. The next chapters cover measured color contrast ratios for accessibility. For now, remember that contrast between text and its background is a requirement, not a style choice.
Typeface
Combine typefaces by contrasting them. The common approach is a serif with a sans-serif, or a display face with a plain text face. Two faces that are almost alike, such as two geometric sans-serifs, give you the clutter of a second font with no gain.
Limit yourself to two families per layout. If you need more variety, get it from size, weight, and style (italic, uppercase) within those families.
A worked example in CSS
This card uses contrast on three axes. The title differs from the body in size and weight. The label differs in size, case, and color. The body stays plain, so it becomes the quiet baseline.
:root {
--color-text: #1a1a1a;
--color-muted: #5a5a5a;
--color-accent: #0b5fff;
}
body {
font-family: system-ui, sans-serif;
color: var(--color-text);
background: #ffffff;
}
.card {
display: grid;
gap: 8px;
padding: 24px;
max-width: 40ch;
}
.card .label {
margin: 0;
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--color-accent);
}
.card h2 {
margin: 0;
font-size: 2rem;
font-weight: 800;
line-height: 1.15;
}
.card p {
margin: 0;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: var(--color-muted);
}The title is twice the body size (2rem against 1rem) and much heavier (800 against 400). Those are decisive differences. The label is small but visible because it is colored and uppercase. If you changed the title to 1.125rem and weight 500, the card would still be valid CSS, but the reader would lose the entry point.
One dominant element per view
Contrast ranks elements, so ranking needs a winner. Pick one element to dominate each view: a headline on a flyer, a price on a product card, the main action on a form. Then give the other elements decreasing emphasis.
A frequent error is to emphasize everything. If the headline, subhead, three bullets, and the button are all bold and colored, nothing stands out. Emphasis only works against a quiet background. A good habit is to decide what the second and third most important elements are, and then make them clearly weaker than the first.
The same logic applies to buttons. Give the primary action a filled background and the secondary action an outline or plain text.
.button {
font: inherit;
font-weight: 600;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
}
.button-primary {
background: #0b5fff;
color: #ffffff;
border: 2px solid #0b5fff;
}
.button-secondary {
background: transparent;
color: #0b5fff;
border: 2px solid #0b5fff;
}Both buttons share shape, size, and typography, so they read as the same family. They differ in fill, so the reader sees which one to press.
Choosing which axis to use
The diagram shows a simple way to decide.
Testing contrast
Two quick checks catch most problems.
- The squint test. Blur your eyes or view the layout at thumbnail size. The elements that remain visible are your hierarchy. If the wrong element survives, or nothing does, adjust.
- The grayscale test. Desaturate the design. Any distinction that vanished depended on hue alone. Around 1 in 12 men has some form of color vision deficiency, so a hue-only difference fails for a real share of readers.
Edge cases and gotchas
- Emphasis inside body text. Bold, italic, and color all work for a few words. Use one at a time. Bold plus italic plus color on the same phrase adds noise, not emphasis. If more than about one phrase per paragraph is emphasized, the emphasis stops working.
- Uppercase. All-caps text creates contrast through shape, but long runs of capitals are slower to read. Use it for short labels, and add letter spacing as in the card example.
- Contrast against the background. Large, bold type tolerates lower background contrast than small, light type. Never trade away legibility for style. Light gray text on white is the most common failure.
- Images. Text over a photo needs an overlay or a solid area behind it. The photo's brightness varies, so the contrast varies from one part of the image to another.
- Dark mode. Pure white text on pure black can glare. Many designs use off-white on a very dark gray. The difference is still large, but less harsh. Check the hierarchy again after switching modes, because a color that stood out on white may fade on dark.
- Contrast fighting other principles. A big contrast can break grouping if you aren't careful. A very large heading placed equidistant between two blocks may look attached to neither. Proximity still decides which block it belongs to.
Summary of decisions
- Make differences large, or make things identical.
- Use size first, then add weight, value, or typeface.
- Choose one dominant element and rank the rest below it.
- Keep to about two typefaces and three or four sizes.
- Verify with the squint and grayscale tests.
Exercise
A pricing card has a title at 18px weight 500, a price at 20px weight 500, and a description at 16px weight 400, all in the same dark gray. Users report that they can't find the price quickly. Name the problem and propose two specific changes that fix it.
Show answer
The differences are timid (18px, 20px and 16px are close, and weights 400 and 500 are close, and every item has the same color), so no element dominates. Because the price is the key item, make it the largest and heaviest element, for example 40px at weight 800. Also quiet the other elements: set the description in a lighter gray such as #5a5a5a and the title at about 20px weight 600. The price now has a clear entry point, and the other elements rank below it.
Exercise
You convert a design to grayscale and the "Delete" and "Save" buttons look identical, because one is red and one is green with the same lightness. Which axis did the design rely on, and how can you fix it without removing the colors?
Show answer
The design relied on hue alone. Add a difference in value or form. For example, make Save a filled dark button and Delete an outlined button, or give the two buttons clearly different lightness. Adding text labels or an icon also helps. The colors can stay, but the distinction no longer depends on them.