diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Emoji.svelte | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/Emoji.svelte b/src/lib/Emoji.svelte new file mode 100644 index 0000000..0e8f4a7 --- /dev/null +++ b/src/lib/Emoji.svelte @@ -0,0 +1,25 @@ +<!-- + @component + + All the emojis inside this component will be turned into Twemojis. +--> +<script lang="ts"> + import { twemojiHtml } from './utils' + + export let value: string +</script> + +<span> + {@html twemojiHtml(value)} +</span> + +<style> + :global(.emoji) { + position: relative; + /* we specify the width so it doesn't change size when the image shows up */ + width: 1em; + height: 1em; + vertical-align: text-bottom; + bottom: 0.1em; + } +</style> |