Skip to content

Typography

Typography establishes visual hierarchy and readability. Tessera UI uses a constrained type system with two font families and a fixed size scale.

TokenValueUsage
--ts-font-family-base'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serifAll body text, labels, buttons
--ts-font-family-mono'JetBrains Mono', 'Fira Code', 'Consolas', monospaceCode blocks, technical content

Plus Jakarta Sans is the primary typeface — it’s a geometric sans-serif designed for screen readability with open letterforms and a modern, friendly aesthetic.

The type scale uses rem units based on a 16px root size. Each step provides a meaningful visual distinction.

TokenSizePixelsUsage
--ts-font-size-2xs0.6875rem11pxM3 label-small
--ts-font-size-xs0.75rem12pxM3 body-small, label-medium, captions
--ts-font-size-sm0.875rem14pxM3 body-medium, label-large, title-small
--ts-font-size-md1rem16pxM3 body-large, title-medium
--ts-font-size-lg1.375rem22pxM3 title-large
--ts-font-size-xl1.5rem24pxM3 headline-small
--ts-font-size-2xl1.75rem28pxM3 headline-medium
--ts-font-size-3xl2rem32pxM3 headline-large
--ts-font-size-4xl2.8125rem45pxM3 display-small
--ts-font-size-5xl3.5625rem57pxM3 display-medium
--ts-font-size-6xl5.5rem88pxM3 display-large, marketing hero
TokenValueUsage
--ts-font-weight-regular400Body text, descriptions
--ts-font-weight-medium500Labels, input labels, emphasized text
--ts-font-weight-semi600Buttons, headings, badge labels
--ts-font-weight-bold700Strong emphasis, display text
TokenValueUsage
--ts-line-height-tight1.25Headings, labels
--ts-line-height-normal1.43Body text (M3: 20/14, 24/16)
--ts-line-height-loose1.5Display text (M3: 64/57, 96/88)

Letter spacing tokens adjust tracking for different typographic contexts. Display sizes use tighter spacing for visual density; labels and captions use wider spacing for legibility at small sizes.

TokenValueUsage
--ts-letter-spacing-tighter-0.02emDisplay text
--ts-letter-spacing-tight-0.01emHeadings
--ts-letter-spacing-normal0emBody text, default (M3: 0 for most sizes)
--ts-letter-spacing-wide0.006em~0.1px at 16px — M3 body-small/label
--ts-letter-spacing-wider0.009em~0.1px at 11px — small labels
--ts-letter-spacing-widest0.05emAll-caps text, legal fine print

Type roles combine size, weight, line height, and letter spacing into a single semantic purpose. Use these roles to maintain consistent typography across your application rather than assembling individual tokens.

RoleSize TokenWeightLine HeightLetter SpacingUsage
display-lgclamp(2.8125rem, 5vw + 1rem, 5.5rem) (45px-88px)semi (600)1.09normal (0em)Marketing hero, landing page headlines
display-mdclamp(2rem, 4vw + 1rem, 3.5625rem) (32px-57px)semi (600)1.12normal (0em)Section hero, feature highlights
display-smclamp(1.75rem, 3vw + 0.75rem, 2.8125rem) (28px-45px)semi (600)1.16normal (0em)Page titles, onboarding headers
heading-lgclamp(1.5rem, 2vw + 0.5rem, 2rem) (24px-32px)semi (600)1.25normal (0em)Page section headers
heading-mdclamp(1.25rem, 1.5vw + 0.5rem, 1.75rem) (20px-28px)semi (600)1.29normal (0em)Card headers, dialog titles
heading-smxl (24px)semi (600)1.33normal (0em)Subsection headers
title-lglg (22px)regular (400)1.36normal (0em)Card headers, dialog titles, nav items
title-mdmd (16px)medium (500)1.5normal (0em)List item titles, section labels
title-smsm (14px)medium (500)1.43normal (0em)Compact titles, tab labels
body-lgmd (16px)regular (400)1.5normal (0em)Introductory paragraphs, lead text
body-mdsm (14px)regular (400)1.43normal (0em)Default body text
body-smxs (12px)regular (400)1.33wide (0.006em)Secondary body text, descriptions
label-lgsm (14px)medium (500)1.43normal (0em)Form labels (lg), button text, navigation items
label-mdxs (12px)medium (500)1.33wide (0.006em)Form labels (md), small button text
label-sm2xs (11px)medium (500)1.45wider (0.009em)Badge labels, helper text, overlines
captionxs (12px)regular (400)1.33wide (0.006em)Timestamps, footnotes, fine print

Each role is defined as a set of four CSS custom properties (e.g., --ts-type-display-lg-size, --ts-type-display-lg-weight, --ts-type-display-lg-line, --ts-type-display-lg-spacing), making them easy to apply and override.

Display and heading type role sizes use CSS clamp() by default, providing fluid scaling between mobile and desktop viewports without any extra configuration:

RoleMin (mobile)Max (desktop)
display-lg45px (2.8125rem)88px (5.5rem)
display-md32px (2rem)57px (3.5625rem)
display-sm28px (1.75rem)45px (2.8125rem)
heading-lg24px (1.5rem)32px (2rem)
heading-md20px (1.25rem)28px (1.75rem)
/* The tokens are already fluid — just use them: */
h1 {
font-size: var(--ts-type-display-lg-size); /* scales automatically */
}

To override with a fixed size, reassign the token:

:root {
--ts-type-display-lg-size: 5.5rem; /* fixed 88px, no scaling */
}

Guidelines:

  • Body text (body-sm, body-md, body-lg) remains fixed — fluid scaling at reading sizes harms readability
  • heading-sm also remains fixed since it is small enough that scaling is unnecessary
  • Display and heading sizes scale fluidly by default via clamp()

When supporting CJK (Chinese, Japanese, Korean) or Arabic scripts:

  • Append CJK-specific font families to --ts-font-family-base:
    :root {
    --ts-font-family-base: 'Plus Jakarta Sans', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
    }
  • CJK text typically needs line-height: 1.7–1.8 instead of the default 1.43
  • Arabic and Hebrew scripts require RTL layout — see the Internationalization page
  • Avoid letter-spacing adjustments for CJK — the glyphs are already monospaced by design

Components use the type scale consistently to establish hierarchy:

Button SizeFont SizeWeight
xs--ts-font-size-xssemi (600)
sm--ts-font-size-smsemi (600)
md--ts-font-size-mdsemi (600)
lg--ts-font-size-lgsemi (600)
xl--ts-font-size-xlsemi (600)
Input SizeFont SizeLabel Size
sm--ts-font-size-smsm / medium
md--ts-font-size-mdsm / medium
lg--ts-font-size-lgsm / medium
xl--ts-font-size-xlsm / medium
ComponentFont SizeWeight
Modal headerlgsemi
Modal bodymdregular
Alert messagesmregular
Tooltipxsmedium
Badgexssemi
Toggle labelsmregular
  • Use the type scale, not arbitrary sizes. The eleven-step scale (2xs through 6xl) covers all needs from label-small to display-large.
  • Pair size with weight for hierarchy. Avoid using weight alone to differentiate text — use size steps.
  • Prefer medium (500) over bold (700) for emphasis. Bold should be reserved for strong semantic emphasis.
  • Use tight line height for single-line text (headings, labels). Use normal for multi-line body content.