Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container queries and responsive images #1

Open
pdaoust opened this issue Jul 6, 2015 · 0 comments
Open

Container queries and responsive images #1

pdaoust opened this issue Jul 6, 2015 · 0 comments

Comments

@pdaoust
Copy link

pdaoust commented Jul 6, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant