Skip to content

Latest commit

 

History

History
90 lines (63 loc) · 2.2 KB

README.md

File metadata and controls

90 lines (63 loc) · 2.2 KB

PostCSS Color Emoji PostCSS

✏ Emoji in full color!

NPM Version Build Status Dependency Status

Depending on the font, some emojis are rendered as their text variation instead of the colored version you know and love. This PostCSS plugin gives you full access to the system emojis on macOS, Windows, and Linux.

/* Input */
.example {
  font-family: color-emoji;
}
/* Output */
.example {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

Check out the visual test.

Install

# npm
npm install --save-dev postcss postcss-color-emoji

# or yarn
yarn add --dev postcss postcss-color-emoji

Usage

Add it to your PostCSS work-flow, whatever way you choose to.

// Using a postcss.config.js
const colorEmoji = require('postcss-color-emoji');

module.exports = {
  plugins: [
    colorEmoji
  ]
};

Then use the color-emoji font-family name where ever you need it.

.one {
  font-family: sans-serif, color-emoji;
}
/* Using custom properties */
:root {
  --emoji: color-emoji;
}

.two {
  font: var(--emoji);
}

Credits