Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Typography

The font-optical-sizing property

Reference for the CSS font-optical-sizing property: how browsers set the opsz axis of variable fonts from the font size, and when to turn it off.

Optical sizing adjusts a typeface's design to its size: small text gets sturdier strokes, looser spacing and larger counters, while large text gets finer details and tighter spacing. Fonts that support it expose an optical size axis (opsz).

The font-optical-sizing property decides whether the browser sets that axis for you. With the default auto, it follows the element's font size, so text at 12px and 72px each use a fitting design without any extra CSS.

CSS
body {
  font-optical-sizing: auto;
}

.fixed-look {
  font-optical-sizing: none;
}

Try it

Optical size on and off

The change is subtle, and visible only when the active font has an opsz axis. If the two groups look identical, your system font has none; use a variable web font with that axis to see it.

Syntax

CSS
font-optical-sizing: auto | none;
Initial value auto
Applies to All elements and text
Inherited Yes
Animatable No
Computed value As specified

Values

Value Description
auto The browser sets the font's opsz axis from the font size, in CSS pixels.
none The browser does not set the axis; the font's default optical size is used.

Usage notes

  • Usually leave it alone. auto is the default, which is the right choice for nearly all text.
  • Explicit overrides win. font-variation-settings: "opsz" 24 sets the axis by hand and takes precedence over automatic sizing.
  • Needs an opsz axis. Static fonts and variable fonts without the axis ignore this property.
  • Turning it off. none helps if you want the same shapes at every size, or need consistent text widths across sizes.
  • Related work. Pick appropriate font-size values; optical sizing reads them as the unit, so zoomed text also gets a fitting design.
  • Zoom. The axis follows the used size, so browser zoom can slightly change letter shapes.

Browser support

Supported in current browsers; its only visible effect is with variable fonts that have an optical size axis.