WICG / cq-usecases

Use cases and requirements for standardizing element queries.
Other
184 stars 24 forks source link

Require ability to use with <picture>? #38

Closed eeeps closed 6 years ago

eeeps commented 7 years ago

Eventually, I want to be able to do something like:

<picture>
  <source container="(width > 500px)" srcset="original.jpg" />
  <img src="cropped.jpg" />
</picture>

Dunno if it’s worth stating this use case in this document, or whether we should just figure out container-queries-in-CSS first, and then figure out how to plug them into HTML later.

JamesAnunda commented 6 years ago

I say let's figure out the Container-queries first before I start plugging in the HTML.

ZeeCoder commented 6 years ago

I concur, it seems like this'll be a bit harder to figure out too, since media="" can have the implicit target (viewport), while a container query will need to explicitly state what the query should be related to.

eeeps commented 6 years ago

@ZeeCoder You're right that this gets complicated without an implicit target. Implicit targets are a possibility (e.g., cq-prollyfill has ’em), but I agree with both you and @JamesAnunda that they, and this use case, are not important enough to be a requirement.

Tabling this to revisit in the (possibly rather distant) future.