If you have an <img>
with srcset
attribute, you can use $0.currentSrc
to get the source the browser chose from the srcset. For background images, you have to use image-set
in CSS. Is there an equivalent to .currentSrc
for the background image with an image-set
?