Re: [css-grid] Flexible lengths and sizing constraints

On Thu, Mar 12, 2015 at 7:47 AM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
> Let's see what are the grid and item dimensions depending on the value
> of the grid's width and height properties:
> * width: auto; height: auto; => 100x10
> * width: min-content; height: min-content; => 0x0
> * width: max-content; height: max-content; => 70x10
> * width: fit-content; height: fit-content; => 70x10
> * width: fill; height: fill; => 100x100
>
>
> I'd like to confirm if these are or not the right values.
> In order to calculate the min-content contribution of the "1fr" track, I
> consider we're calling the grid sizing algorithm with 0 available space,
> so the "1fr" becomes 0px.
> For the max-content contribution, I guess we're calling the algorithm
> with infinite available space, so the size it's based on the track
> contents [1], in this case the "1fr" becomes 70px.
>
> Take into account that this doesn't match with what was agreed some time
> ago [2]. If I understand it correctly, in that case you'll only run the
> algorithm once using 0 as available space. So, "1fr" will be 0px for
> both min-content and max-content contributions.

No, <http://dev.w3.org/csswg/css-grid/#algo-content> contains a
paragraph that says "When the grid container is being sized under a
min-content constraint, a track with a flexible min track sizing
function is treated as if its min track sizing function was
min-content for the purposes of this step.", so the grid ends up being
about 30x10.

The other results in your example appear to be correct.

~TJ

Received on Thursday, 7 May 2015 23:15:05 UTC