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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 9 Dec 2015 13:06:40 -0800
Message-ID: <CAAWBYDCgguLM=GTZDXJKOiv9bit=gwc66Wp8RO7MNNKSin4AbA@mail.gmail.com>
To: Manuel Rego Casasnovas <rego@igalia.com>
Cc: www-style list <www-style@w3.org>
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

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