CSS - font-variant-ligatures

The font-variant-ligatures CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text.

Example

 

CSS
p {
  font-variant-ligatures: none;
}

Syntax  

CSS
font-variant-ligatures: normal;
font-variant-ligatures: none;
font-variant-ligatures: common-ligatures;           /* <common-lig-values> */
font-variant-ligatures: no-common-ligatures;        /* <common-lig-values> */
font-variant-ligatures: discretionary-ligatures;    /* <discretionary-lig-values> */
font-variant-ligatures: no-discretionary-ligatures; /* <discretionary-lig-values> */
font-variant-ligatures: historical-ligatures;       /* <historical-lig-values> */
font-variant-ligatures: no-historical-ligatures;    /* <historical-lig-values> */
font-variant-ligatures: contextual;                 /* <contextual-alt-values> */
font-variant-ligatures: no-contextual;              /* <contextual-alt-values> */
font-variant-ligatures: contextual;                 /* <no-historical-ligatures> <common-ligatures> */

/* Global values */
font-variant-ligatures: inherit;
font-variant-ligatures: initial;
font-variant-ligatures: unset;

Values

normal
This keyword leads to the activation of the usual ligatures and contextual forms needed for correct rendering. The ligatures and forms activated depend on the font, language and kind of script. This is the default value.
none
This keyword specifies that all ligatures and contextual forms are disabled, even common ones.
<common-lig-values>
These values control the most common ligatures, like for fi, ffi, th or similar. They correspond to the OpenType values liga and clig. Two values are possible:
  • common-ligatures activating these ligatures. Note that the keyword normal activates these ligatures.
  • no-common-ligatures deactivating these ligatures.
<discretionary-lig-values>
These values control specific ligatures, specific to the font and defined by the type designer. They correspond to the OpenType values dlig. Two values are possible:
  • discretionary-ligatures activating these ligatures.
  • no-discretionary-ligatures deactivating the ligatures. Note that the keyword normal usually deactivates these ligatures.
<historical-lig-values>
These values control the ligatures used historically, in old books, like the German tz digraph being displayed ß. They correspond to the OpenType values hlig. Two values are possible:
  • historical-ligatures activating these ligatures.
  • no-historical-ligatures deactivating the ligatures. Note that the keyword normal usually deactivates these ligatures.
<contextual-alt-values>
These values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters. These values correspond to the OpenType values calt. Two values are possible:
  • contextual specifies that the contextual alternates are to be used. Note that the keyword normal usually activates these ligatures too.
  • no-contextual prevents their use.

Formal syntax

CSS
normal <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> none <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> <a href="css/font-variant-ligatures#common-lig-values"><common-lig-values></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> <a href="css/font-variant-ligatures#discretionary-lig-values"><discretionary-lig-values></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> <a href="css/font-variant-ligatures#historical-lig-values"><historical-lig-values></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> <a href="css/font-variant-ligatures#contextual-alt-values"><contextual-alt-values></a> <a href="css/value_definition_syntax#brackets" title="Brackets">]</a><p>where <br><code><common-lig-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> common-ligatures <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> no-common-ligatures <a href="css/value_definition_syntax#brackets" title="Brackets">]</a><br><discretionary-lig-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> discretionary-ligatures <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> no-discretionary-ligatures <a href="css/value_definition_syntax#brackets" title="Brackets">]</a><br><historical-lig-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> historical-ligatures <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> no-historical-ligatures <a href="css/value_definition_syntax#brackets" title="Brackets">]</a><br><contextual-alt-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> contextual <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> no-contextual <a href="css/value_definition_syntax#brackets" title="Brackets">]</a></code></p>

Description  

The font-variant-ligatures CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text.

Initial valuenormal
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedyes
Mediavisual
Computed valueas specified
Animatableno
Canonical orderorder of appearance in the formal grammar of the values

Specifications  

Specification Status Comment
CSS Fonts Module Level 3
The definition of 'font-variant-ligatures' in that specification.
Candidate Recommendation Initial definition

 

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari (WebKit)
Basic support 34 (34) [1] 31 -webkit
34
10.0 19.0-webkit 7.0-webkit
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 4.4 -webkit 34.0 (34)[1] ? ? 7.0-webkit

[1] Experimental implementation was available since Gecko 24. It was governed by the preference layout.css.font-features.enabled defaulting to true on Nightly and Aurora only. The none keyword has been added in Gecko 28.

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/font-variant-ligatures

CSS CSS Fonts CSS Property CSS Reference NeedsLiveSample Reference