font-variation-settings
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="https://fontfyi.com/iframe/glossary/font-variation-settings/" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://fontfyi.com/glossary/font-variation-settings/
Add a dynamic SVG badge to your README or docs.
[](https://fontfyi.com/glossary/font-variation-settings/)
Use the native HTML custom element.
CSS property to control variable font axes directly — weight, width, slant, and custom axes. Lower-level than 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.
คำศัพท์ที่เกี่ยวข้อง
เครื่องมือที่เกี่ยวข้อง
ฟอนต์ที่แสดงแนวคิดนี้
เรียนรู้เพิ่มเติม
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.