stylistic() CSS Function
The stylistic() function turns on a stylistic alternate of a font (OpenType salt) with font-variant-alternates.
Description
The stylistic() CSS function is one of the functions used with the font-variant-alternates property to switch on alternative glyphs in an OpenType font. It enables stylistic alternates: individual replacement letter forms that a type designer has provided, such as a single-storey "a" or a "g" with a different tail. It maps to the OpenType salt feature.
The argument is not a number but a name that you define yourself in a @font-feature-values rule for the font family, inside a @stylistic block. That rule maps the friendly name to the numeric index the font uses, so the same name can mean different glyph sets in different fonts. If the font has no matching feature, or no name is defined, the text is shown with its normal glyphs.
Only one name can be given, because a font's stylistic alternates are chosen by a single index.
@font-feature-values "Mona Sans" {
@stylistic {
simple-a: 1;
}
}
h1 {
font-family: "Mona Sans", sans-serif;
font-variant-alternates: stylistic(simple-a);
}
Syntax
stylistic() = stylistic( <feature-value-name> )
Values
- <feature-value-name>A <custom-ident> defined in the @stylistic block of an @font-feature-values rule for the font family. It maps to the font's OpenType salt (stylistic alternates) feature.
Example
Browser Support
The following information will show you the current browser support for the CSS stylistic() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





