Repository navigation
feat: pick <picture> sources and #gh-*-mode-only images by theme - #40
Merged
Merged
Conversation
micahhausler
force-pushed
the
picture-color-scheme
branch
2 times, most recently
from
December 2, 2026 06:47
45991ac to
f13b4c5
Compare
A <picture> now shows the first <source> whose prefers-color-scheme media query matches the theme's color-scheme, falling back to its <img> when none does. Images whose URL ends in #gh-dark-mode-only or #gh-light-mode-only show only under a matching theme, as on GitHub. A theme change picks the variant again.
micahhausler
marked this pull request as ready for review
December 2, 2026 06:50
micahhausler
force-pushed
the
picture-color-scheme
branch
from
December 2, 2026 06:50
f13b4c5 to
5c44499
Compare
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.
Images with light and dark variants now show the one that matches the theme's
color-scheme, as on GitHub. Part of #38.<picture>shows its first<source>whoseprefers-color-schemequery matches, else its<img>.#gh-dark-mode-onlyor#gh-light-mode-onlyshows only under a matching theme, and the hidden one is never fetched.fixtures/color-scheme/README.mdshows each form. Its<img>fallback is a magenta image, so a missed source match is easy to spot.