<picture> in Markdown ignores GitHub theme in the new UI (themed-picture is not loaded) #210469
Replies: 3 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Until 
These don't rely on JavaScript. GitHub's stylesheet hides one of the two based on its own |

Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Code Search and Navigation
Body
In the new repository UI, Markdown images that use
<picture>withprefers-color-schemefollow the OS theme instead of the GitHub theme. With GitHub set to Light and the OS set to Dark, the README shows the dark image on a light page. This used to work.Steps to reproduce
Set GitHub appearance to Light and the OS to Dark.
Open a README that uses the documented pattern, e.g. azat-io/todoctor:
Expected behavior
The light image is shown, as described in Adding an image to suit your visitors.
Details
The rendered HTML still wraps the picture in
<themed-picture>, but in the new UI this element is never defined:customElements.get('themed-picture')returnsundefined, and its chunk is never requested. So themediaattributes are not rewritten, and the browser falls back to the OS preference. The classic UI loads this element viaelement-registry.All reactions