styleset() CSS Function
The styleset() function turns on one or more stylistic sets of a font (OpenType ssXX) with font-variant-alternates.
Description
The styleset() 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 sets: groups of alternate glyphs that the type designer has bundled together, such as a set of rounded letters or alternative numerals. It maps to the OpenType ss01 to ss20 features.
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 @styleset 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.
Several names can be listed, separated by commas, to switch on more than one set, and a single name can also map to several sets at once in the @styleset block.
@font-feature-values "Inter" {
@styleset {
open-digits: 1;
round-quotes: 3;
}
}
.stats {
font-family: "Inter", sans-serif;
font-variant-alternates: styleset(open-digits, round-quotes);
}
Syntax
styleset() = styleset( <feature-value-name># )
Values
- <feature-value-name>A <custom-ident> defined in the @styleset block of an @font-feature-values rule for the font family. It maps to the font's OpenType ssXX (stylistic sets) feature. Several comma-separated names can be given.
Example
Browser Support
The following information will show you the current browser support for the CSS styleset() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





