css properties font-variant-emoji

The font-variant-emoji CSS property specifies the default presentation style for displaying emojis.

Traditionally, this was done by appending a Variation Selector, U+FE0E for text and U+FE0F for emoji, to the emoji code point. Only emojis listed as contributing to a Unicode emoji presentation sequence are affected by this property.

Syntax

/* Keyword values */
font-variant-emoji: normal;
font-variant-emoji: text;
font-variant-emoji: emoji;
font-variant-emoji: unicode;

/* Global values */
font-variant-emoji: inherit;
font-variant-emoji: initial;
font-variant-emoji: revert;
font-variant-emoji: revert-layer;
font-variant-emoji: unset;

The font-variant-emoji property is specified using a single keyword value from the list below.

Values

normal

Allows a browser to choose how to display the emoji. This often follows the operating system setting.

text

Renders the emoji as if it were using the unicode text variation selector (U+FE0E).

emoji

Renders the emoji as if it were using the unicode emoji variation selector (U+FE0F).

unicode

Renders the emoji in accordance with the Emoji presentation properties. If the U+FE0E or U+FE0F variation selector is present, then it will override this value setting.

Formal definition

Initial valuenormal
Applies toall elements and text
Inheritedyes
Computed valuespecified keyword
Animation typediscrete

Formal syntax

normal | text | emoji | unicode

Examples

Changing the way an emoji is displayed

This example shows how you can render an emoji in its text or emoji presentation.

HTML

<section class="emojis">
  <div class="emoji">
    <h2>text presentation</h2>
    <div class="text-presentation">☎</div>
  </div>
  <div class="emoji">
    <h2>emoji presentation</h2>
    <div class="emoji-presentation">☎</div>
  </div>
</section>

CSS

.text-presentation {
  font-variant-emoji: text;
}

.emoji-presentation {
  font-variant-emoji: emoji;
}

Accessibility concerns

While the use of emojis may seem fun, you should consider their impact on accessibility, specifically for users with visual and cognitive impairments. Consider the following factors while using emojis:

See also