font-variation-settings
굵기·너비·기울기 및 사용자 정의 축 등 가변 폰트의 축을 직접 제어하는 CSS 속성으로, font-weight/font-stretch보다 하위 수준이다.
The font-variation-settings CSS property is the low-level mechanism for controlling variable font axes — the design dimensions along which a variable font can interpolate. Just as font-feature-settings controls OpenType features, font-variation-settings controls the continuous axes that make variable fonts powerful.
/* Control weight and width axes directly */
.heading {
font-variation-settings: "wght" 750, "wdth" 85;
}
/* Optical size axis */
.small-print {
font-variation-settings: "opsz" 12;
}
/* A font with a custom italic axis (not just a style flag) */
.slanted {
font-variation-settings: "slnt" -10;
}
Registered vs custom axes:
OpenType defines five "registered" axes with standard behavior:
| Tag | CSS property equivalent | Description |
|---|---|---|
wght |
font-weight |
Weight |
wdth |
font-stretch |
Width |
opsz |
font-optical-sizing |
Optical size |
ital |
font-style: italic |
Italic |
slnt |
font-style: oblique Xdeg |
Slant |
For registered axes, always prefer the high-level CSS property:
/* Preferred */
.bold { font-weight: 750; }
.wide { font-stretch: 115%; }
/* Only use font-variation-settings for custom axes */
.expressive {
font-variation-settings: "SOFT" 80, "WONK" 1;
}
This is important because font-variation-settings, like font-feature-settings, does not cascade granularly. Setting it on a child resets all inherited axes. High-level properties compose correctly across the cascade.
Animating variable fonts:
@keyframes weight-pulse {
from { font-variation-settings: "wght" 300; }
to { font-variation-settings: "wght" 800; }
}
.animated-heading {
animation: weight-pulse 2s ease-in-out infinite alternate;
}
Variable font axes can be animated with CSS transitions and keyframe animations, enabling effects impossible with static fonts. Roboto Flex exposes axes including GRAD (grade — weight without changing width), YOPQ, and YTUC, enabling fine typographic control. Recursive includes a MONO axis that transitions from proportional to monospaced spacing.
Checking available axes:
// Font Loading API to inspect axes
document.fonts.ready.then(() => {
for (const font of document.fonts) {
// Not directly exposed, but you can check via CSS.supports
}
});
Use tools like Wakamai Fondue or the browser DevTools font inspector to discover which axes a font supports and their min/max/default values before writing font-variation-settings declarations.
Related Terms
Related Tools
Fonts That Illustrate This Concept
Learn More
Variable fonts pack an entire family into one file. Learn the CSS for weight, width, slant, and custom axes — with interactive examples.
Font ReviewsVariable fonts offer infinite flexibility in a single file. The best variable fonts on Google Fonts — for performance, design flexibility, and creative control.
Type History & CultureVariable fonts went from specification to mainstream in just a few years. The story of how the industry united to create a new font format.
CSS TypographyA practical guide to using variable fonts in CSS — loading, setting axes, animating properties, and browser support considerations.