Skip to content

Typography

Source: packages/shared/tokens/primitives.css


Font Families

TokenValue
--font-family-sans"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif
--font-family-mono"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif

Tailwind mapping

@theme inline {
--font-sans: var(--font-family-sans);
--font-mono: var(--font-family-mono);
}

Font Sizes

All sizes defined in px. The base size is 16px.

TokenValueUsage
--font-size-xs12pxCaptions, fine print
--font-size-sm14pxSecondary text, table cells
--font-size-base16pxBody copy, inputs, buttons
--font-size-lg18pxH4 headings
--font-size-xl24pxH3 headings
--font-size-2xl32pxH2 headings
--font-size-3xl48pxH1 headings
--font-size-4xl64pxHero heading (landing)
--font-size-5xl72pxReserved

Font Weights

TokenValueUsage
--font-weight-normal400Body text, descriptions
--font-weight-medium500Headings, labels, buttons
--font-weight-semibold600Emphasis, section titles
--font-weight-bold700Strong emphasis

Line Heights

All line-heights follow a 4px grid for vertical rhythm.

TokenValue
--line-height-tight16px
--line-height-snug20px
--line-height-normal24px
--line-height-relaxed28px
--line-height-loose32px
--line-height-xl40px
--line-height-2xl48px
--line-height-3xl56px

Heading Styles

Defined in theme.css base layer:

ElementFont SizeWeightLine Height
h1--font-size-3xl (48px)medium (500)--line-height-3xl (56px)
h2--font-size-2xl (32px)medium (500)--line-height-2xl (48px)
h3--font-size-xl (24px)medium (500)--line-height-xl (40px)
h4--font-size-lg (18px)medium (500)--line-height-relaxed (28px)

Utility Classes

Custom typography utilities defined in theme.css:

ClassFamilyWeightSizeLine Height
.text-body-1sans40016px24px
.text-body-2sans40014px20px
.text-buttonmono40014px20px
<p className="text-body-1">Standard body copy at 16/24.</p>
<p className="text-body-2">Secondary body copy at 14/20.</p>
<span className="text-button">Button label style.</span>