Skip to content

Instantly share code, notes, and snippets.

@danielsebesta
Last active September 22, 2023 14:36
Show Gist options
  • Save danielsebesta/24a28fdaa30834f856d512b813006553 to your computer and use it in GitHub Desktop.
Save danielsebesta/24a28fdaa30834f856d512b813006553 to your computer and use it in GitHub Desktop.
I use this code when I want to use Twemoji on a website πŸ˜€
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Twemoji html</title>
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
<script>
window.onload = function() {
twemoji.parse(document.body,
{folder: 'svg', ext: '.svg'}
);
}
</script>
<style>
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
pointer-events: none
}
</style>
</head>
<body>
<p>Some emojis lol 😎 🀯</p>
</body>
</html>
@MisterChaneb
Copy link

Hey thanks for this it was pretty helpful it was the only config on the internet lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment