-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Color of badge text #4661
Comments
Hi @runxel, thanks for opening this issue! Do you have an example of badge that reads poorly? |
refs #504 (but not an exact dupe)
Slightly contrived example as you can only use white on a custom badge, but I guess we're trying to avoid stuff like: - https://img.shields.io/badge/hard%20to-read-white We do have some existing code for the logos which tries to avoid light logo/light background and dark logo/dark background combinations e.g: - https://img.shields.io/badge/logo-logo-green?logo=javascript which could potentially be repurposed/generalised if someone is interested in looking at this. |
Exactly, of course I am speaking of badges with custom colors. |
Okay, good to hear that it only seems to be a problem when a user specifies a colour rather than with the default badges we provide. Our specification does mention contrast and background colours, it would probably need some clarification if we decide to vary the text colour as well. What would we do if the left handside of the badge is black and the right handside is white? Would we have two different text colours (white on the left, black on the right)? Thanks for pointing to the existing logo functionality @chris48s, it will probably be useful to whoever picks this up (maybe @runxel would like to pick up the challenge? 😄)! |
Sorry if I was not clear enough in my initial statement, @PyvesB! My bad. Well, I would have a look, but I think I definitely need to get at least some rough pointers where to look 😅 |
Yes, #504 (comment) has screenshots of readable GitHub labels (auto black on pale colour, auto white on dark colour) and the same colour badges (readable white on dark, hard to read white on pale). |
If I'm not mistaken, some of the logo logic lives in this part of the code: Line 85 in a7b7cc0
|
📋 Description
In terms of accessibility it would be great if there would be a threshold of lightness in color so we would get dark text on light badge colors automatically.
They can be extremely hard to read otherwise, which means you need dark and saturated badge colors, which limits the users.
The text was updated successfully, but these errors were encountered: