arguiot / g-emoji-element

Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<g-emoji> element

Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.

Installation

$ npm install @github/g-emoji-element

Usage

import '@github/g-emoji-element'
<g-emoji fallback-src="t-rex.png" alias="T-Rex">🦖</g-emoji>

If a browser supports emoji, nothing happens. If a browser does not support emoji, a fallback image tag is created:

<g-emoji fallback-src="t-rex.png" alias="T-Rex">
  <img class="emoji" alt="T-Rex" height="20" width="20" src="t-rex.png">
</g-emoji>

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

About

Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.

License:MIT License


Languages

Language:JavaScript 100.0%