Skip to content
BENIBIX Learn

Variable Font

Design🔤 TypographyType Sizes and Styles

Also known as OpenType Variable Font, Variable Typeface

One font file with a slider. Set it to any weight or width.

Think of it like

It is like a dimmer switch for light. You can pick any level, not just on or off.

Example

Emma's site loads one variable file and uses weights 350, 500 and 720. Before, it needed three files.

Why it matters

It gives finer control over type. It can also cut the number of files a page loads.

Definition

A variable font is one font file that holds a whole range of styles. Instead of separate files for light, regular and bold, you slide along an axis to any weight in between. Some also have axes for width, slant or size. The format was added to OpenType in 2016. One variable file can be smaller than several separate fonts.

Example code

css
h1 {
  font-weight: 650;
  font-variation-settings: "wdth" 90;
}
Any weight works, not just 400 or 700. The wdth axis makes letters a bit narrower.
One file, any point on the slider.

Common mistake

Assuming every font is variable. Check which axes the font has before you use them.

Key takeaways

  1. 1
    One file, many styles. A range, not separate fonts.
  2. 2
    Axes. Weight, width, slant and more.
  3. 3
    Fewer files. Often lighter than many fonts.

Learn it properly