Skip to main content

Typography Scale

All typography classes included with Fluid Typography. All sizes scale fluidly between 375px (mobile) and 1440px (desktop) viewports by default.

Design Philosophy

Body variants match Tailwind's defaults on desktop for easy mental mapping:

  • text-body = text-base (16px) on desktop, scales down to 14px on mobile
  • text-body-sm = text-sm (14px) on desktop, scales down to 13px on mobile
  • text-body-xs = text-xs (12px) on desktop, scales down to 11px on mobile

Display Styles

Large, bold typography for hero sections and landing pages.

ClassMobile → DesktopFont WeightUse Case
text-display-2xl48px → 72px800Massive hero titles
text-display-xl40px → 60px800Large hero titles
text-display-lg32px → 48px700Medium hero titles
text-display28px → 36px700Small hero titles

Example

<h1 className="text-display-2xl">Massive Hero Title</h1>
<h1 className="text-display-xl">Large Hero Title</h1>
<h1 className="text-display-lg">Medium Hero Title</h1>
<h1 className="text-display">Small Hero Title</h1>

Heading Styles

Standard heading hierarchy (h1-h3).

ClassMobile → DesktopFont WeightUse Case
text-h128px → 36px700Main page headings
text-h224px → 30px700Section headings
text-h320px → 24px600Subsection headings

Example

<h1 className="text-h1">Main Page Heading</h1>
<h2 className="text-h2">Section Heading</h2>
<h3 className="text-h3">Subsection Heading</h3>

Body Text

Regular paragraph and content text.

ClassMobile → DesktopFont WeightUse Case
text-body14px → 16px400Regular paragraphs
text-body-sm13px → 14px400Smaller body text
text-body-xs11px → 12px400Extra small text

Example

<p className="text-body">
This is regular body text that scales smoothly from 14px on mobile to 16px on desktop.
</p>
<p className="text-body-sm">
Smaller body text for secondary content.
</p>
<p className="text-body-xs">
Extra small text for fine print or metadata.
</p>

Small Text

Utility text for captions, labels, and metadata.

ClassMobile → DesktopFont WeightAdditional StylesUse Case
text-caption10px → 11px400-Image captions, footnotes
text-overline10px → 11px600text-transform: uppercase
letter-spacing: 0.1em
Labels, eyebrows

Example

<figure>
<img src="photo.jpg" alt="Description" />
<figcaption className="text-caption">Image caption text</figcaption>
</figure>

<span className="text-overline">Category Label</span>

CSS Output

When you use a fluid typography class, this is what gets generated:

.text-h1 {
font-size: clamp(1.75rem, 1.5739rem + 0.7512vw, 2.25rem);
line-height: 1.2;
font-weight: 700;
letter-spacing: -0.015em;
}

The clamp() function ensures smooth scaling:

  • Minimum: 1.75rem (28px) at 375px viewport
  • Preferred: Calculated dynamically based on viewport width
  • Maximum: 2.25rem (36px) at 1440px viewport

Overriding Styles

All typography utilities can be combined with other Tailwind classes:

{/* Override font weight */}
<h1 className="text-h1 font-normal">Light heading</h1>

{/* Override line height */}
<p className="text-body leading-relaxed">Relaxed paragraph</p>

{/* Override letter spacing */}
<h2 className="text-h2 tracking-tight">Tight heading</h2>

{/* Add color */}
<p className="text-body text-gray-700">Colored text</p>

Responsive Behavior

Unlike traditional breakpoint-based responsive design, fluid typography scales smoothly:

{/* Traditional approach - jumps at breakpoints */}
<h1 className="text-2xl md:text-3xl lg:text-4xl">Heading</h1>

{/* Fluid approach - scales smoothly */}
<h1 className="text-h1">Heading</h1>

At any viewport width between 375px and 1440px, your text will be the perfect size—no jumps, no sudden changes.

Next Steps