Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[css-contain-1] do we need layout containment in a single dimension to enable container queries? #1031
Comments
dbaron
added
the
css-contain-1
label
Feb 14, 2017
dbaron
changed the title from
[css-contain-1] do we need layout containment in a single dimension to enable container queries
to
[css-contain-1] do we need layout containment in a single dimension to enable container queries?
Feb 14, 2017
|
Specifically, what would be needed is 1d |
|
I think container queries require both size containment and layout containment. |
|
I agree. What I meant is that you should be able to apply regular layout containment (which we already have) together with 1d size containment (which we don't) to get the effect you described. So authors need both, but the WG only needs to add 1d size containment, since we already have the rest. |
frivoal
referenced this issue
Feb 21, 2017
Closed
[css-contain-1] Make It easier to use contain: size in cases where the size is unknown #1043
css-meeting-bot
commented
Apr 19, 2017
|
The CSS Working Group just discussed , and agreed to the following resolutions:
The full IRC log of that discussion
|
frivoal
added
css-contain-2
css-contain-1
and removed
css-contain-1
labels
Apr 19, 2017
ausi
commented
Apr 19, 2017
|
I would really like this feature to help container query scripts to solve the recursion issue. But is size/layout containment in one dimension even possible? Take, for example, the following structure (assuming that <style>
.wrapper { height: 100px; overflow-y: auto }
.component { contain: size-x }
</style>
<div class="wrapper">
<div class="component">
Content that grows in height via a container query script
when the width gets wider.
</div>
</div>In an edge case this could still lead to an endless loop I think: The width of |
dbaron commentedFeb 14, 2017
One thing that came up at the extensible Web summit in Boston on Friday was a discussion of container queries.
While I'd previously suggested tying container queries to CSS containment, one thing I realized is that there will be cases where developers want to fix the width from the outside but still allow an auto height, and then do media queries on the container's width.
I haven't thought this through very much, but it seems to me that this may require a concept of layout containment in a single dimension to be exposed from containment.