CSS font-variant-emoji Property
The font-variant-emoji property controls whether eligible Unicode characters are presented using text-style or emoji-style glyphs.
Some characters, such as hearts, stars, and weather symbols, can appear as monochrome text symbols or colorful emoji. This property lets authors express a preferred presentation without changing the characters in the HTML. The result depends on the character, available fonts, and browser support.
font-variant-emoji Syntax
The font-variant-emoji property accepts one of four keyword values.
Basic Syntax
selector {
font-variant-emoji: normal;
}
Text Presentation
selector {
font-variant-emoji: text;
}
Emoji Presentation
selector {
font-variant-emoji: emoji;
}
Unicode Default Presentation
selector {
font-variant-emoji: unicode;
}
CSS-Wide Keywords
.example {
font-variant-emoji: inherit;
}
.example {
font-variant-emoji: initial;
}
.example {
font-variant-emoji: unset;
}
.example {
font-variant-emoji: revert;
}
.example {
font-variant-emoji: revert-layer;
}
Only one keyword can be specified at a time. Values such as text emoji are invalid.
Property Values
The following values determine the preferred presentation of eligible emoji characters.
| Value | Description |
|---|---|
normal |
Allows the browser to use its normal emoji presentation behavior, including the influence of Unicode variation selectors. |
text |
Requests text-style presentation for eligible characters, typically using monochrome glyphs. |
emoji |
Requests emoji-style presentation for eligible characters, often using colorful glyphs. |
unicode |
Requests the default presentation defined for each character by Unicode, rather than the browser's normal presentation preferences. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | normal |
| Inherited | Yes |
| Applies to | All elements and text |
| Computed value | As specified |
| Animation type | Discrete |
| Percentages | Not applicable |
The property expresses a presentation preference. It does not guarantee that every character will have both text and emoji forms available.
How It Works
Unicode defines characters that can support different presentation styles. The browser uses character information, variation selectors, fonts, and CSS preferences to determine which glyph to display.
Default Presentation
.symbol {
font-variant-emoji: normal;
}
The browser uses its normal presentation behavior.
Request Text Presentation
.symbol {
font-variant-emoji: text;
}
This requests a text-style glyph where one is available.
Request Emoji Presentation
.symbol {
font-variant-emoji: emoji;
}
This requests an emoji-style glyph where one is available.
Request Unicode Defaults
.symbol {
font-variant-emoji: unicode;
}
This requests each character's default presentation as defined by Unicode.
Presentation vs. Character Identity
Changing the presentation does not replace the Unicode character. A heart remains a heart character whether it appears as a monochrome symbol or a colorful emoji.
Important Consideration
The property cannot force a font to provide a glyph that it does not contain. Browser and operating system font availability may affect the final result.
The normal Value
The normal value allows the browser to use its normal emoji presentation behavior.
Basic Example
.symbol {
font-variant-emoji: normal;
}
HTML Example
<span class="symbol">♥ ★ ☀ ☎</span>
Default Behavior
With normal, the browser considers Unicode presentation information, variation selectors, and its normal font selection behavior.
Reset an Inherited Preference
.emoji-section {
font-variant-emoji: emoji;
}
.emoji-section .default-symbol {
font-variant-emoji: normal;
}
Important Consideration
The normal value does not mean that all symbols will appear as monochrome text. Some characters may use emoji presentation by default.
The text Value
The text value requests text-style presentation for eligible emoji characters.
Basic Example
.text-symbol {
font-variant-emoji: text;
}
HTML Example
<p class="text-symbol">♥ ★ ☀ ☎</p>
CSS Example
.text-symbol {
font-size: 32px;
color: #333;
font-variant-emoji: text;
}
Typical Appearance
Text-style symbols are commonly monochrome and may follow the surrounding text color. Their appearance depends on the font used to render them.
Typical Uses
Text presentation may be useful for navigation symbols, document icons, monochrome interfaces, and designs that require symbols to match surrounding typography.
Important Consideration
The text value does not guarantee a monochrome result. Some characters or font environments may not provide an appropriate text-style glyph.
The emoji Value
The emoji value requests emoji-style presentation for eligible characters.
Basic Example
.emoji-symbol {
font-variant-emoji: emoji;
}
HTML Example
<p class="emoji-symbol">♥ ★ ☀ ☎</p>
CSS Example
.emoji-symbol {
font-size: 32px;
font-variant-emoji: emoji;
}
Typical Appearance
Emoji presentation commonly uses colorful glyphs supplied by an emoji font. The exact design varies across operating systems and browsers.
Typical Uses
Emoji presentation may be useful for reactions, status messages, informal labels, and decorative symbols.
Important Consideration
The emoji value requests emoji presentation but does not guarantee that every symbol will become colorful. The character and available fonts determine which glyphs can be displayed.
The unicode Value
The unicode value requests the default presentation defined for each character by the Unicode Standard.
Basic Example
.unicode-symbol {
font-variant-emoji: unicode;
}
HTML Example
<p class="unicode-symbol">♥ ★ ☀ ☎</p>
CSS Example
.unicode-symbol {
font-size: 32px;
font-variant-emoji: unicode;
}
Unicode Default Presentation
Unicode identifies certain emoji-capable characters as having a default text presentation and others as having a default emoji presentation.
Difference from normal
The normal value permits the browser's normal presentation behavior. The unicode value specifically requests Unicode's default presentation for each character.
Important Consideration
The unicode value does not mean that every symbol will be displayed as text. Characters with a default emoji presentation may still appear as emoji.
Unicode Variation Selectors
Unicode variation selectors allow text to explicitly request text or emoji presentation for eligible characters.
Text Presentation Selector
Variation Selector-15, commonly written as U+FE0E, requests text presentation.
<span>❤︎</span>
Emoji Presentation Selector
Variation Selector-16, commonly written as U+FE0F, requests emoji presentation.
<span>❤️</span>
CSS Presentation Preference
.text-preference {
font-variant-emoji: text;
}
.emoji-preference {
font-variant-emoji: emoji;
}
HTML and CSS Together
<span class="emoji-preference">❤</span>
<span class="text-preference">❤</span>
Precedence
Explicit Unicode variation selectors are part of the text content and take precedence over a conflicting CSS emoji presentation preference.
Important Consideration
Use variation selectors when the intended presentation is part of the content itself. Use font-variant-emoji when presentation should be controlled through CSS styling.
Font Selection and Fallbacks
The final appearance of an emoji-capable character depends on the fonts available to the browser.
Text Font Example
.text-symbol {
font-family: Arial, sans-serif;
font-variant-emoji: text;
}
Emoji Font Example
.emoji-symbol {
font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
font-variant-emoji: emoji;
}
System Differences
Windows, macOS, Linux, and mobile operating systems may use different emoji fonts. The same Unicode character can have different visual designs on different devices.
Fallback Behavior
If the preferred font does not contain the requested glyph, the browser may use another available font.
Color and Text Styling
Monochrome text glyphs often follow the CSS color property. Color emoji glyphs may use built-in colors that are not controlled by the surrounding text color.
Important Consideration
Do not depend on a particular emoji illustration appearing identically across platforms. Use images or other controlled graphics when exact visual consistency is required.
Emoji Presentation vs. Text Styling
The font-variant-emoji property controls emoji presentation preferences, not general text formatting.
Emoji Presentation
.symbol {
font-variant-emoji: emoji;
}
Text Color
.symbol {
color: #c0392b;
}
Font Size
.symbol {
font-size: 36px;
}
Combined Styling
.symbol {
font-size: 36px;
color: #c0392b;
font-variant-emoji: text;
}
This requests text presentation while applying a font size and text color.
Important Consideration
Color emoji may not respond to the CSS color property in the same way as monochrome text glyphs.
Inheritance
The font-variant-emoji property is inherited. Child elements receive the parent's emoji presentation preference unless they specify another value.
Inherited Emoji Presentation
.emoji-section {
font-variant-emoji: emoji;
}
<div class="emoji-section">
<p>Weather: ☀ ☁ ☂</p>
<p>Symbols: ♥ ★ ☎</p>
</div>
Override a Child Element
.emoji-section {
font-variant-emoji: emoji;
}
.emoji-section .text-symbol {
font-variant-emoji: text;
}
Explicit Inheritance
.child {
font-variant-emoji: inherit;
}
Reset to Initial Value
.child {
font-variant-emoji: initial;
}
Important Consideration
Inherited presentation preferences can affect symbols throughout a section. Apply the property to appropriately scoped containers or individual elements.
font-variant-emoji Example
This example compares the four values using the same set of Unicode symbols. The exact appearance depends on browser support and available fonts.
HTML Example
<div class="font-variant-emoji-demo">
<p class="demo-label">Normal</p>
<p class="normal-symbols">♥ ★ ☀ ☎</p>
<p class="demo-label">Text presentation</p>
<p class="text-symbols">♥ ★ ☀ ☎</p>
<p class="demo-label">Emoji presentation</p>
<p class="emoji-symbols">♥ ★ ☀ ☎</p>
<p class="demo-label">Unicode default</p>
<p class="unicode-symbols">♥ ★ ☀ ☎</p>
</div>
CSS Example
.font-variant-emoji-demo {
font-family: Arial, sans-serif;
}
.font-variant-emoji-demo p {
margin: 0 0 16px;
}
.font-variant-emoji-demo .demo-label {
font-size: 13px;
font-weight: 600;
}
.font-variant-emoji-demo .normal-symbols,
.font-variant-emoji-demo .text-symbols,
.font-variant-emoji-demo .emoji-symbols,
.font-variant-emoji-demo .unicode-symbols {
font-size: 36px;
line-height: 1.4;
}
.font-variant-emoji-demo .normal-symbols {
font-variant-emoji: normal;
}
.font-variant-emoji-demo .text-symbols {
font-variant-emoji: text;
}
.font-variant-emoji-demo .emoji-symbols {
font-variant-emoji: emoji;
}
.font-variant-emoji-demo .unicode-symbols {
font-variant-emoji: unicode;
}
Normal
♥ ★ ☀ ☎
Text presentation
♥ ★ ☀ ☎
Emoji presentation
♥ ★ ☀ ☎
Unicode default
♥ ★ ☀ ☎
The first line uses normal browser behavior. The second requests text-style symbols, the third requests emoji-style glyphs, and the fourth requests each character's Unicode default presentation.
Some lines may appear identical if the browser does not support the property or if suitable text and emoji glyphs are unavailable.
Common Mistakes
The most common mistakes involve invalid values, unsupported fonts, and confusion between presentation preferences and Unicode characters.
Combining Multiple Values
.symbol {
font-variant-emoji: text emoji;
}
This declaration is invalid because the property accepts only one keyword.
Using color as a Value
.symbol {
font-variant-emoji: color;
}
This declaration is invalid. Use emoji to request emoji presentation.
Using monochrome as a Value
.symbol {
font-variant-emoji: monochrome;
}
This declaration is invalid. Use text to request text presentation.
Expecting Every Character to Have Two Forms
Not all Unicode characters support both text and emoji presentation.
Expecting Identical Emoji Across Platforms
Emoji glyph designs vary between operating systems, browsers, and font providers.
Expecting CSS color to Recolor Every Emoji
Color emoji glyphs may contain built-in colors that do not follow the CSS color property.
Ignoring Variation Selectors
Explicit Unicode variation selectors can determine presentation even when a conflicting CSS preference is present.
Assuming unicode Means Text Presentation
The unicode value uses Unicode's default presentation, which may be text or emoji depending on the character.
Assuming Feature Detection Guarantees the Result
The @supports rule can detect CSS syntax support, but it cannot confirm that the required glyphs are available.
Important Considerations
Keep the following points in mind when using the font-variant-emoji property:
- Purpose: Controls preferred text or emoji presentation for eligible Unicode characters.
- Initial value:
normal. - Inheritance: The property is inherited.
- Applies to: All elements and text.
- normal: Uses normal browser presentation behavior.
- text: Requests text-style presentation.
- emoji: Requests emoji-style presentation.
- unicode: Requests each character's Unicode default presentation.
- Single value: Only one keyword can be specified at a time.
- Variation selectors: Explicit selectors in the text take precedence over conflicting CSS preferences.
- Font availability: The requested glyph style must be available in a suitable font.
- Platform differences: Emoji designs vary across devices and operating systems.
- Color: Color emoji may not respond to CSS
coloras ordinary text glyphs do. - Character identity: The property does not replace or modify Unicode characters.
- Fallback behavior: Unsupported presentation requests may produce the same appearance as the default.
- Accessibility: Do not rely on emoji appearance alone to communicate essential information.
- Browser support: Check current compatibility before relying on the property.
Use font-variant-emoji when the intended presentation should be controlled through CSS. For consistent results, test the selected symbols across the browsers and operating systems used by your audience.
Browser Support
The CSS font-variant-emoji property has limited availability across browsers and versions. Support is not universal, so the requested presentation may be ignored in some environments.
Browsers that do not support the property continue using their normal emoji rendering behavior, including Unicode variation selectors and available fonts.
Basic Example
.symbol {
font-variant-emoji: emoji;
}
Feature Detection
@supports (font-variant-emoji: emoji) {
.symbol {
font-variant-emoji: emoji;
}
}
Progressive Enhancement
.symbol {
font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}
@supports (font-variant-emoji: emoji) {
.symbol {
font-variant-emoji: emoji;
}
}
Fallback with Variation Selectors
<span>❤️</span>
For characters that support emoji variation sequences, Variation Selector-16 can explicitly request emoji presentation without relying on the CSS property.
Important Consideration
The @supports rule checks whether the browser recognizes the CSS declaration. It does not guarantee that every character can be displayed in the requested style.
For current compatibility information, visit Can I Use? and search for font-variant-emoji.
Specifications
The font-variant-emoji property is defined in the CSS Fonts Module, which describes emoji presentation preferences and their relationship to Unicode character presentation.
CSS Fonts Module Level 4: font-variant-emoji
The Unicode Standard defines emoji presentation properties and variation sequences that influence how characters are displayed.
Unicode Technical Standard #51: Unicode Emoji
For additional explanations and examples, see MDN Web Docs.
