I bet a lot of us tend to have the production website and the development website up simultaneously a lot. It’s almost a developer cliché at this point to make some local change, refresh, refresh, refresh, refresh, and just not see the change, only to discover you were looking at the production website, not your local development website.
It’s just funny at first, but it’s frustrating if it happens a lot. It’s also totally avoidable by having an obvious visual¹ difference between the two sites. An easy way to do that? Different favicons.
There is no real trick to this. I literally just have a different favicon.ico
file in development than I do in production. On this (WordPress) site, I only version control and deploy the wp-content
folder, which is not the root of the site where the favicon lives. Any files at the root I have to manually SFTP in to change. I simply changed my local version, and there it sits, being all different.
Other trickery
- Just don’t have a local favicon so it shows the default logo thing for that browser. Different enough.
- A dynamic SVG file that shows the branch name (Whaaat?!)
- Chrome has an experimental “tab groups” feature. Have different tab groups for dev vs. prod.
- Use a browser extension to add title prefixes.
- Use a browser extension to automatically colorize favicons based on URL matches.
Speaking of favicons…
This has me wondering what best practices for favicons are in 2020, at least for garden variety content websites like this.
I hate to say it, but I don’t really care about what the icon is when someone adds this site to the home screen on an iPad, ya know? Aside from one fellow who wanted a copy of the whole database to use the site offline to teach prisoners, nobody has ever asked me about “installing” CSS-Tricks.
Nor do I care about the tile color on a Windows 8 tablet or to customize the color of the browser chrome on Android. That kinda stuff tends to be part of the process when “generating” favicons.
I do care that the favicon looks good on high-resolution displays (a 32×32 graphic isn’t much of a splurge). I like the idea of SVG favicons. I like the idea of making sure dark mode is handled. I like the idea of doing this with as little code and files as possible. Anyone dig into this lately and want to enlighten me?
- “Visual” difference. Hm. I wonder what could be done for developers with visual impairments? Ideas?