DEV Community

Cover image for Favicons in 2022: you only need 1 SVG favicon
Marco Colli
Marco Colli

Posted on

Favicons in 2022: you only need 1 SVG favicon

The time has come to end the favicon craziness... Starting from 2022 it makes sense to use only 1 favicon in SVG format.

Is it a dream? No, it's real. This simple solution works for modern browsers.

Simply use an SVG favicon:

<link rel="icon" href="/icon.svg">
Enter fullscreen mode Exit fullscreen mode
  • Supported by major browsers (except Safari in 2021) and Living Standard
  • Only 1 short line of code and simple to remember
  • Other attributes like type and sizes are not necessary
  • Scales much better at any size compared to PNG
  • Let's end the favicon craziness with hundreds of different sizes...

I have already used this strategy for our latest website (cuber.cloud) and it works perfectly on Chrome and other major browsers. You can test it yourself. Just 1 favicon for all browsers and all sizes!

For Apple Safari, the only missing browser, let's ask them to become standard-compliant... (btw, they are becoming the new IE). You can send a tweet to @webkit for feature requests (they suggest that on their official bug tracker).

Top comments (1)

Collapse
 
thaikolja profile image
Kolja Nolte

You forgot to switch to an alternative favicon when using dark mode.