Skip to content

Remove dark-mode handling from PyPI-uploaded README#2422

Merged
charliermarsh merged 2 commits intomainfrom
charlie/read
Jan 9, 2026
Merged

Remove dark-mode handling from PyPI-uploaded README#2422
charliermarsh merged 2 commits intomainfrom
charlie/read

Conversation

@charliermarsh
Copy link
Member

Summary

This matches the approach we use in Ruff.

Closes #2322.

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

Wait what? I thought I tested this by just using a light-mode image and GitHub automatically switches the text rendering in dark mode.

If I go to PyPI, I can see the text fine?

Screenshot 2026-01-09 at 1 22 55 PM

@charliermarsh
Copy link
Member Author

You can't see it if you enable dark mode:

Screenshot 2026-01-09 at 2 24 57 PM

@charliermarsh
Copy link
Member Author

Because our media query will switch the text to white, but the rest of the PyPI page doesn't adapt.

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

Note I intentionally removed the complicated handling from Ruff because it wasn't necessary, so please wait to merge this.

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

There is no media query though? It's just <img alt="Shows a bar chart with benchmark results." width="500px" src="./docs/assets/ty-benchmark-cli.svg">?

You're referring to the embedded query?

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

You're saying this occurs if you visit PyPI with dark mode enabled?

@charliermarsh
Copy link
Member Author

You're saying this occurs if you visit PyPI with dark mode enabled?

Yes.

You're referring to the embedded query?

Yeah, there's CSS within ty-benchmark-cli.svg. I removed it in this PR.

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

Thanks for clarifying. I missed #2422 (comment)

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

I think I'd prefer to retain the adaptive image and add a static light image and just replace the single URL on publish? Then we don't need a srcset and don't need to replicate that in the replacement code?

@charliermarsh
Copy link
Member Author

That's fine with me, I'll do a pass on it.

@zanieb
Copy link
Member

zanieb commented Jan 9, 2026

Thank you!

@charliermarsh charliermarsh merged commit c5d2a86 into main Jan 9, 2026
12 checks passed
@charliermarsh charliermarsh deleted the charlie/read branch January 9, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make some background for the benchmark image

2 participants