-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark mode image only loads on fresh load #1681
Comments
The bug goes even further. None of the 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 |
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.
|
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 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not stale |
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.
The text was updated successfully, but these errors were encountered: