`w`/`h` in `srcset` support
strarsis opened this issue · 1 comments
Describe your problem/question
Can lazysizes
also interpret the h
descriptor for image sizes (srcset
)?
So there may be an image of same width (w
) but different height (h
).
From the discussion #923 it seems that lazysizes
artdirect
plugin can also handle this.
So what I want to do with lazysizes
:
Let lazysizes
calculate the final image dimensions (not possible before rendering due to the nature of the content/layout of that page) and then let it pick the optimal image of width
and height
.
artdirect
allows very fine control but it also requires to specify each width
-height
combination explicitly.
Add tags/keywords
width, height, srcset, w, h, calculate, pick
It seems that the parent-fit
plugin already supports w
and h
descriptors combined in sources (with data-parent-fit="contain"
/data-parent-fit="cover"
):
https://github.com/aFarkas/lazysizes/tree/gh-pages/plugins/parent-fit#object-fit-containcover-usage