How to use the fluid type scale generator
- Pick a preset: balanced, gentle, dramatic, editorial, app UI, dashboard, marketing and classic ratios.
- Set the base size for small and large screens, typically 16px and 18–20px.
- Choose the scale ratios for each end. A small difference keeps the system calm.
- Set the viewports where growth starts and stops, and how many steps you need.
- Preview at any width with the slider or the quick buttons.
- Export CSS variables (with example element rules), SCSS, Tailwind or JSON.
How the values are calculated
For each step, the minimum size is base × ratio^step at the small viewport and the maximum uses the large-screen base and ratio. The middle value is a straight line between them:
--step-0: clamp(1rem, 0.9266rem + 0.3261vw, 1.1875rem);
That grows from 16px at a 360px viewport to 19px at 1280px.
Worked examples
Example 1: a content site
Load Editorial and map step 0 to body text, step 1 to lead paragraphs and steps 3–5 to h3–h1. Headings shrink gracefully on phones without separate media queries.
Example 2: a product interface
Load App UI: a base of 15–16px with a tight 1.125–1.2 ratio. Interfaces need many similar sizes close together; large jumps waste space.
Example 3: a bold landing page
Load Landing with six steps above the base for big hero headlines. Check the zoom result: if a step grows more than 2.5×, lower the large-screen ratio.
Common mistakes
- Pure vw font sizes.
font-size: 4vwignores user settings and breaks zoom; always mix in rem as clamp() does here. - Too many steps. Six to eight sizes cover most designs.
- Unreadably small minimums. Keep body text at 16px or more on phones.
Testing the scale
Set a real page with the scale: headings, body text, captions and buttons. Check it at the smallest and largest viewport widths, then zoom to 200% and confirm headings still fit without awkward breaks. Finally, compare the scale with your line lengths: body text reads best at roughly 45 to 75 characters per line.