Skip to content

Typography

Text sizes and the typeface

Headline sizes are fluid: one value scales smoothly with the screen, with no breakpoints to manage.

@theme {
  --text-display: clamp(2.25rem, 1.879rem + 1.524vw, 3.25rem);
  --text-display--line-height: 1.2;
  --text-display--letter-spacing: -0.02em;
  --text-display--font-weight: 500;
}

In clamp(), the first number is the smallest size and the last is the largest. The middle one controls how fast it grows, so recalculate it when you change either end.

The sizes

ClassSizeUsed for
text-display36 to 52pxA full-width hero headline
text-title32 to 44pxSection headings, and heroes in a half-width column
text-lead16 to 18pxThe paragraph under a headline
text-price36pxThe price on a pricing card
text-subhead16pxA heading inside a card
text-eyebrow12pxThe small label above a headline
text-caption11pxThe label above a group of links in a menu
text-badge10pxThe badge on a pricing card

Everything else uses Tailwind's own sizes.

text-wordmark is a special case: 64px to 288px, for the brand name set large as a graphic. It is always aria-hidden and paired with the real logo elsewhere in the block.

The typeface

Blocks use the font in --font-sans. The previews use Geist.

The theme sets --font-sans to Geist but does not load the font. Host it yourself, so your visitors load it from your own site and nothing goes to Google.

In Next.js, next/font downloads the font when you build and serves it with your site:

app/layout.tsx
import { Geist } from "next/font/google";

const geist = Geist({ subsets: ["latin"], variable: "--font-sans" });

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" className={geist.variable}>
      <body>{children}</body>
    </html>
  );
}

Anywhere else, install it from Fontsource and import it next to Tailwind:

npm install @fontsource-variable/geist
@import "@fontsource-variable/geist";

Headlines use --font-heading-face, which is --font-sans unless you change it. Change it to give headlines their own font while body text stays the same.