A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/w3c/csswg-drafts/issues/3693 below:

[css-grid] "Maximize Tracks" shouldn't distribute equally for flexible tracks · Issue #3693 · w3c/csswg-drafts · GitHub

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

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:

Then if the 100px are distributed equally:

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