Standard Properties vs Variation Settings
You'll learn when to use CSS standard font properties versus the lower-level font-variation-settings for controlling variable fonts.
The Two Paths to Variable Font Control
When working with variable fonts, you have two ways to adjust axes like weight, width, and slant:
- Standard CSS properties:
font-weight,font-stretch,font-style - Low-level control:
font-variation-settings
Think of it like driving a car: standard properties are your steering wheel and pedals—intuitive, familiar, designed for everyday use. font-variation-settings is like accessing the car's engine management system—powerful but meant for special cases.
When to Use Standard Properties
Always start here. These properties are:
- Easier to read and maintain:
font-weight: 650;is self-explanatory - Cascade-friendly: You can override them independently
- Animation-ready: Smooth transitions work naturally
- Accessible to all developers: Everyone understands
font-weight
h1 {
font-weight: 650; /* Variable font weight */
font-stretch: 110%; /* Variable font width */
}
When to Use font-variation-settings
Use this only for custom axes that don't have standard properties—like optical sizing tweaks or stylistic alternates specific to your font.
.special {
font-variation-settings: 'GRAD' 50; /* Custom gradient axis */
}
Avoid using it for standard axes ('wght', 'wdth', 'slnt') unless you have no choice—it overrides the entire variation string and doesn't cascade well.
Key Takeaway: Prefer standard properties (font-weight, font-stretch, font-style) for variable fonts whenever possible; reserve font-variation-settings exclusively for custom axes that lack dedicated CSS properties.