<picture> with prefers-color-scheme media query
Brad Frost combined
Dark mode imagery
Why not use some other media queries in <picture>
?
<picture>
<source srcset="dark.jpg" media="(prefers-color-scheme: dark)">
<img src="original.jpg">
</picture>
Let's see it in action:

element with a prefers-color-scheme
media query.Try it using your OS preferences for dark mode!
I applied some really minimal dark-mode CSS to this page to help visualize the effect. Maybe having this post public will give me the motivation to clean it up and make it site-wide 😜
The WebKit blog has a similar example in their introductory post on dark mode support.
Webmentions
Have you linked to this page from your site? Submit your URL and it will appear below.