DEV Community

Discussion on: Switch to a darker image when on dark mode!

Collapse
toheeb profile image
Toheeb Ogunbiyi

One other option is to use prefers-color-scheme within an inline SVG. Good for icons.

You could also use inline SVG to wrap images and add theme effects on the SVG.

  • No need for the browser to load another image. One image that responds to the page's theme through its SVG wrapper.
  • SEO still intact,