The size-adjust CSS Property
You'll learn how to use size-adjust in @font-face rules to scale fallback fonts, reducing visual jumps when web fonts load.
When a web font loads, it often has different dimensions than the fallback system font that displays first. Even if both fonts share the same font-size, the web font might render taller, wider, or more compact. This mismatch causes layout shift: text reflows, buttons move, and users lose their reading position.
The size-adjust property solves this by letting you scale the fallback font to match the web font's actual rendered size before the web font arrives.
How It Works
You apply size-adjust inside the @font-face rule for your fallback font—not the web font itself. The value is a percentage: 100% means no change, 90% shrinks the font to 90% of its original size, and 110% enlarges it.
@font-face {
font-family: 'ArialFallback';
src: local('Arial');
size-adjust: 95%; /* Scale Arial down to better match web font */
}
@font-face {
font-family: 'MyWebFont';
src: url('mywebfont.woff2') format('woff2');
}
body {
font-family: 'MyWebFont', 'ArialFallback', sans-serif;
}
When the page loads, ArialFallback displays at 95% of its normal size. Once MyWebFont loads and swaps in, the text dimensions stay nearly identical—no jarring shift.
Finding the Right Value
You determine the correct percentage by comparing the web font's metrics (ascent, descent, line gap) to the fallback's. Tools like Fallback Font Generator or manual testing help calculate this ratio.
Key Takeaway: size-adjust in @font-face lets you scale fallback fonts to match web font dimensions, dramatically reducing layout shift and improving user experience during font loading.