Re: [csswg-drafts] [css-grid] fit-content() vs 'stretch' alignment

If I'm understanding your proposal, you mean that the `fit-content()` tracks will grow up to the `fit-content()` argument.
So for example a track with `fit-content(200px)` if it has a content of `50px`, it'll be stretched to `200px` (if the available space is enough) but not larger than that.

Probably that can make sense from the authors point of view, but it'll make more complex the implementation of the stretch phase of the algorithm.
For example if we have a grid with `1200px` width and these columns: `fit-content(200px) auto fit-content(450px)`. Imagine they've no contents yet so with `justify-content: start` all of them are 0px.
I guess we'd need to do something like this to stretch them:
1) We've `1200px` available so we divide them between the 3 columns: `400px` each.
   1st column can only grow up to `200px`. 2nd and 3rd columns grow to `400px`.
   At this point we've: `200px 400px 400px`.
2) We still have `200px` available, we divide now only between the 2 columns that still can grow: `100px` each.
   2nd column grows to `500px`, but 3rd column can only grow up to `450px`.
   Now we've: `200px 500px 450px`.
3) At the end we still have `50px` available, and only 2nd column can grow (the other two have already reached their limit).
   2nd column grows to `550px`.
   The final result would be `200px 550px 450px`.

Probably we'd need to specify how this will work in [11.8. Stretch auto Tracks](https://drafts.csswg.org/css-grid/#algo-stretch).

BTW, this is an editorial nit, but shouldn't the 11.8 section mention that tracks only stretch if `justify|align-content` is `stretch`. That's somehow mentioned in the [summary of the track sizing algorithm](https://drafts.csswg.org/css-grid/#algo-overview):
> Finally, the grid container is sized using the resulting size of the grid as its content size, and the tracks are aligned within the grid container according to the align-content and justify-content properties.


-- 
GitHub Notification of comment by mrego
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1732#issuecomment-323331453 using your GitHub account

Received on Friday, 18 August 2017 11:39:16 UTC