Typography

suggest change

Establish readable defaults with a system fallback stack, a unitless line height, and a constrained measure:

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

article {
  max-inline-size: 70ch;
}

h1 {
  font-size: clamp(2rem, 1.25rem + 3vw, 4rem);
  line-height: 1.1;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

Use relative units for text so browser zoom and user font preferences remain effective. Viewport units can contribute to fluid sizing, but should normally be bounded and combined with rem.

The font shorthand accepts style, variant, weight, stretch, size, optional line height, and family. Size and family are required:

.caption {
  font: italic 500 0.875rem/1.4 system-ui, sans-serif;
}

Variable fonts can expose continuous axes:

@font-face {
  font-family: "Example Variable";
  src: url("/fonts/example.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

Load only fonts and weights the design uses, provide suitable fallbacks, and test the layout while web fonts are unavailable or still loading.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents