Theme Sensitive Images in GitHub Markdown
Users can now specify the theme an image is displayed for in Markdown. Appending #gh-dark-mode-only or #gh-light-mode-only to the end of an image url will define whether it’s only shown to viewers using a light or a dark GitHub theme.
Example of Dark theme enablement

Example of Light theme enablement

As described by Stefan Judis in his blog post, you can make a very specific GitHub solution:


This is the solution outlined above.
But with GitHub introducing the picture
element, there is a better way
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./dark.png">
<img alt="Text changing depending on mode. Light: 'So light!' Dark: 'So dark!'" src="./light.png">
</picture>
The first one is not so compatible outside GitHub, the second one is relying on HTML and promises more compatibility, but I guess it depends on toolchain.