Preskoči na glavni sadržaj
← 🎨 CSS as a design system·Modul B4 · Lekcija 10
ZadatakBuild a typography-only article. <article class='prose'><p class='eyebrow'>BLOG</p><h1>Why CSS typography wins in 2026</h1><p>Body paragraph 1 (Lorem ipsum...).</p><h2>Section heading</h2><p>Body paragraph 2.</p></article>. CSS: define :root tokens (--scale 1.25, --text-base 1rem, --text-lg, --text-xl, --text-2xl using calc/var). body: system-ui sans-serif, font-size var(--text-base), line-height 1.6, padding clamp(1rem, 4vw, 3rem). h1: font-size clamp(2rem, 5vw + 1rem, 3.5rem), line-height 1.15, letter-spacing -0.02em, text-wrap balance. h2: font-size var(--text-xl), text-wrap balance. .eyebrow: font-size 0.8rem, letter-spacing 0.08em, text-transform uppercase, color #71717A. p: text-wrap pretty. .prose: max-width 65ch, margin 0 auto.

Završni kamen modula: tipografija - prva stranica članka

200 XP14 min
Teorija

Putting B4 together

A blog article page where typography does ALL the work — no decorations, no fancy backgrounds, just type. The kind of page Substack, Medium, and Stripe ship.

Combine every B4 concept:

  • B4-01: system-ui font stack on body, ui-monospace on code.
  • B4-02: rem for absolute sizes, em for em-related (button padding).
  • B4-03: clamp() for the h1 (fluid).
  • B4-04: line-height 1.6 on body, 1.15 on h1.
  • B4-05: Variable font weight (we skip the @font-face but use weight as a token).
  • B4-06: text-wrap balance on headings, pretty on p.
  • B4-07: Modular scale (--text-base/--text-lg/--text-xl/--text-2xl).
  • B4-08: letter-spacing -0.02em on h1.
  • B4-09: max-width 65ch on .prose, margin auto.

After this, you've shipped typography that doesn't look hobby.

🔒

Registriraj se i počni kodirati

Teorija je otvorena svima. Editor, pregled uživo i provjera otključavaju se s 7-dnevnim besplatnim probnim periodom — potrebna kartica, otkaži kad god.

Registracija — besplatan probni period →

Prvih 10 lekcija u svakom smjeru je besplatno. Bez kartice.

← PrethodnaSljedeća lekcija →

Jedan Python ili web savjet dnevno — emailom

Kratko, ručno pisano, bez spama. Odjavi se jednim klikom.