Fluid typography generator

Fluid typography generator

Fluid typography scales text smoothly between a small and a large screen, with no breakpoints. Set a base size, a modular scale for mobile and desktop, and the viewport range, then copy production-ready clamp() values.

Sample clamp() output (default scale)

This is real output from the generator, using the default kit. Open the editor to make it yours.

  --heading-line-height: 1.1;
  --body-line-height: 1.6;
  --text-h1: clamp(2.9875rem, calc(2.5967rem + 1.737vw), 3.8125rem);
  --text-h2: clamp(2.4875rem, calc(2.2211rem + 1.184vw), 3.05rem);
  --text-h3: clamp(2.075rem, calc(1.9003rem + 0.776vw), 2.4438rem);
  --text-h4: clamp(1.725rem, calc(1.6155rem + 0.487vw), 1.9563rem);
  --text-h5: clamp(1.4375rem, calc(1.3783rem + 0.263vw), 1.5625rem);
  --text-h6: clamp(1.2rem, calc(1.1763rem + 0.105vw), 1.25rem);
  --text-body-lg: 1.125rem;
  --text-body-md: 1rem;
  --text-body-sm: 0.875rem;

How it works

  1. Open the editor and click Fluid scale in the Typography section.
  2. Choose the base size, the mobile and desktop ratios, and the viewport range.
  3. Check the preview at Desktop, Tablet and Mobile sizes.
  4. Export CSS, Tailwind or JSON and paste the clamp() values into your project.

How the scale works

Each heading level is the base size multiplied by the scale ratio to a power. The mobile ratio sets the minimum size and the desktop ratio sets the maximum. WebStyleKit then writes a clamp() that interpolates linearly between your minimum and maximum viewport widths.

You can override any level by hand, switch the export between rem and px, and see the result on a live page at desktop, tablet and mobile widths.

Accessibility notes

rem is the default unit so text respects the user’s browser font size. The clamp() minimum and maximum keep text readable at every width, and body text never drops below your base size.

Frequently asked questions

What is the difference between rem and px output?

rem scales with the user’s default font size, which is better for accessibility. px gives fixed values. Both interpolate the same way.

Which viewport range should I use?

A common range is 360px to 1120px. Widen the maximum if your layout keeps growing on large screens.

Can I use the output without Tailwind?

Yes. The CSS export is plain custom properties, for example font-size: var(--text-h1).