Re: [csswg-drafts] [css-conditional] [css-contain] `srcset` and `sizes` interaction with container queries (#5889)

> `srcset` and `sizes` interaction with container queries

_One loves to see it_.

I think @joemcgill nailed my thoughts on this, but one thing worries me a little: “lazy load images based on container width” feels like both a sensible default for omitted `sizes` and a powerful feature in the right hands—like, “I want lazyload on this `img` in this CQ, so I’ll skip writing `sizes`” sounds great on a couple of levels.

What worries me is that `sizes` attributes (and please know I mean this with all love for the feature) are a huge pain to write by hand. Understanding the difference between preparse and layout calculation timings is a lot to ask of a junior developer that just wants to put an image on a page, and asking devs to calculate an accurate `sizes` attribute in order to shave off imperceptible-in-the-moment differences in load time could be a tough sell. “You can go to all the trouble of writing a `sizes` attribute and the image shows up quick and looks right, or you can not write `sizes` and the image still shows up quick and looks fine,” y’know?

I’m a little concerned that the lazyloading pattern would end up telephone-gamed into “we don’t need `sizes` in CQ,” and we’d be effectively giving up preload on `srcset`-powered images inside CQ. That said, `srcset` has always felt a little like a stopgap. So, hm.

-- 
GitHub Notification of comment by Wilto
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5889#issuecomment-778282499 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 12 February 2021 16:02:52 UTC