fix: replace deprecated #gh-dark-mode-only fragments with <picture> element in Responsive Card Theme preview#4884
Conversation
…lement in Responsive Card Theme preview The two preview images at the top of the "Responsive Card Theme" section used the old #gh-dark-mode-only / #gh-light-mode-only URL fragment syntax, which GitHub no longer renders. They also had malformed double anchors in their link hrefs (#responsive-card-theme#gh-dark-mode-only). Replaced with the <picture> + prefers-color-scheme approach that the section itself documents as the correct modern method. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Gilmoursa is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
…cture> element The live example in the 'Use GitHub's theme context tag' details block used the deprecated #gh-dark-mode-only / #gh-light-mode-only URL fragment syntax, which GitHub no longer renders, causing broken images. Replaced with the <picture> + prefers-color-scheme approach, consistent with the fix applied to the Responsive Card Theme section preview. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the PR, but it seems the problem with the mentioned images is not the dark-mode/light-mode fragment. The problem is that the server is down and doesn't serve any images. We can see e.g. here that the dark-mode/light-mode fragments work. Or did I miss something? |
|
Good catch on the server outage — you're right that the preview images are currently broken because of that, not purely the fragment syntax. That said, GitHub's documentation does explicitly mark |
|
Good point. I agree that we should anyway recommend the I have created a PR in github-stats-extended. Because maintenance of this project has moved to https://github.com/stats-organization/github-stats-extended (see #3851 (comment) for context).
Could you point me to this documentation please? |
|
Sorry for the overstatement. It's not explicitly deprecated. The sources I was using were third-party blog posts, not GitHub's docs. The |
What
Two locations in the README had broken images caused by the deprecated
#gh-dark-mode-only/#gh-light-mode-onlyURL fragment syntax, which GitHub no longer renders:#responsive-card-theme#gh-dark-mode-only)<details>blockFix
Replaced both instances with
<picture>elements usingprefers-color-schememedia queries — the same approach the README itself documents as the correct modern method in the "Use GitHub's new media feature" subsection.The catbox.moe screenshots in the Vercel setup guide were also audited and confirmed still live (all returning HTTP 200).
Testing
Verified locally that the
<picture>syntax matches the working examples already present in the "Use GitHub's new media feature" subsection.