Re: [csswg-drafts] [css-conditional] Applying styles based on an elements size (@media for elements) (#3852)

@imkremen my understanding is that there are two proposals that just might work:

1. Something based on `contain: size`’s behavior. This is pretty restrictive; we would certainly want single-axis size containment in order to allow elements to grow in the non-queried dimension to fit whatever content is placed within them.

2. Querying the space *available* for the element, rather than its actual size.

- https://twitter.com/bfgeek/status/1129500004630970368
- https://github.com/WICG/container-queries/issues/12

This lets you query any element without restricting or modifying its layout, but is, I think, harder for authors to "see," and reason about. There may be other fundamental issues with how this strategy would restrict layout performance, which @bfgeek discussed in the Twitter thread, and which I won't pretend to understand.

Basically: an author writes a potentially circular container query. Do we want that query to change (or require changes to) the actual layout of the element, to remove the potential of infinite loops? Or do we want to query something other than the element's size, in order to remove that potential?

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

Received on Saturday, 1 June 2019 18:12:43 UTC