Variable Fonts
One file containing a continuous range of weights and widths, usually smaller than the static weights it replaces.
Definition
A variable font is a single font file that contains a continuous design space along one or more axes, such as weight, width and optical size. Any instance along an axis can be rendered without loading an additional file.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
Common axes
| Axis | Tag | What it controls |
|---|---|---|
| Weight | wght | Stroke thickness, typically 100 to 900. |
| Width | wdth | Horizontal proportion, useful for fitting text into constrained space. |
| Optical size | opsz | Adjusts contrast and spacing for the intended rendering size. |
| Slant | slnt | Angle of oblique, as a continuous value. |
| Italic | ital | Switches to true italic letterforms, which is not the same as slant. |
Practical benefits
- Usually a smaller total payload than three or four static weights, and one request instead of several.
- Fluid weight interpolation in responsive typography, so heading weight can scale with viewport.
- Optical size support, where available, genuinely improves rendering at both small and large sizes.
- Fine-grained weight tuning for dark mode without shipping extra files.
In practice
Weight that responds to viewport
Responsive typographySlightly reducing heading weight as the viewport narrows keeps optical weight consistent when the type also shrinks. Doing this with static fonts would require additional files.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
MDN Web Docs
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Related concept
Connected closely enough to change how you apply this.
- Design TokensDesign system
- Font SelectionUI foundation
- Font WeightUI foundation
- Performance as User ExperienceUI foundation
- Responsive TypographyUI foundation
- Type ScaleUI foundation