Browse documentation

Reference / Typography

Font family

Set a typeface for a whole block or switch families for a single line of metadata.

Working example

The default stacks use locally available fonts. Add a named family to theme.extend.fontFamily to reuse your own font stack.

HTML
<article>
  <p class="font-mono text-xs uppercase">Field journal</p>
  <h3 class="font-serif text-3xl">Notes from the coast</h3>
  <p class="font-sans text-sm">An entry from the spring collection.</p>
</article>

Class reference

ClassCSS declarations
font-sansfont-family: ui-sans-serif, system-ui, sans-serif;
font-seriffont-family: ui-serif, Georgia, serif;
font-monofont-family: ui-monospace, SFMono-Regular, Consolas, monospace;
font-[family-name:Georgia,serif]font-family: Georgia,serif;
View full generated CSS
Compiled CSS
.font-\[family-name\:Georgia\,serif\] {
  font-family: Georgia,serif;
}
.font-mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.font-sans {
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.font-serif {
  font-family: ui-serif, Georgia, serif;
}