font-feature-settings
Example
.price {
font-feature-settings: "tnum" 1;
}.price {
font-variant-numeric: tabular-nums;
}font-variant-numeric sets the same feature without overriding other features set elsewhere.
Common mistakes
- A nested rule sets one feature and all the other inherited features turn off.
- Enabling a feature the font does not include and nothing changes.
Key points
- Common features use
font-variant-*properties, withfont-feature-settingsonly for features they lack. - Each declaration lists every needed feature, since a new value replaces the whole list.
- Feature tags are four-letter quoted strings like
"ss01".
Interview questions
What is the difference between font-feature-settings and font-variant?
font-variant-* are high-level properties that combine safely. font-feature-settings sets raw OpenType tags and replaces the whole list each time.
How do I know which features a font supports?
Check the font's documentation or inspect the file with a font tool; the browser ignores tags the font does not have.