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

Re: [css-flexbox] intrinsic size algorithm

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 11 May 2015 20:47:17 -0700
Message-ID: <555177C5.6030908@inkedblade.net>
To: www-style@w3.org
On 05/11/2015 12:14 AM, Christian Biesinger wrote:
> Hi there!
>
> So Ojan and I were looking again at
> http://dev.w3.org/csswg/css-flexbox/#intrinsic-sizes
>
> What is the broader issue that this complex algorithm is trying to
> solve? In particular, why is it better than just summing up the flex
> bases (if definite) or the max-content contributions (otherwise)?

Its goal is to preserve the flex ratios. E.g. if you have (using Ahem)

<flexbox>
   <item flex:1>A A</item>
   <item flex:2>B B</item>
</flexbox>

and ask it to shrinkwrap, you probably want A to lay out at 3em
and B to lay out at 6em.

Without this rule, the boxes would lay out at 2em and 4em, respectively,
causing the text in A to wrap even though there is plenty of space to
lay out at its max-content size.

> Maybe a note can be added explaining that?

Yeah, we can take that as an action item.

~fantasai
Received on Tuesday, 12 May 2015 03:47:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:54 UTC