Re: [csswg-drafts] [css-grid] Grid track sizing items spanning a flexible track

I might have missunderstood the proposed change but I think something like that does not work at least for three reasons. I'll use an example to illustrate what I mean:
```html
<div style="display:grid; grid-template-columns: 1fr auto 2fr">
     <div style="width: 50px; grid-column: 2/4;"></div>
     <div style="width: 100px; grid-column: 1/3;"></div>
     <div style="width: 90px; grid-column: 1/4;"></div>
</div>
```
(I don't specify a width for the grid container. Let's just assume that we have exactly the amount of free space required by the examples not to enlarge tracks in "Expand flexible tracks" step)

If we apply a change like the one proposing we'd be breaking at least 2 principles & 1 heuristic of grid:
- Order independence
- fr tracks must retain their respective proportions
- Thightly-wrapped tracks

In this example, procesing the items in this source code order will generate the following result
1. the `50px` item sizes the tracks to `[0 0 50]`
1. the `100px` item sizes them to `[100 0 50]`
1. the `90px` one fits and there is no need to enlarge tracks

Instead should we process the third item in the first place we'd have:
1. the `90px` item sizes the tracks to `[30 0 60]`
1. the `50px` item fits in `[30 0 60]`
1. the `100px` one sizes the tracks to `[100 0 60]`

In none of the two cases the grid is tightly packed. Agreed that's a desirable effect from the heuristics but not a requirement. However as you can see, relative proportions of fr tracks are not preserved and order independence is also broken.

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

Received on Monday, 23 April 2018 09:03:54 UTC