Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make favicon change color (to something light) when browser or system is in dark mode #66

Open
akarelas opened this issue Dec 9, 2024 · 2 comments

Comments

@akarelas
Copy link

akarelas commented Dec 9, 2024

This is what I see when the search engines appear, when I type something in my Firefox's search box (in the toolbar) when in dark mode (this is hard to see):

dark-icon

An icon can have different color when in dark mode, by doing the following:

  1. make it SVG
  2. inside this SVG, include a <style> element that sets the fill property of the path to a different color depending on color-scheme

Check this for example (it works!):

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
    <style>
        path { fill: #3385ff; }
        @media (prefers-color-scheme: dark) {
            path { fill: #6685ff; }
        }
    </style>
    <path d="M11 17H7q-2.075 0-3.537-1.463T2 12t1.463-3.537T7 7h4v2H7q-1.25 0-2.125.875T4 12t.875 2.125T7 15h4zm-3-4v-2h8v2zm5 4v-2h4q1.25 0 2.125-.875T20 12t-.875-2.125T17 9h-4V7h4q2.075 0 3.538 1.463T22 12t-1.463 3.538T17 17z"/>
</svg>
@Grinnz
Copy link
Owner

Grinnz commented Dec 9, 2024

I think it would be easier just to give it a white background rather than transparent. But thank you for reporting the issue.

@ilmari
Copy link

ilmari commented Feb 20, 2025

I would suggest using the same camel icon that's is used in the navbar as the favicon. It should work well on both light and dark backgrounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants