W3C home > Mailing lists > Public > www-style@w3.org > March 2015

Re: [css-flexbox] min-height on flex items that have an intrinsic aspect ratio

From: Daniel Holbert <dholbert@mozilla.com>
Date: Mon, 02 Mar 2015 17:16:51 -0800
Message-ID: <54F50B83.3070007@mozilla.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, Philip Walton <philip@philipwalton.com>
CC: fantasai <fantasai.lists@inkedblade.net>, Greg Whitworth <gwhit@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
On 03/02/2015 04:16 PM, Tab Atkins Jr. wrote:
> On Wed, Feb 25, 2015 at 7:13 PM, Philip Walton <philip@philipwalton.com> wrote:
>> On Tue, Feb 24, 2015 at 11:16 AM, Daniel Holbert <dholbert@mozilla.com>
>> wrote:
>>> I prefer the pre-August behavior on this point, because min-content sizes
>>> aren't really a useful lower-bound for flex items with aspect ratios. These
>>> flex items *can* shrink (honoring their intrinsic aspect ratio) below their
>>> min-content size, without overflowing.
>> This makes a lot of sense to me, and I think the example is quite
>> compelling. Given an <img> flex item whose only CSS declaration is `flex: 0
>> 0 50px`, it seems quite strange (and unexpected) to have its rendered size
>> be 300px wide/tall.
> That doesn't happen.  The rules for min-width:auto specifically take
> into account if the item has a definite flex-basis (or it has
> flex-basis:content and a definite width).

Tab -- I think you're mistaken on this.

A definite flex basis (50px in this case) does *not influence*
"min-width:auto".  At least, I don't see anything about that in the spec.

(note: if it *were* considered, then "flex: 1" (i.e. flex: 1 0 0%) would
lose its magic min-size-clamping behavior, which would be bad.)

So I think what Philip said is correct -- this image would indeed end up
at 300px (despite flex: 0 0 50px).

(We might just need to solve this with web-author education/outreach...
The unexpected result makes more sense if you keep in mind that
flex-basis is *just the starting-point* for flexing, and that
min/max-size properties reign supreme, and that min-size defaults to
intrinsic width.)

Received on Tuesday, 3 March 2015 01:17:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:05 UTC