0

You kinda want an orange favicon.

 1 year ago
source link: https://chriscoyier.net/2023/02/10/you-kinda-want-an-orange-favicon/?ref=sidebar
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
February 10, 2023

You kinda want an orange favicon.

You can’t have a white favicon, because, in a lot of situations, you won’t be able to see the dang thing at all. Here’s a default Chrome tab while macOS is in Light mode.

Screenshot-2023-02-10-at-12.23.53-PM.png?w=500&ssl=1
I made the favicon #eee here so you could see the favicon at all.

You can’t have a black favicon, because, in a lot of situations, you won’t be able to see the dang thing at all. Here’s a default Chrome tab while macOS is in Dark mode:

Screenshot-2023-02-10-at-12.26.10-PM.png?resize=529%2C244&ssl=1
The tab isn’t pure black, so you can see the pure black favicon.

No problem, you say, I’ll have the (SVG) favicon respond to dark mode preference:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.3 24.29"> <style> @media (prefers-color-scheme: dark) { path { fill: white; } } </style> ...

Code language: HTML, XML (xml)

Neat idea, and that actually works to change a properly set up SVG favicon fill, but it actually doesn’t help that much in real life. Chrome tabs aren’t only dark because of a system preference, they can also turn dark because the tab is open in an Incognito window. There is no @media query for that! Firefox does something similar right now: when macOS is in Light mode, you get light tabs in normal windows and dark tabs in Private windows.

Bottom line: you have no idea what the tab color behind a favicon will be like. I’ve been using Arc, which encourages you to fart around with themes, which affects the background color behind favicons. I think all browsers support theming of sorts, further proving you just can’t count on what colors are involved.

So: your favicon should be able to withstand any color behind it. That is often done by providing a solid color background right in the favicon itself. Favicons like these should be visible as intended no matter what:

Screenshot-2023-02-10-at-12.39.46-PM.png?resize=505%2C133&ssl=1
MDN and CodePen favicons.

If you want a colored, shaped favicon, you need a color that works on dark and light equally well. Like orange!

Screenshot-2023-02-10-at-12.42.09-PM.png?resize=1024%2C321&ssl=1

Well, until Safari decides to get weird.

CleanShot-2023-02-10-at-12.42.40@2x.png?resize=1024%2C282&ssl=1

Time for a nap.



About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK