Are you using SVG favicons yet? A guide for modern browsers.

Antoine Boulanger
Apr 19 · 3 min read
Image for post
Image for post
Image for post
Image for post

Icon

<link rel="icon" href="favicon.svg">

Mask icon

<link rel=”mask-icon” href=”mask-icon.svg” color=”#000000">

Touch icon

<link rel="apple-touch-icon" href="apple-touch-icon.png">

Manifest

{
"name": "Starter",
"short_name": "Starter",
"icons": [{
"src": "google-touch-icon.png",
"sizes": "512x512"
}],
"background_color": "#ffffff",
"theme_color": "#ffffff",
"display": "fullscreen"
}
<meta name="theme-color" content="#ffffff">

Done

Everything else

Image for post
Image for post

Dark mode

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<style>
path {
fill: #000;
}
@media (prefers-color-scheme: dark) {
path {
fill: #fff;
}
}
</style>
<path fill-rule="evenodd" d="M0 0h16v16H0z"/>
</svg>
Image for post
Image for post

Result

<meta name="theme-color" content="#ffffff">
<link rel="icon" href="favicon.svg">
<link rel="mask-icon" href="mask-icon.svg" color="#000000">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="manifest" href="manifest.json">

The Startup

Medium's largest active publication, followed by +685K people. Follow to join our community.

By The Startup

A newsletter that delivers The Startup's most popular stories to your inbox once a month. Take a look

Create a free Medium account to get Top Stories in your inbox.

Antoine Boulanger

Written by

Front-end Engineer

The Startup

Medium's largest active publication, followed by +685K people. Follow to join our community.

Antoine Boulanger

Written by

Front-end Engineer

The Startup

Medium's largest active publication, followed by +685K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store