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.
المصطلحات ذات الصلة
أدوات ذات صلة
خطوط توضح هذا المفهوم
اعرف المزيد
دليل عملي لاستخدام الخطوط المتغيّرة في CSS — التحميل، وضبط المحاور، وتحريك الخصائص، واعتبارات دعم المتصفحات.
مراجعات الخطوطتقدّم الخطوط المتغيّرة مرونة لا حدود لها في ملف واحد. أفضل الخطوط المتغيّرة على Google Fonts — للأداء، ومرونة التصميم، والتحكم الإبداعي.
تاريخ الخط وثقافتهانتقلت الخطوط المتغيّرة من مواصفة إلى اعتماد واسع خلال سنوات قليلة فقط. قصة كيف اتحدت الصناعة لإنشاء صيغة خط جديدة.
طباعة CSSتحزم الخطوط المتغيّرة عائلة كاملة في ملف واحد. تعرّف على CSS الخاص بالوزن والعرض والميل والمحاور المخصصة — مع أمثلة تفاعلية.