[css-grid] Percentage tracks and indefinite sizes · Issue #1921 · w3c/csswg-drafts (original) (raw)
This is an issue extracted from #509 (so we can leave #509 only for percentage gaps/gutters).
The behavior of percentage rows has been modified back in September to reflect a resolution from Seatle F2F meeting on January.
The new text of the spec says:
If the size of the grid container depends on the size of its tracks, then the
<percentage>
must be treated as auto, for the purpose of calculating the intrinsic sizes of the grid container and then resolve against that resulting grid container size for the purpose of laying out the grid and its items.
All the implementations have shipped the previous behavior (percentage rows are treated as auto
and never resolved) and are interoperable regarding this. In addition, AFAIK nobody has updated them to follow the new behavior described in the spec.
At the same time we believe that implementing the new behavior might not be that easy, mainly because of the height is usually an output of the width, and you cannot do the same operations in both axis.
I've wrote a codepen trying to explain one of the issues which is the fact that we might need an extra pass of the track sizing algorithm to properly follow this resolution.
The problem is a combination of spanning items with percentage tracks.
The purposes of this issue are 2:
- Verify that this is the expected behavior, and probably modify the spec accordingly to explain these extra pass (and maybe how all this can be combined with orthogonal spanning items if that brings or not more issues).
- Check with other implementors if they're willing to support this new behavior for percentage rows (CC @atanassov and @MatsPalmgren).
Thanks for your time and sorry for the neverending story. 😇