Skip to documentation content

Typography

Apply Honest UI's font-family, weight, body, title, and technical-text tokens with readable pairings.

Honest UI separates typography into family roles and coordinated scales. Each size has a matching line height and letter spacing value, so text remains consistent across component labels, body copy, headings, and technical content.

The default family resolves through --font-love-sans and falls back to Arial, then the system sans-serif. You can load LoveSans in your application or point --font-love-sans at a typeface you already own.

Font families

Honest UI font-family tokens
PreviewTokenValueUse
--hui-font-love-sansvar(--font-love-sans), Arial, sans-serifShared family stack and customization point
--hui-font-titlevar(--hui-font-love-sans)Headings and display titles
--hui-font-bodyvar(--hui-font-love-sans)Body copy, controls, labels, and supporting text
--hui-font-monovar(--hui-font-love-sans)Technical-text role; override it when true monospaced alignment is required

Both modern and traditional currently use the same title and body family. The style attribute changes radius, not the typography scale.

To provide an application font without changing component code:

:root {
  --font-love-sans: "Your Product Sans";
  --hui-font-mono: "Your Product Mono", ui-monospace, monospace;
}

If character alignment matters—for code, tabular output, or logs—do not assume the default --hui-font-mono value is monospaced. Override the role with a real monospace family and test the content you display.

Font weights

Honest UI font-weight tokens
PreviewTokenValueUse
--hui-font-weight-regular400Body copy, descriptions, and most control text
--hui-font-weight-medium500Labels, headings, and moderate emphasis
--hui-font-weight-semibold600Strong labels and compact structural emphasis

Load every weight you use. Honest UI disables synthetic bold and italic through font-synthesis: none, so a missing face will not be fabricated by the browser.

Body scale

Use the three tokens for a named step together. The base aliases point to the regular body step and are useful where a component needs the default without repeating its specific size name.

Honest UI body font-size tokens
PreviewTokenValueUse
--hui-font-size-micro10pxDense metadata and short supporting labels
--hui-font-size-mini11pxCaptions, badges, and compact field help
--hui-font-size-small12pxSecondary text, labels, and compact controls
--hui-font-size-regular14pxDefault component and body text
--hui-font-size-large16pxProminent body copy and large controls
--hui-font-size-basevar(--hui-font-size-regular)Alias for the default body size
Honest UI body line-height tokens
PreviewTokenValueUse
--hui-line-height-micro12pxLine height paired with micro text
--hui-line-height-mini14pxLine height paired with mini text
--hui-line-height-small16pxLine height paired with small text
--hui-line-height-regular20pxLine height paired with regular text
--hui-line-height-large24pxLine height paired with large text
--hui-line-height-basevar(--hui-line-height-regular)Alias for the default body line height
Honest UI body letter-spacing tokens
PreviewTokenValueUse
--hui-letter-spacing-micro0.01emTracking paired with micro text
--hui-letter-spacing-mini0.005emTracking paired with mini text
--hui-letter-spacing-small0emTracking paired with small text
--hui-letter-spacing-regular-0.006emTracking paired with regular text
--hui-letter-spacing-large-0.011emTracking paired with large text
--hui-letter-spacing-basevar(--hui-letter-spacing-regular)Alias for the default body tracking

Title scale

The four title steps map to the global h4 through h1 styles included by Honest UI. Those selectors use the title family, medium weight, the matching line height, and balanced wrapping.

Honest UI title typography tokens
PreviewTokenValueUse
--hui-font-size-t120pxSmall heading size; used by h4
--hui-line-height-t128pxLine height paired with t1
--hui-letter-spacing-t1-0.01emTracking paired with t1
--hui-font-size-t224pxSection heading size; used by h3
--hui-line-height-t232pxLine height paired with t2
--hui-letter-spacing-t2-0.013emTracking paired with t2
--hui-font-size-t328pxPage-section heading size; used by h2
--hui-line-height-t336pxLine height paired with t3
--hui-letter-spacing-t3-0.016emTracking paired with t3
--hui-font-size-t432pxPage-title size; used by h1
--hui-line-height-t440pxLine height paired with t4
--hui-letter-spacing-t4-0.02emTracking paired with t4

Technical-text scale

The technical scale supplies size, line-height, and tracking pairs. Apply --hui-font-mono separately because these tokens do not set the family.

Honest UI technical-text typography tokens
PreviewTokenValueUse
--hui-font-size-mono-mini11pxSmall technical labels and timestamps
--hui-line-height-mono-mini16pxLine height paired with mono mini
--hui-letter-spacing-mono-mini0pxTracking paired with mono mini
--hui-font-size-mono-small12pxInline code and compact output
--hui-line-height-mono-small16pxLine height paired with mono small
--hui-letter-spacing-mono-small0pxTracking paired with mono small
--hui-font-size-mono-regular14pxDefault code blocks and technical output
--hui-line-height-mono-regular20pxLine height paired with mono regular
--hui-letter-spacing-mono-regular0pxTracking paired with mono regular
--hui-font-size-mono-large16pxProminent technical output
--hui-line-height-mono-large24pxLine height paired with mono large
--hui-letter-spacing-mono-large0pxTracking paired with mono large

Tailwind usage

Use arbitrary properties for the complete type recipe. This avoids ambiguity between Tailwind's text-color and font-size utilities:

<section>
  <p
    className="
      [font-family:var(--hui-font-body)]
      [font-size:var(--hui-font-size-small)]
      [font-weight:var(--hui-font-weight-medium)]
      [letter-spacing:var(--hui-letter-spacing-small)]
      [line-height:var(--hui-line-height-small)]
    "
  >
    Monthly revenue
  </p>
  <p
    className="
      [font-family:var(--hui-font-title)]
      [font-size:var(--hui-font-size-t3)]
      [font-weight:var(--hui-font-weight-medium)]
      [letter-spacing:var(--hui-letter-spacing-t3)]
      [line-height:var(--hui-line-height-t3)]
    "
  >
    $42,180
  </p>
</section>

For Tailwind v4 shorthand, use a type hint when needed: text-(length:--hui-font-size-regular) sets font size, while text-(color:--hui-color-foreground-base-primary) sets color.

Readability checks

  • Keep body copy at a readable size for its context; micro and mini steps are for short supporting text, not long instructions.
  • Pair each size with its named line height and letter spacing instead of mixing steps casually.
  • Do not encode heading structure with size alone. Use semantic heading levels in a logical order, then style them.
  • Let text wrap. Avoid fixed heights on labels, buttons, and fields that break when text is enlarged or translated.
  • Test at 200% and 400% zoom, with browser text-spacing overrides, and with long unbroken content.
  • Use real text rather than text baked into an image, and maintain at least the contrast required by the product's accessibility target.