A commit that landed in Chromium (and which will be available in Chrome 80) is support for SVG favicons. 🎉
🦊 Firefox already has support for SVG favicons, ever since version 41
Since most (all?) browsers always make a request to
favicon.ico you can also serve an SVG at that location with the
image/svg+xml MIME Type – As per tip by Mathias
Above that it’s also possible to use
prefers-color-scheme in your SVG icon, thus supporting Light/Dark Mode:
🎉 Chrome now accepts SVG favicons (crbug.com/294179#c73), which means you can style your icon with inline `prefers-color-scheme` and you'll get two icons for the price of one!
Demo: 🌒 dark-mode-favicon.glitch.me/ ☀️
— Thomas Steiner (@tomayac) November 20, 2019
🐛 There’s on small bug though: you need to refresh the page after changing to/from Dark Mode for the favicon to change.
Leave a comment