Skip to content

Font Utilities

Utility classes for font size, weight, line height, family, and letter spacing. All utilities support responsive breakpoint prefixes: sm:, md:, lg:, xl:, 2xl:.


Font Size

9-step font size scale. All classes reference CSS custom properties from the theme.

Classes

ClassCSS variableDefault
text-xsvar(--font-size-xs)0.75rem
text-smvar(--font-size-sm)0.875rem
text-basevar(--font-size-base)1rem
text-lgvar(--font-size-lg)1.125rem
text-xlvar(--font-size-xl)1.25rem
text-2xlvar(--font-size-2xl)1.5rem
text-3xlvar(--font-size-3xl)1.875rem
text-4xlvar(--font-size-4xl)2.25rem
text-5xlvar(--font-size-5xl)3rem

.text-xs — 0.75rem

.text-sm — 0.875rem

.text-base — 1rem

.text-lg — 1.125rem

.text-xl — 1.25rem

.text-2xl — 1.5rem

.text-3xl — 1.875rem

.text-4xl — 2.25rem

.text-5xl — 3rem

Responsive

html
<h1 class="text-2xl md:text-4xl">Responsive heading</h1>

Font Weight

7-step font weight scale from thin (100) to extrabold (800).

Classes

ClassCSS variableValue
font-thinvar(--font-weight-thin)100
font-lightvar(--font-weight-light)300
font-normalvar(--font-weight-normal)400
font-mediumvar(--font-weight-medium)500
font-semiboldvar(--font-weight-semibold)600
font-boldvar(--font-weight-bold)700
font-extraboldvar(--font-weight-extrabold)800

.font-thin — 100

.font-light — 300

.font-normal — 400

.font-medium — 500

.font-semibold — 600

.font-bold — 700

.font-extrabold — 800

Responsive

html
<p class="font-normal md:font-bold">Bold from md and up</p>

Line Height

6-step line height scale.

Classes

ClassCSS variableValue
leading-nonevar(--line-height-none)1
leading-tightvar(--line-height-tight)1.25
leading-snugvar(--line-height-snug)1.375
leading-normalvar(--line-height-normal)1.5
leading-relaxedvar(--line-height-relaxed)1.625
leading-loosevar(--line-height-loose)2

Responsive

html
<p class="leading-normal md:leading-relaxed">
  Relaxed line height from md and up
</p>

Font Family

Utility classes for switching between the three font family tokens.

Classes

ClassCSS variable
font-basevar(--font-family-base)
font-headingvar(--font-family-heading)
font-monovar(--font-family-mono)

Responsive

html
<code class="font-mono">monospace text</code>

Letter Spacing

6-step letter spacing scale from tighter (−0.05em) to widest (0.1em).

Classes

ClassValue
tracking-tighter−0.05em
tracking-tight−0.025em
tracking-normal0
tracking-wide0.025em
tracking-wider0.05em
tracking-widest0.1em

.tracking-tighter — −0.05em

.tracking-tight — −0.025em

.tracking-normal — 0

.tracking-wide — 0.025em

.tracking-wider — 0.05em

.tracking-widest — 0.1em

Responsive

html
<h1 class="tracking-tight md:tracking-normal">
  Tighter tracking on mobile
</h1>