Skip to content

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Aug 22, 2025

Add a json file for badge to the main repo (a la ruff)
See #10593

Here is it rendered: image

  • Closes Xarray Badge #10593
  • [NA] Tests added
  • [NA] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [NA] New functions/methods are listed in api.rst

ianhi and others added 2 commits August 22, 2025 12:35
Co-authored-by: pierre-manchon <pierre-manchon@users.noreply.github.com>
@ianhi ianhi mentioned this pull request Aug 22, 2025
@ianhi ianhi force-pushed the badge branch 2 times, most recently from 89579b4 to 44d258d Compare August 22, 2025 16:50
@ianhi
Copy link
Contributor Author

ianhi commented Aug 22, 2025

I'm worried that the white text on that background does not pass the accessibilty contrast guidelines but im a little confused because 4a4a4a seems to be a much grayer color so im not sure why the text is showing up white

@VeckoTheGecko
Copy link
Contributor

VeckoTheGecko commented Sep 8, 2025

4a4a4a seems to be a much grayer color

4a4a4a is for the left side (labelColor) not the font

labelColor string
Background color of the left part (hex, rgb, rgba, hsl, hsla and css named colors supported).

Example: abcdef
docs

Font colour isn't configurable badges/shields#504 (comment) - best to just choose a different background colour if it doesn't meet accessibility requirements I think

@ianhi
Copy link
Contributor Author

ianhi commented Sep 8, 2025

I found the logic in shields where they change the text color based on background and unforuntately the threshold they chose does not match up with accessibility guidelines. You can see the original verison of this PR here:

https://ianhuntisaak.com/shields-color-contrast/?color=59c7d6

But an Xarray logo primary color does pass: https://ianhuntisaak.com/shields-color-contrast/?color=0e4666

as does: https://ianhuntisaak.com/shields-color-contrast/?color=b3dfe5

So a question is if we want a dark or light background (and the opposite text)

@max-sixty
Copy link
Collaborator

cool!

can we put it outside the root? the root is really busy already (would like to slim it down a bit more), and GH displays all root files before the readme content...

@ianhi
Copy link
Contributor Author

ianhi commented Sep 8, 2025

I'm not sure the best place to put it, but sure. Maybe under "doc"?

@ianhi
Copy link
Contributor Author

ianhi commented Sep 8, 2025

I moved it to the doc directory, and also updated the colors to be accessible: image

@max-sixty max-sixty merged commit 66ba0a9 into pydata:main Sep 8, 2025
35 of 37 checks passed
@ianhi ianhi deleted the badge branch September 8, 2025 18:20
@VeckoTheGecko VeckoTheGecko mentioned this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants