Exercise 3 solution: a recipe page stylesheet built on a pairing ================================================================ A sample answer (yours may differ; what matters is that each role is stored once and used by name). :root { /* Pairing: change these three lines and the whole page changes. */ --font-heading: Georgia, "Times New Roman", serif; /* role: titles, headings, labels */ --font-body: Verdana, Geneva, sans-serif; /* role: method text and notes */ --font-quantity: "Courier New", monospace; /* role: quantities and timings */ } body { font-family: var(--font-body); /* role: body */ font-size: 0.9375rem; /* a little under 1rem: Verdana is wide and tall, so it looks as big as Georgia at 1rem */ line-height: 1.6; } h1, h2 { font-family: var(--font-heading); /* role: headings */ font-weight: 700; line-height: 1.2; } .serves { font-family: var(--font-heading); /* role: label, in the heading voice */ font-variant: small-caps; /* small capitals */ letter-spacing: 0.08em; /* small caps and capitals need extra tracking */ font-size: 0.9rem; } .qty { font-family: var(--font-quantity); /* role: quantities line up and read as data */ font-size: 0.9em; /* mono faces tend to look large next to text (check) */ } /* Changing the pairing: edit only --font-heading and --font-body (and, if wanted, --font-quantity) in :root. Every rule above uses var(), so nothing else changes. */ Why this works -------------- * Three roles, three custom properties, each with a generic fallback at the end, so the page is still sensible if the first font is missing. * The size adjustment is set on the body, once, instead of on every element. * The .serves label uses the heading family, so it sounds like part of the same voice. * Small capitals need extra letter-spacing, in the same way all-caps text does (Typography Fundamentals 3 covers tracking). Common mistakes to avoid ------------------------ * Writing font-family lists again on every rule instead of using the custom properties. * Forgetting the generic fallback (serif, sans-serif or monospace) at the end of a stack. * Using the code family for ordinary body text because it "looks technical".