Open evoactivity opened 1 year ago
The bug goes even further. None of the <source>
elements will be used but the fallback <img>
.
Markdown source:
<picture>
<source media="(prefers-color-scheme: dark)" type="image/avif" srcset="...">
<source media="(prefers-color-scheme: light)" type="image/avif" srcset="...">
<img src="..." alt="">
</picture>
First (or refresh) load (works correctly, shows the first source):
<picture>
<source media="(prefers-color-scheme: light),(prefers-color-scheme: dark)" type="image/avif" srcset="..." class="source-dark">
<source media="not all" type="image/avif" srcset="..." class="source-light">
<img src="..." alt="" style="visibility:visible;max-width:100%;">
</picture>
Navigate back (works incorrectly, shows the fallback img):
<picture>
<source media="not all" type="image/avif" srcset="..." class="source-dark source-light">
<source media="not all" type="image/avif" srcset="..." class="source-light">
<img src="..." alt="" style="visibility:visible;max-width:100%;">
</picture>
We also experience this behavior. It seems to work with the Sync with system setting but not when manually selecting a single dark theme.
On page navigation, GitHub renders the media query as not all
, as @osiegmar pointed out.
Just noticed this seems resolved now? If others confirm I'll close this issue.
Just noticed this seems resolved now? If others confirm I'll close this issue.
Just tried again, doesn't seem fixed on my side. It works when using Sync with system but not when manually selecting a dark theme.
I have the Dark Default theme manually selected, but I also have several feature previews turned on that may be where the fixes are.
Hmm... Still happening here. Maybe they're currently rolling out changes?
I played with it a bit more, seems inconsistent, sometimes it loads the correct image.
I created a repository for demonstration purposes including steps to reproduce: https://github.com/osiegmar/github-dark-mode-bug
Feel free to send pull requests if you know more scenarios.
Stale issue message
This is still true as of July 2024 😊
Stale issue message
Still an issue
As can be seen in this repo README logo file , click on issues then back to code and the light image will be loaded instead of dark.