2 ms·
So long as the <picture> and <source> tags and the media attribute are whitelisted, you can do this: <picture> <source src=screenshot-dark.png media="(pr
by chrismorgan 6y ago
So long as the <picture> and <source> tags and the media attribute are whitelisted, you can do this:
<picture>
<source src=screenshot-dark.png media="(prefers-color-scheme: dark)">
<img src=screenshot-light.png>
</picture>
And then if the site is doing dark mode toggling by some means other than `@media (prefers-color-scheme: dark)`, it can go through and rewrite the media queries in all user-generated content, e.g. to change that one to media="all" in dark mode or media="not all" in light mode.
- deleted 6y ago[deleted]