dark-mode

Dark mode favicons: ship a dark icon without breaking light mode

A single favicon can disappear on dark tabs. Use a light and dark variant with media queries and keep a safe fallback.

FaviconMaker Editorial Team

2 min read
#dark-mode#setup
Share this guide
Dark mode favicons: ship a dark icon without breaking light mode
On this page8 sections

If your favicon looks fine on a light browser theme but disappears on a dark theme, the icon is usually too dark (or transparent) for the tab UI.

You do not need hacks. Modern browsers support switching icons via a media attribute:

  • Generate a light and dark set: Favicon Generator (enable the "Dark variant" option)

The pattern to use (safe default + dark override)

Always provide a default icon first. Then add a dark-mode-specific icon that only applies when the OS/browser prefers dark.

Example:

<!-- Default (used by everyone) -->
<link rel="icon" type="image/x-icon" href="/favicons/favicon.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32.png" />

<!-- Dark mode override (only applies in dark mode) -->
<link
  rel="icon"
  type="image/x-icon"
  href="/favicons/favicon-dark.ico"
  media="(prefers-color-scheme: dark)"
/>
<link
  rel="icon"
  type="image/png"
  sizes="32x32"
  href="/favicons/favicon-dark-32.png"
  media="(prefers-color-scheme: dark)"
/>

This keeps a safe fallback for browsers that ignore media on icons, while still giving modern browsers a better dark-tab icon.

How to generate dark variants quickly

  1. Open the Favicon Generator.
  2. Upload your logo (or use text initials).
  3. Enable "Dark variant".
  4. Download the ZIP and copy files into your chosen folder (for example, /favicons).
  5. Paste the generated snippet.

The snippet includes the dark-mode media attributes when dark variants are present.

What makes a good dark-mode favicon

  • Keep the icon simple. Tabs are tiny.
  • Increase contrast; avoid dark-on-transparent.
  • Add padding so the mark does not touch the edges.

If you are using a text favicon, pick a background and foreground that both read well on dark tabs.

Common mistakes

Only shipping the dark icon

If you only ship a media="(prefers-color-scheme: dark)" icon and no default icon, some browsers may show nothing.

Always include a default icon first.

Testing without clearing caches

Favicons are cached aggressively. Test in an incognito window and hard reload.

If you are stuck, use this checklist:

Verify it is working

Run the Favicon Checker on your live URL. It will show which icon URLs are present and whether they are reachable.

Put this guide into practice

Build a complete favicon pack, then test the live result before you ship.

Written by

FaviconMaker Editorial Team

Practical favicon guidance for designers, developers, and site owners, with a focus on files you can verify in production.

Follow new guides via RSS

Worth sharing?

Send this guide to someone fixing their site icon.

Keep learning

wix3 min

How to Change Favicon on Wix

Step-by-step: change your Wix favicon from the dashboard Settings, understand Premium + domain requirements, choose the right file format/size, and troubleshoot caching and Google display.

Read guide
shopify4 min

How to Change Favicon on Shopify

Step-by-step: change your Shopify store favicon via Theme settings, pick the right 16×16/32×32 image, understand plan limitations, and fix common caching and Google display issues.

Read guide
wordpress4 min

How to Change Favicon in WordPress

Step-by-step: set (or change) your WordPress Site Icon / favicon in WordPress 6.5+ and older versions, choose the right image size, and troubleshoot caching and Google search display.

Read guide