Re: [css-flexbox] Fixing a mistake with flex-grow betwen 0 and 1

On 10/08/2013 11:31 PM, Daniel Holbert wrote:
> Consider a case with:
>  <flexbox>
>    <div style="flex: 0.2; width: 5px;"></div>
>    <div style="flex: 0.2; width: 5px; max-width: 5px"></div>
>  </flexbox>
> 
> There, we'd give 20% of the free space to the first flex item, and no
> free space to the second item (due to its max-width).
> 
> Now, if we increase the "flex" on the second item to 1 (still not
> affecting *its* rendering at all due to its max-width), then all of a
> sudden the *first* item will snap up to occupy all of the free space,
> because our flex values sum to more than 1.

(to clarify: technically this discontinuity happens when the flex-grow
on the second item reaches 0.8, not 1; I just picked "1" as a nice round
number that someone might be likely to use, which will definitely push
the total flexibility to be >= 1, regardless of the first item's
fractional flex-grow value.)

Received on Wednesday, 9 October 2013 06:35:18 UTC