Typography System

Fluid typography that scales smoothly from mobile to desktop using clamp()

Try it

Drag the slider to see how each font size scales between the minimum viewport (479px) and the maximum viewport (1366px).

Fluid Typography System
1024px viewport
Viewport Width1024px
375px1920px
H1Step 6
44px (2.737rem)

The quick brown fox

font-size: var(--hfs-h1);
Range:2rem (32px)3.2rem (51.2px)
H2Step 5
35px (2.211rem)

The quick brown fox

font-size: var(--hfs-h2);
Range:1.75rem (28px)2.5rem (40px)
H3Step 4
29px (1.807rem)

The quick brown fox

font-size: var(--hfs-h3);
Range:1.5rem (24px)2rem (32px)
Text MStep 0
16px (1.000rem)

The quick brown fox

font-size: var(--hfs-text-m);
Range:1rem (16px)1rem (16px)

How it works

BreakColorUI generates a fluid type scale using CSS clamp(). Each token has a minimum size (used at small viewports), a maximum size (used at large viewports), and a smoothly interpolated value in between. No @media breakpoints required.

At 479px

Each token uses its minimum size

At 1366px

Each token reaches its maximum size

Example output (CSS)css
/* Generated by BreakColorUI */
--hfs-h1: clamp(2rem, 0.140rem + 0.961vw, 3.2rem);
--hfs-h2: clamp(1.75rem, 0.105rem + 0.842vw, 2.5rem);
--hfs-text-m: clamp(1rem, 0.932rem + 0.225vw, 1.125rem);

Available tokens

The typography system ships with 7 heading tokens (H0 to H6) and 3 text tokens (Large / Medium / Small).

7 headings (H0–H6)

From hero-sized titles down to small section headings

3 body sizes (L / M / S)

Lead paragraphs, regular body text, and captions

CSS variable namescss
/* Headings */
--hfs-h0
--hfs-h1
--hfs-h2
--hfs-h3
--hfs-h4
--hfs-h5
--hfs-h6

/* Body text */
--hfs-text-l
--hfs-text-m
--hfs-text-s

Prefix

All typography tokens use the --hfs-* prefix (HeadSpin Font Size). Spacing and color use different prefixes — see Spacing and Colors.

Configuring typography

The Typography tab has two configuration modes: Simple (a single slider) and Advanced (full control over each viewport).

Simple mode

A 1–7 slider chooses a preset that controls all parameters at once. Each step has its own min/max font size, min/max scale ratio, and "active lock" (the heading from which scaling starts).

Recommended steps

  • Step 1–2 (XXS / XS): subtle scale, long-form reading sites
  • Step 4 (M): balanced default for most marketing sites
  • Step 6–7 (XL / XXL): dramatic scale, design-heavy landing pages

Advanced mode

Lets you override every parameter independently:

Min viewport

Base font size at 479px (typically 16px) and modular scale ratio

Max viewport

Base font size at 1366px (typically 16–20px) and modular scale ratio

Start from (H6 / H5 / H4 / H3)

Headings smaller than this stay at the base size; headings at or above scale up

Scale ratios

Pick from Minor Second (1.125) up to Golden Ratio (1.618)

Available scale ratios

1.125 (Minor Second) · 1.200 (Minor Third) · 1.250 (Major Third) · 1.333 (Perfect Fourth) · 1.414 (Augmented Fourth) · 1.500 (Perfect Fifth) · 1.618 (Golden Ratio)

How clamp values are calculated

For a token with step n from the base:

Calculation
yMin = minFont * (minScale ^ n)
yMax = maxFont * (maxScale ^ n)

clamp(
yMin / 16 rem,
computed-rem + computed-vw,
yMax / 16 rem
)

The viewport range used by BreakColorUI is fixed at 479px → 1366px.

Typography tab in Simple mode showing the slider, current step badge, and live preview
Typography tab in Simple mode showing the slider, current step badge, and live preview
Typography tab in Advanced mode showing min/max viewport inputs and the Start From buttons
Typography tab in Advanced mode showing min/max viewport inputs and the Start From buttons

Line height

Line height is configured separately with its own 1–7 slider (XXS to XXL). When enabled, BreakColorUI adds a single CSS rule applied to h1, h2, h3, h4, h5, h6, p, div:

Generated line-height rule (when enabled)css
h1, h2, h3, h4, h5, h6, p, div {
line-height: calc(6px + 2ex);
}

No --hfs-lh-* variables

Line height is not exported as individual CSS variables. It's a single line-height: calc(Xpx + Yex) rule that scales naturally with each element's font size. Toggle "Line height" off if you'd rather control it yourself.

Usage

In Breakdance / Oxygen / any CSScss
h1 { font-size: var(--hfs-h1); }
h2 { font-size: var(--hfs-h2); }
h3 { font-size: var(--hfs-h3); }

p           { font-size: var(--hfs-text-m); }
.lead       { font-size: var(--hfs-text-l); }
.caption    { font-size: var(--hfs-text-s); }

Where to paste this

The Export tab ships the full block inside html:root { ... }. Paste it once into Breakdance → Global Settings → Custom CSS, or into your project's global stylesheet. See the Export guide for the full flow.

Breakdance integration

When exporting to Breakdance, BreakColorUI also wires the framework's font-size variables to your typography tokens automatically:

Auto-generated Breakdance bridgecss
--bde-h1-font-size: var(--hfs-h1);
--bde-h2-font-size: var(--hfs-h2);
/* ... h3-h6 ... */
--bde-body-font-size: var(--hfs-text-m);

This means changing your typography in BreakColorUI updates Breakdance's heading and body sizes site-wide. See Tokens for the complete mapping table.

Custom typography tokens

Need extra sizes (a --hfs-h-3xl for hero displays, or a --hfs-text-xs for tiny labels)? You can add them in the Tokens tab — they're exported as clamp() values just like the system tokens.

Next