Get to know MDN better
Since March 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
* Some parts of this feature may have varying levels of support.
The CSSFontFeatureValuesRule interface represents an @font-feature-values at-rule. The values of its instance properties can be accessed with the CSSFontFeatureValuesMap interface.
@font-feature-values allows developers to associate, for a given font face, a human-readable name with a numeric index that controls a particular OpenType font feature. For features that select alternative glyphs (stylistic, styleset, character-variant, swash, ornament or annotation), the font-variant-alternates property can then reference the human-readable name in order to apply the associated feature. This is convenient, because it allows the same name to be used of represent a set of alternative glyphs across a number of fonts.
CSSRule CSSFontFeatureValuesRuleInherits properties from its ancestor CSSRule.
CSSFontFeatureValuesRule.annotationA user defined value definition and value that applies an alternate annotation of the font.
CSSFontFeatureValuesRule.characterVariantA user defined value definition and value that applies a stylistic alternatives for characters of the font.
CSSFontFeatureValuesRule.fontFamilyA string that identifies the font family this rule applies to.
CSSFontFeatureValuesRule.ornamentsA user defined value definition and value that applies alternative ornaments of the font.
CSSFontFeatureValuesRule.stylesetA user defined value definition and value that applies alternate style sets of the font.
CSSFontFeatureValuesRule.stylisticA user defined value definition and value that applies alternative glyphs of the font.
CSSFontFeatureValuesRule.swashA user defined value definition and value that applies alternative swashes of the font.
Inherits methods from its ancestor CSSRule.
In this example, we declare two @font-feature-values one for the Font One font family, and the other for Font Two. In both declarations we define that the name "nice-style" can be used to represent the styleset alternate glyphs for both of the fonts, specifying the index for that alternate in each font family. The alternate glyphs are then applied for any .nice-look class, using font-variant-alternates and passing the name to the styleset() function.
We then use the CSSOM to read these declaration as CSSFontFeatureValuesRule instances, displaying them into the log.
| CSS Fonts Module Level 4 # cssfontfeaturevaluesrule |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Feb 24, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.