From https://drafts.csswg.org/css-grid/#algo-grow-tracks,
If the free space is positive, distribute it equally to the base sizes of all tracks, freezing tracks as they reach their growth limits (and continuing to grow the unfrozen tracks as needed).
This step used not to be relevant for flexible tracks, because their growth limit is initially set to their base size.
However, since #2177, the growth limit can be increased in https://drafts.csswg.org/css-grid/#algo-spanning-flex-items
Increase sizes to accommodate spanning items crossing flexible tracks: Next, repeat the previous step instead considering [...] all items that do span a track with a flexible sizing function while
- treating flexible tracks as having a max track sizing function equal to their min track sizing function
- [...]
- distributing space to such tracks according to the ratios of their flexible sizing functions rather than distributing space equally
Therefore, consider https://jsfiddle.net/3kbz9j2g/
<div id="grid"> <div id="item"></div> </div>
#grid { display: grid; width: 100px; grid-template-columns: 1fr 3fr; border: solid; } #item { grid-column: 1 / 3; min-width: 0; height: 100px; background: cyan; } #item::before { content: ''; display: block; width: 200px; }
The minimum contribution of the item is 0 so it doesn't increase the base sizes of the tracks. But both tracks are treated as if they had an auto
max track sizing function, so the max-content contribution of the item (200px) is distributed into growth limits, 50px to the first column and 150px into the 2nd one.
So we reach https://drafts.csswg.org/css-grid/#algo-grow-tracks as follows:
100px
0px
, growth limit 50px
.0px
, growth limit 150px
.Then if the 100px
are distributed equally:
0px
50px
, growth limit 50px
.50px
, growth limit 150px
.And https://drafts.csswg.org/css-grid/#algo-flex-tracks is no-op since the free space is 0.
So the column ratios end up being 1:1 instead of 1:3. This doesn't look good to me. I think that
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3