O Come, All Ye Fonts
Two fonts at most, each with a job.
Door 2 · Design lesson · About 10 minutes for the whole door
What this door is worth
- 3 stars: First Submit passes
- 2 stars: A hint, or one or two failed Submits
- 1 star: Three or more failed Submits
- 0 stars: After showing the answer
The rule
Use two font families at most, and give each one a job: one for headings, one for everything else.
One family is often enough. Two is the limit.
Every font costs something
Each family you add has a price.
- Download. A web font is a file the page has to fetch before the text looks right.
- Mismatched sizes. Fonts at the same pixel size are not the same size on screen. Their lowercase letters, the x-height, sit at different heights, so 16px in one looks bigger than 16px in another.
- Noise. Every new face asks the eye to adjust. Four fonts on one card read as four different apps.
What a job means
A job is a kind of text, not a single line. Headings are one job, so every heading shares one family. Body text, labels, prices and buttons are the other job, so they share the second.
If one line needs to stand out, such as a price, do not reach for a third font. Size, weight and colour do that work inside the family you have. A price at 600 weight in the brightest text colour stands out without a typewriter face.
The trap: buttons and fields
Browsers give buttons, inputs and text areas their own font, usually Arial at about 13px. They ignore the font on body unless you tell them otherwise. So a page set in one family quietly picks up a second one in every button.
One line fixes it:
button,
input,
select,
textarea {
font: inherit;
}What to look for
- More than two
font-familyvalues on one screen. - Headings that do not all share one family.
- A third font brought in for one kind of line, such as prices.
- Buttons and fields with no
font: inherit.
Quiz
Three questions about the rule. Sign in to see the answers and pick yours.
- A screen uses Georgia for the h1, Trebuchet MS for the h2s and system-ui for everything else. How many families does it use, and what is the fix?
- Body text is 16px system-ui. The prices need to stand out. Which change keeps the page to two families?
- The body is set to 16px system-ui. A button has no font rules of its own. What does Chrome draw it in?
Sign in to answerYour stars are saved to your account.
Fix the page
The problem
Sleighlist has a page of gift ideas. Each card shows an idea, a short note, a price and an "Add to list" button. Somebody picked a new font for each part, and the page now uses five.
- The
h1is in Georgia. - The card headings, the
h2s, are in Trebuchet MS. - The prices are in Courier New.
- The body text is in system-ui.
- The buttons and the search field have no font set, so the browser gives them its own.
What to do
- Use two font families at most on the whole page.
- Give every heading the same family.
- Make the buttons and the search field use the page's own font.
Keep the prices easy to spot. Use weight or colour for that, not another font.
Change only the CSS. The HTML is fine as it is.
Press Run checks as often as you like. Press Submit when every check passes. Fewer hints and fewer failed Submits earn more stars.
How do you want to fix it?
- By handEdit the HTML yourself. The preview updates as you type.Sign in to fix it by hand
- With your AICopy a prompt for your AI, then paste its answer back. Add your own rule to see how much better it does.Sign in to fix it with your AI
You can switch at any time. The stars are the same either way.
How stars work
Most doors are worth up to 6 stars: 3 from the quiz and 3 from the fix.
Quiz. One star for each right answer. Your first answer is final.
The fix. Press Submit and confirm. Your first passing Submit sets your stars.
| Your first passing Submit | Stars |
|---|---|
| No hints, no failed Submits | 3 |
| With a hint, or after one or two failed Submits | 2 |
| After three or more failed Submits | 1 |
| After showing the answer | 0 |
- Run checks is free. Run it as often as you like. It never costs a star.
- Only your first hint lowers your stars. After that, hints cost nothing extra.
- Show me the answer opens after three failed Submits, or once you have read every hint. You keep your quiz stars.
Gold. Pass a door within 24 hours of it opening and it turns gold. Every door stays open until 31 December, so a late pass still earns stars.
Snow Days. If a door doesn't turn gold while you have a streak, a Snow Day is used for you once its 24 hours are up. Your streak carries on, but that door doesn't add to it. You have three for December.
By hand or with your AI, the stars are the same.