Module 4 / Typography & color
Module 4 · Core utilities

Typography & color

Font sizing, weight, line-height, and the color shade scale — what makes content readable and branded.

0/3 lessons

Font utilities

Learn

Typography in Tailwind flows through four utility families: font size (`text-xs` through `text-9xl`), font weight (`font-thin` through `font-black`), line height (`leading-none` through `leading-loose`), and letter spacing (`tracking-tighter` through `tracking-widest`).

The common stack for readable body text: `text-base leading-relaxed`. For headings: `text-2xl font-bold tracking-tight`. All of these can be adjusted per breakpoint with responsive prefixes.

UtilityWhat it controlsCommon values
text-*Font size + line-heighttext-sm, text-base, text-lg, text-xl, text-2xl, text-4xl
font-*Font weight (thickness)font-light, font-normal, font-medium, font-semibold, font-bold
leading-*Line heightleading-none, leading-tight, leading-normal, leading-relaxed
tracking-*Letter spacingtracking-tighter, tracking-tight, tracking-normal, tracking-wide
text-* utilities in v4 set BOTH font-size AND line-height together — a sensible default pair. Need to override the line-height? Add a separate leading-* class after.
Practice
Loading…
Recall0/1
Recall

In Tailwind v4, the `text-base` utility sets…

Color utilities & the shade scale

Learn

Color utilities follow the pattern `property-color-shade`: `bg-teal-500`, `text-slate-300`, `border-rose-500`. The shade scale runs 50 (lightest, almost white) → 500 (mid-tone, the 'pure' color) → 950 (darkest, almost black). Pairing a mid-tone background (400–600) with a high-contrast text shade (50 or 900+) is the everyday pattern.

For text on colored backgrounds, use `text-white` or `text-<color>-50` for light text on dark backgrounds, and `text-<color>-900` for dark text on light backgrounds. The `ring-*` utility uses the same color palette for focus rings.

Light bg, dark text

Background
bg-slate-100
Text
text-slate-900
Border
border-slate-300
Contrast
High (~14:1)

Dark bg, light text

Background
bg-indigo-600
Text
text-white
Border
border-indigo-400
Contrast
High (~7:1)
Tailwind v4 added color-mix shortcuts: `bg-red-500/50` gives 50% opacity on the background color. This replaces the old `bg-red-500 bg-opacity-50` pattern.
Practice
Loading…
Recall0/1
Recall

In the Tailwind shade scale, 50 is the ___ and 950 is the ___.

Borders & border-radius

Learn

Borders come in three parts: width (`border`, `border-2`, `border-4`), color (`border-gray-300`, using the same shade scale), and style (default is solid; use `border-dashed` or `border-dotted` for alternatives). You can target individual sides with `border-t-*`, `border-r-*`, etc.

Border-radius uses a named scale that's independent of the spacing scale: `rounded-sm` (2px), `rounded` (4px), `rounded-md` (6px), `rounded-lg` (8px), `rounded-xl` (12px), `rounded-2xl` (16px), `rounded-3xl` (24px), `rounded-full` (circle/pill).

border border-slate-600 rounded-lg → 1px solid border, 8px radius border-2 border-indigo-500 rounded-xl → 2px, indigo, 12px radius border-t border-b border-slate-300 → borders on top+bottom only rounded-full → fully circular or pill shape v4 shorthand: border border-color-shade — all in one compound.
The secret to polished cards: pair rounded-xl with a subtle border (border-slate-200 on light, border-slate-700 on dark) and a shadow for depth. Three utilities, instant polish.
Practice
Loading…
Recall0/1
Recall

Which utility creates a fully circular or pill-shaped element?