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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM logo color won't change #8248

Closed
gxlpes opened this issue Jul 25, 2022 · 4 comments
Closed

NPM logo color won't change #8248

gxlpes opened this issue Jul 25, 2022 · 4 comments
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas

Comments

@gxlpes
Copy link

gxlpes commented Jul 25, 2022

Are you experiencing an issue with...

shields.io

馃悶 Description

I have some shields.io badges in my GitHub profile that I like to be kept with a white color, but the NPM won't accept the white color or any other color.

The logoColor= method is not working at all.

My line of code inside of a GitHub README looks like this:
![NPM](https://img.shields.io/badge/NPM-2D3136.svg?style=for-the-badge&logo=npm&logoColor=white)

馃敆 Link to the badge

https://img.shields.io/badge/NPM-2D3136.svg?style=for-the-badge&logo=npm&logoColor=white

馃挕 Possible Solution

No response

@gxlpes gxlpes added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Jul 25, 2022
@PaulaBarszcz
Copy link
Collaborator

Hi @gxlpes,

I only just started looking into Shields but I think that I might be able to help :)

You're right, the logoColor doesn't seem to work with npm logo. It is probably because for npm the custom logo is used in Shields.
Related issue:
#6208 (comment)

You can use a white npm logo via base64-encoded custom svg:

https://img.shields.io/npm/v/npm.svg?logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPm5wbTwvdGl0bGU+PHBhdGggZD0iTTEuNzYzIDBDLjc4NiAwIDAgLjc4NiAwIDEuNzYzdjIwLjQ3NEMwIDIzLjIxNC43ODYgMjQgMS43NjMgMjRoMjAuNDc0Yy45NzcgMCAxLjc2My0uNzg2IDEuNzYzLTEuNzYzVjEuNzYzQzI0IC43ODYgMjMuMjE0IDAgMjIuMjM3IDB6TTUuMTMgNS4zMjNsMTMuODM3LjAxOS0uMDA5IDEzLjgzNmgtMy40NjRsLjAxLTEwLjM4MmgtMy40NTZMMTIuMDQgMTkuMTdINS4xMTN6Ii8+PC9zdmc+

NPM

Those were my steps to generate the above link:

  1. Instruction to use custom logos in Shield's badges:
    https://github.com/badges/shields/blob/040b52c1bd3675651de679480b2f179a69970e1f/doc/logos.md#custom-logos

  2. npm's logo in svg format I copied from:
    https://simpleicons.org/?q=npm

  3. I added fill=white to the svg file and used an online base64 encoder on it.

  4. I pasted the generated base64 string into shield's url format for custom badges

@PaulaBarszcz
Copy link
Collaborator

PaulaBarszcz commented Jul 28, 2022

Hi @chris48s,
If this is resolved, who closes the issue - author of the issue or the project maintainers? :)

@chris48s
Copy link
Member

The reason for this is there are a small number of icons where we use a custom multi-coloured icon instead of the monochrome ones from simpleicons. These ones ignore the logoColor param. You're not the first person to be confused by it. I'm going to close this as a duplicate of #6208 - there's more info in there.
We currently have an issue open at #7684 about dropping the custom icons completely but to the extent anyone has expressed a preference, people seem mostly in favour of keeping the custom ones.

@chris48s chris48s closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
@chris48s
Copy link
Member

update: #6208 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas
Projects
None yet
Development

No branches or pull requests

3 participants