This content originally appeared on DEV Community and was authored by Callum
Emojis are everywhere nowadays. I created perpetual.pizza 7+ years ago now and tend to update it every year or so. I never liked the old pizza favicon and decided to try replacing it with an emoji.
SVG favicons are now widely supported supported and I have been experimenting with the possibilities recently. I ended up finding an elegant solution for creating an emoji favicon.
It turns out that you can use emojis inside of SVG text and also use relative units to size the emoji correctly.
Here's the markup for my icon:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<text y="0.9em" font-size="90">?</text>
</svg>
I added it into the document head like a regular SVG icon:
<link rel="icon" href="/assets/icon.svg" />
Here's the outcome:
This content originally appeared on DEV Community and was authored by Callum

Callum | Sciencx (2021-07-06T11:49:43+00:00) Emoji Favicons are a thing now ?????. Retrieved from https://www.scien.cx/2021/07/06/emoji-favicons-are-a-thing-now-%f0%9f%9a%80%f0%9f%9a%80%f0%9f%9a%80%f0%9f%9a%80%f0%9f%9a%80/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.