Updates favicons to support dark mode#1185
Merged
XAMPPRocky merged 1 commit intorust-lang:masterfrom Jul 12, 2020
Merged
Conversation
Contributor
Author
|
@XAMPPRocky I spent some time trying to figure out how to manipulate the SVG to support what you've requested. I believe the SVG needs additional elements to support a border and fill. Unfortunately, my SVG knowledge stops here. If someone else can create the SVG with the additional elements, I can apply the CSS appropriately. |
Contributor
|
@sl4m I suspected that would be case. Either way I think this fine to merge Thank you for your PR and congrats on your first contribution! |
Author
|
@XAMPPRocky What are your thoughts about propagating these changes to other repos that are associated with rust-lang.org's subdomains? This is not a complete list, but I'm thinking:
|
Contributor
|
I think it would be fine to make a PR for each of those. |
This was referenced Jul 15, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-schemeCSS 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:

