Fix for star-history.com chart images#15227
Open
joganubaid wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the global dynamic-theme fixes configuration to improve readability of embedded Star History SVG charts in dark mode by ensuring light-themed charts are inverted while avoiding double inversion for charts already requested in dark theme.
Changes:
- Add an
INVERTrule targetingimgelements whosedata-canonical-srcpoints toapi.star-history.com. - Exclude Star History images that already include
theme=darkindata-canonical-srcvia:not(...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Could you please share an example? Is it worth having this fix for GitHub only, to avoid applying it for every website? |
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.
Fix star-history.com embedded chart images in dark mode.
Star-history.com provides an API that generates SVG charts. When embedded on other sites (like GitHub README), these charts appear as light images on dark backgrounds, making them hard to read.
I was browsing trending GitHub repos at 2 AM (as every good developer does) and noticed star-history charts showing up as bright white blobs. After some investigation, I realized these charts come from api.star-history.com with a data-canonical-src attribute.
This fix:
For developers who somehow missed that theme=dark exists in the API (seriously, it's right there in the README) - your charts will now be readable in dark mode too.