Re: [css-grid] fr-unit section clarification

On Tue, Nov 24, 2015 at 9:16 AM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
> Hi,
>
> I think we should add some clarification in this section:
> https://drafts.csswg.org/css-grid/#fr-unit
>
> If you read this:
> "Each column or row’s share of the free space can be computed as the
> column or row’s <flex> * <free space> / <sum of all flex factors>."
>
> And you've just one track with "0.5fr" in a 800px width grid container.
> You might consider that the result should be:
>         0.5 * 800 / 0.5 = 800
>
> But this is wrong, if you go to the section:
> https://drafts.csswg.org/css-grid/#algo-find-fr-size
>
> Where you can read this:
> "Let flex factor sum be the sum of the flex factors of the flexible
> tracks. If this value is less than 1, set it to 1 instead."
>
> So the good result is:
>         0.5 * 800 / 1 = 400
>
> I think it'd be nice to explain it properly in the "fr-unit section" or
> at least link to "flex factor sum" from there.

Good catch.  I added a note, explaining that it was similar to Flexbox.

~TJ

Received on Wednesday, 9 December 2015 21:07:27 UTC