layout collapsibility

Collapsibility is one these useful layout features that we exposed in tables and now we're trying to do it for flex and grid. The usual way it's used is by crafting selectors that when matched define visibility: collapse etc.

Another usage pattern of collapsibility is based on layout. One pattern I've noticed is when authors layout elements off-screen and then apply collapsing to elements based on the used style. My hope is that we can come up with a way that would enable layout to handle collapsibility automatically. To do that we can introduce a min-width-collapse, min-height-collapse properties. The property would trigger collapsing if the width or height available for the element's box during layout is less than the used value of the property.

min-width-collapse: <length> | <percentage> | inherit
min-height-collapse: <length> | <percentage> | inherit

For the purposes of shrink-to-fit the new definition would most likely imply the following change to preferred minimum and preferred width:

* preferred minimum width = (min-content >= min-width-collapse) ? min-content : 0
* preferred width = (max-content >= min-width-collapse) ? max-content : 0

With the above change the shrink-to-fit width should still be computable as defined in CSS 2.1 or the CSS 3 sizing spec.
min(max(preferred minimum width, available width), preferred width)

We'll have to deal with ordering of collapsing which by default could be document order.

Thanks,
Rossen

Received on Monday, 27 January 2014 23:03:31 UTC