font-variation-settings
Widely availableSince 201897% of users
Controls low-level variable font axes. Lets you fine-tune font weight, width and other OpenType variations.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassicIt has worked everywhere since September 2018.
The old way and the modern waySee the snippet: Multiple font weights without multiple files →
Old way 13 lines
@font-face {
font-family: "MyFont";
src: url("MyFont-Regular.woff2");
font-weight: 400;
}
@font-face {
font-weight: 700;
...
}
@font-face {
font-weight: 600;
...
}Modern 5 lines
@font-face {
font-family: "MyVar";
src: url("MyVar.woff2");
font-weight: 100 900;
}See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
normal- Inherited
- Yes
Quick example
h1 { font-variation-settings: "wght" 700, "wdth" 85; }Syntax
normal | [ <string> <number> ]#Examples
Adjust OpenType axes on a variable font
h1 {
font-family: "RobotoFlex", sans-serif;
font-variation-settings: "wght" 700, "wdth" 75;
/* weight=700, width=75% */
}Use variable font axes like weight and width for precise typography control.
Fine-tune font weight and width together
.condensed-bold {
font-variation-settings: "wght" 900, "wdth" 50;
/* Extra heavy and condensed */
}Combine multiple axes to create custom typographic combinations.
Variable font for responsive design
@media (max-width: 768px) {
h1 {
font-variation-settings: "wdth" 85;
/* Slightly more condensed on mobile */
}
}Use variable font axes to adapt typography for different screen sizes.
Common pitfalls
- Requires a variable fontfont-variation-settings only works with variable fonts (fonts that support axes). Regular static fonts ignore this property.
- Axis names are font-specificDifferent variable fonts support different axes. "wght" and "wdth" are common, but custom fonts may have custom axes. Check your font documentation.
- Fallback to font-weight still neededUse font-weight as a fallback for browsers that don't support variable fonts. font-variation-settings won't help older browsers.
font-variation-settings browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2018.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
62+
62+
11+
17+Mobile
62+Android
62+Android
11+iOS