[css-grid] Unclear how to limit track growth by fit-content() argument · Issue #4549 · w3c/csswg-drafts (original) (raw)

From https://drafts.csswg.org/css-grid/#algo-spanning-items,

The last sentence could be applied in different ways, I can see 2 reasonable options:

affectedSize += plannedIncrease  

becomes

affectedSize += clamp(0, plannedIncrease, fitContentArgument - affectedSize)  

With both options we may end up not distributing all the space (all tracks could have fit-content(0)). The difference is that with option A we are more likely to distribute less space, while in B we will fallback to distributing to other tracks if possible.

Actually I don't really understand what the spec is trying to do by limiting the growth by the fit-content() argument only when dealing with max-content maximums, but not for intrinsic maximums. I also wonder whether 'Distribute space to base sizes up to growth limit' should freeze when a base size reaches a fit-content() argument smaller than the growth limit, and leave further increases for 'Distribute space beyond growth limits'.