Description
Apologies if I'm not correctly following the format of this repo (should I do a PR and write some code instead of creating an issue?)
Over in the Container Queries repo there's an issue discussing syntax, which morphed into (among other things) a discussion of images. The issue I presented was that the sizes
attribute in <img/>
would need to support container queries, at which point @aFarkas pointed out that that wasn't necessary, as sizes
is only needed at parse-time (when container queries may not yet be available). We both came to the conclusion that a possible solution would be to defer selection of the right image until afterwards (when layout information is available).
So here's my use case then: I'm using the wonderful new container queries everywhere, hence I don't know beforehand how big an image will be relative to the viewport (because it's sized relative to its container instead). I want the right image to be pulled from srcset
once layout has been calculated, and I don't want any image to be downloaded until then.
In this case (I apologies for jumping directly from use case to implementation) it would make sense to require either sizes
or defer
/lazysize
(but not both) on an image that has dimension-based choices in srcset
.