Set Windows to light mode and the browser to dark. Now look at the tab. Which color is your favicon, and can you still see it?

A favicon that uses "prefers-color-scheme" has two palettes. The tab has a background of its own. To see how those interact, record three things side by side: the preference reported by the page, the color of the favicon in the tab, and the color behind it.

The same favicon shown as a dark glyph on light and dark tabs, and as a pale glyph on a dark tab.

Illustration of possible outcomes. The test uses the actual tab strip in Chrome and Firefox.

Build the SVG probe

Save this as adaptive.svg. Both palettes use the same shape. The light preference gets dark ink, and the dark preference gets pale yellow.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"> <style> .mark { fill: #25213c; } @media (prefers-color-scheme: dark) { .mark { fill: #f7e8ae; } } </style> <path class="mark" fill-rule="evenodd" d="M8 1 15 8 8 15 1 8ZM8 5 5 8 8 11 11 8Z"/> </svg> 

Save this as index.html in the same folder. The page displays its own media query result and updates the label when that result changes. Compare the label with the favicon you actually see.

<!doctype html> <html lang="en"> <meta charset="utf-8"> <title>Adaptive SVG</title> <link rel="icon" type="image/svg+xml" href="./adaptive.svg"> <p>Page preference: <output id="scheme"></output></p> <script> const scheme = matchMedia('(prefers-color-scheme: dark)'); const output = document.querySelector('#scheme'); const report = () => { output.textContent = scheme.matches ? 'dark' : 'light'; }; scheme.addEventListener('change', report); report(); </script> </html> 

For an optional control, export the same dark mark as fixed.ico. Make a copy of the page named ico.html, change its title to Fixed ICO, and replace the SVG link with this one.

<link rel="icon" type="image/x-icon" href="./fixed.ico"> 

Giving the ICO its own page isolates the fixed artwork from the SVG’s theme switching.

Run two theme changes

From the folder containing the files, run py -m http.server 8000 --bind 127.0.0.1 on Windows. Open http://127.0.0.1:8000/index.html in a normal tab. Open /ico.html too if you made the control.

Start with Change only the browser theme
Windows light + browser light Switch the browser to dark
Windows dark + browser dark Switch the browser to light

Run both cases in Chrome and Firefox using the built-in themes. In Firefox, record the Website appearance setting as well. Keep that setting fixed within each run. Record the browser version and Windows build so someone else can reproduce your setup.

For each change, look at the same tab in the same state (active or inactive). Write down the page preference, the visible favicon color, and the tab background immediately after the switch. Reload the page normally and record them again. Capture the tab at its displayed size so you can judge the contrast as you actually see it.

Read the three signals together

  • The page label changes first. If the favicon follows after a reload, record when it changed. The timing is part of the result.
  • The page label and favicon agree, but the mark is hard to see. Record the actual tab background. The palette can match the reported preference and still give poor contrast in the tab.
  • The fixed ICO is hard to see on one background. Try adding a contrasting backing shape inside the icon and repeat the same two checks. A small solid tile is easy to compare against the transparent version.

This is a test recipe. Its outcome is the combination of preference, color, and background that you observe in each browser version.

For the export and fallback workflow, see The Complete Modern SVG Favicon Set.