Tailwind CSS Handbook v4.3

Fonts

Font families, sizes, weights, line height and letter spacing — plus how to build a type scale with @theme and load custom fonts properly.

Type is the highest-leverage part of a design system. Tailwind gives you a scale for each axis and lets you redefine all of them from @theme.

Font family#

UtilityStack
font-sansSystem UI sans stack
font-serifSystem serif stack
font-monoSystem monospace stack
Add or replace families
@theme {
  --font-display: "Satoshi", ui-sans-serif, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
}

That generates font-display and overrides font-sans.

Loading a web font#

app.css
@import "tailwindcss";

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

@theme {
  --font-display: "Satoshi", ui-sans-serif, sans-serif;
}

font-display: swap renders fallback text immediately instead of leaving a blank gap. Always include a real fallback stack.

For Next.js, see React & Next.js — it needs @theme inline.

Font size#

UtilitySizeDefault line height
text-xs0.75rem1rem
text-sm0.875rem1.25rem
text-base1rem1.5rem
text-lg1.125rem1.75rem
text-xl1.25rem1.75rem
text-2xl1.5rem2rem
text-3xl1.875rem2.25rem
text-4xl2.25rem2.5rem
text-5xl … text-9xl3rem … 8rem1

Each size ships with a sensible line height, so text-lg alone is usually complete.

Overriding line height inline#

HTML
<p class="text-lg/7">Font size lg, line height 1.75rem</p>
<p class="text-2xl/tight">Font size 2xl, tight leading</p>

The slash modifier sets line-height in one class.

Custom sizes#

CSS
@theme {
  --text-hero: 4rem;
  --text-hero--line-height: 1.05;
  --text-hero--letter-spacing: -0.03em;
  --text-hero--font-weight: 700;
}

class="text-hero" now applies all four properties.

Font weight#

UtilityValue
font-thin100
font-extralight200
font-light300
font-normal400
font-medium500
font-semibold600
font-bold700
font-extrabold800
font-black900

Line height#

UtilityValueGood for
leading-none1Large display headings
leading-tight1.25Headings
leading-snug1.375Subheadings
leading-normal1.5Default
leading-relaxed1.625Long-form body copy
leading-loose2Sparse lists
leading-6Spacing scalePrecise vertical rhythm

The rule of thumb: larger text needs tighter leading, smaller text needs looser.

Letter spacing#

UtilityValueUse
tracking-tighter-0.05emVery large display type
tracking-tight-0.025emHeadings
tracking-normal0Body
tracking-wide0.025emSmall caps
tracking-wider0.05emUppercase labels
tracking-widest0.1emEyebrow text
Loading preview…

Font features#

v4.2 font-features-* controls font-feature-settings for OpenType features.

HTML
<table class='font-features-["tnum"]'>…</table>

Tabular numerals keep digits the same width, so figures in a table line up.

Tailwind also ships dedicated numeric utilities:

UtilityEffect
tabular-numsFixed-width digits
proportional-numsNatural digit widths
slashed-zeroZero with a slash
oldstyle-numsText figures with descenders
ordinalProper ordinal glyphs (1ˢᵗ)

Building a type scale#

app.css
@import "tailwindcss";

@theme {
  --font-display: "Satoshi", ui-sans-serif, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  --text-eyebrow: 0.75rem;
  --text-eyebrow--line-height: 1rem;
  --text-eyebrow--letter-spacing: 0.1em;
  --text-eyebrow--font-weight: 600;

  --text-display: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);
  --text-display--line-height: 1.05;
  --text-display--letter-spacing: -0.03em;
}
HTML
<p class="text-eyebrow text-indigo-600 uppercase">Introducing</p>
<h1 class="font-display text-display">A scale you only define once</h1>

The clamp() makes the display size fluid without a single breakpoint.

Common mistakes#

  • font-lg or text-bold. It is text-lg and font-bold. Size is text-*, weight is font-*, family is also font-*.
  • Setting line height separately when the size already sets it. text-lg leading-7 is fine, but text-lg/7 is clearer.
  • No fallback stack. --font-display: "Satoshi" alone leaves nothing to render while the font loads.
  • Unbounded line length. Body text without max-w-prose (or similar) becomes unreadable on wide screens.
  • Using font-thin for body copy. 100-weight text at 14px fails contrast expectations for many readers, even when the colour ratio passes.