Updates favicons to support dark mode #1185
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #1157 using only
prefers-color-scheme
CSS media query. This was tested on the latest Firefox, Chrome, and Microsoft Edge.I modified the existing favicon.svg to include CSS that will detect the system color scheme and appropriately apply the CSS. It seems the order in which the icons are referenced in the template matters, so I've re-ordered them in a way that worked during testing. For browsers that do not support SVG, it falls back on the modified png favicons which now have a white background and works on either system color scheme. Also, the reference to favicon.ico has been removed in the template as it will take precedence over all other available favicons.
I'm happy to make these changes for all the other repos that use the Rust logo favicon. I believe it is:
Chrome / Microsoft Edge:
Firefox:
PNG fallback: