8000 feat: pick <picture> sources and #gh-*-mode-only images by theme by micahhausler · Pull Request #40 · qu8n/mddog · GitHub
[go: up one dir, main page]

Skip to content

feat: pick <picture> sources and #gh-*-mode-only images by theme - #40

Merged
qu8n merged 1 commit into
qu8n:mainfrom
micahhausler:picture-color-scheme
Dec 2, 2026
Merged

qu8n merged 1 commit into
qu8n:mainfrom
micahhausler:picture-color-scheme

Conversation

@micahhausler
@micahhausler micahhausler commented Dec 2, 2026 •
Copy link
Copy Markdown
Contributor

Images with light and dark variants now show the one that matches the theme's color-scheme, as on GitHub. Part of #38.

  • A <picture> shows its first <source> whose prefers-color-scheme query matches, else its <img>.
  • An image whose URL ends in #gh-dark-mode-only or #gh-light-mode-only shows only under a matching theme, and the hidden one is never fetched.
  • Changing the theme picks the variant again.
  • fixtures/color-scheme/README.md shows each form. Its <img> fallback is a magenta image, so a missed source match is easy to spot.

@micahhausler
micahhausler force-pushed the picture-color-scheme branch 2 times, most recently from 45991ac to f13b4c5 Compare December 2, 2026 06:47
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
micahhausler marked this pull request as ready for review December 2, 2026 06:50
@qu8n
qu8n merged commit 8891886 into qu8n:main Dec 2, 2026
6 checks passed
@micahhausler
micahhausler deleted the picture-color-scheme branch December 3, 2026 00:19
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.

2 participants

0