OpenType features
Alternates
Utilities for controlling the usage of alternate glyphs.
| Class | Properties |
|---|---|
salt
|
--ot-salt: "salt" 1 |
ss-01
|
--ot-ss01: "ss01" 1 |
ss-02
|
--ot-ss02: "ss02" 1 |
ss-03
|
--ot-ss03: "ss03" 1 |
ss-04
|
--ot-ss04: "ss04" 1 |
¶Usage
These utilities provide access to OpenType alternate glyph features not currently available via the higher-level CSS properties. For other alternate glyph features, use the Font Variant Alternates utilities.
¶Examples
¶Stylistic alternates salt
Sometimes a significant portion of a typeface’s unique character comes from a few specific glyphs. Stylistic Alternates offer an opportunity to change these, and change the tone of the typeface.
Sunday morning & fox
Sunday morning & fox
<p class="salt">Sunday morning & fox</p>¶Stylistic sets ss01–ss20
This feature replaces sets of default character glyphs with stylistic variants. Glyphs in stylistic sets may be designed to harmonise visually, interact in particular ways, or otherwise work together.
Illegal
Illegal
<p class="ss-02">Illegal</p>Note that fonts may employ stylistic sets in completely arbitrary and individual ways. In this example, Inter uses ss02 to change a series of glyphs into less ambiguous forms, but the same stylistic set in another font could produce completely different changes.
¶Custom names for stylistic sets
The OpenType spec allows for as many as 20 different sets to be defined in a font; by default this plugin includes utilities for ss01 through ss04. To add additional sets or to change the label of the utility class for specific sets, use the stylisticSets key in your theme or extends config.
// tailwind.config.js
module.exports = {
theme: {
stylisticSets: {
'open-digits': 'ss01',
disambiguate: 'ss02',
'curved-r': 'ss03',
},
extend: {
stylisticSets: {
'04': 'ss04',
},
},
},
}