font-display decoded, variable fonts live, and the adjusted fallback that kills layout shift.
Most tutorials just say "use font-display: swap". But each value makes a different trade-off
between performance and visual stability. Click a value to see its timeline and when to actually use it.
Tiny block period. Shows fallback immediately, swaps to custom when ready. Can cause layout shift. Best for body text.
Short block period. Hides text while font loads. Worst for performance. Only justified for icon fonts.
Tiny block + ~3s swap window. If font doesn't load in time, uses fallback permanently. Good middle ground.
Tiny block, NO swap. Browser may not use the font on slow connections. Best for Core Web Vitals — zero CLS.
Browser picks the strategy. Usually behaves like block. Avoid — you lose control over the font loading experience.
A variable font is a single file containing an entire type family. One @font-face rule
replaces 8+ separate font files. Drag the sliders to see the weight axis in action.
The preview uses your system sans-serif font, so weight always works but wdth and opsz only render visually if your OS has a variable system font (recent macOS/iOS/Windows). The CSS shown is what you'd write for a real variable font like RobotoFlex.
@font-face:
font-weight to a range matching the font's actual axis range:
font-display: swap causes layout shift because the fallback font has different metrics than
your custom font. The adjusted fallback pattern uses size-adjust, ascent-override
and descent-override to make the fallback match your font's dimensions exactly.
Arial is 107% the width of Inter. Layout renders with Arial metrics.
Inter swaps in. Metrics are different. Everything reflows. CLS score spikes.
Arial adjusted to Inter's metrics: same width, same ascenders, same descenders.
Inter swaps in. Metrics match. Layout doesn't reflow. CLS stays near 0.
@font-face above:
Exact values for size-adjust, ascent-override, and descent-override
depend on the specific font pair. Use the
Perfect Font Fallback tool
or Fontaine (an npm package) to auto-generate the correct values for your font.