font-variant-ligatures

Term side of the Card.
Topic: Font Features
Unit title: font-variant-ligatures
Categories: Property
Explanation side of the Card

Explanation: The property that controls the use of ligatures, which are special character combinations, like fi or fl, that are replaced with a single glyph. It can enable or disable standard or discretionary ligatures, improving the flow and appearance of text.

Browser compatibility:
  • The chrome browser supports this feature starting from version 34.
  • The edge browser supports this feature starting from version 79.
  • The firefox browser supports this feature starting from version 34.
  • The safari browser supports this feature starting from version 9.1.
Availability: 

Example

Wrongcss
code {
  font-feature-settings: "liga" 0, "calt" 0;
}
Rightcss
code {
  font-variant-ligatures: none;
}

'none' turns off all ligatures and contextual forms without replacing other font features.

Common mistakes

  • Ligatures disappear after adding letter-spacing and it looks like a bug.

Key points

  • Ligatures are turned off with font-variant-ligatures: none, not with raw 'liga' and 'calt' tags.
  • Code blocks that must show exact characters disable ligatures.
  • 'discretionary-ligatures' is used only on display text, not body text.

Interview questions

Why do ligatures disappear with letter-spacing?

Browsers do not apply optional ligatures when the space between characters is not zero, so letter-spacing turns them off.

What is the difference between common and discretionary ligatures?

Common ligatures like 'fi' are on by default for readability. Discretionary ones are decorative and must be turned on.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy