Skip to content
TrademarkTrademark
Docs
Basics

Typography

Updated: July 27, 2026

Once UI manages typography properties with the Text and Heading components. They apply utility classes and CSS variables under the hood. See the Config page for our recommended font setup.

Font family

Add font-family classes to elements.

Class
Variable
Default
.font-displayvar(--font-heading)var(--font-primary)
.font-headingvar(--font-heading)var(--font-primary)
.font-bodyvar(--font-body)var(--font-primary)
.font-labelvar(--font-label)var(--font-primary)
.font-codevar(--font-code)var(--font-code)

Font size

Add font-size classes to elements. The value adjusts to the adjacent or closest parent font-family class.

Class
Variable
.font-size-inherit—
.font-xldynamic
.font-ldynamic
.font-mdynamic
.font-sdynamic
.font-xsdynamic

Font weight

Add font-weight classes to elements. The value adjusts to the adjacent or closest parent font-family class.

Class
Variable
.font-weight-inherit—
.font-default--font-weight-display-default
.font-normal--font-weight-display-normal
.font-medium--font-weight-display-medium
.font-strong--font-weight-display-strong

Every family reads the display weights unless you give it its own: --font-<family>-weight-<weight>, for heading, body, label and code. Setting one changes only that family, so bolder body text leaves headlines and labels alone.

Color

Learn about setting color properties in the color documentation.

Font scaling

Modify the font-size of the HTML element for different breakpoints.

Variable
Default
var(--font-scaling-desktop)16px
var(--font-scaling-tablet)16px
var(--font-scaling-mobile)16px

Font multiply

Modify the font-size scaling factor individually for different font-family classes.

Variable
Default
var(--font-size-heading-multiplier)1
var(--font-size-body-multiplier)1
var(--font-size-label-multiplier)1

Line multiply

Modify the line-height scaling factor individually for different font-family classes.

Variable
Default
var(--line-height-heading-multiplier)1
var(--line-height-body-multiplier)1
var(--line-height-label-multiplier)1
Edit this page on GitHub