W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2017

Re: [csswg-drafts] [css-contain-1] do we need layout containment in a single dimension to enable container queries?

From: Martin Auswöger via GitHub <sysbot+gh@w3.org>
Date: Wed, 19 Apr 2017 09:52:45 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-295194732-1492595563-sysbot+gh@w3.org>
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 `size-x` would be the value for containment across the X axis):

	.wrapper { height: 100px; overflow-y: auto }
	.component { contain: size-x }
<div class="wrapper">
	<div class="component">
		Content that grows in height via a container query script
		when the width gets wider.

In an edge case this could still lead to an endless loop I think: The width of `.component` depends on the content-with of `.wrapper` and the content-width of `.wrapper` depends on the height of `.component` (because of the scrollbar). This means that the width of `.component` would still depend on its contents even though `contain: size-x` is set.

GitHub Notification of comment by ausi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1031#issuecomment-295194732 using your GitHub account
Received on Wednesday, 19 April 2017 09:52:51 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:11 UTC