-
Notifications
You must be signed in to change notification settings - Fork 707
[css-grid] Sizing algorithm for span >= 2 should be a generalization of span 1 #3616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Wrt the first point, the following inequality holds: minimum contribution ≤ min-content contribution ≤ max-content contribution. This allowed us to have a simpler structure for span=1. (It wasn't possible for span > 1 because of the way spanning items are handled... We could have written a super generalized algorithm, but this would have been harder for readers to follow. It's easier to think about the span=1 case using the simplified algorithm, and then work up to spanning items, where there is some extra complexity.) Wrt the second point. see #2303 (comment) :) |
OK I was strongly suspecting this, but it's not obvious, because the definition of the minimum contribution is complex, and requires a deep understanding of css-sizing. Maybe add a note?
Then could you also add another note saying that applying the algorithm for spanning items to non-spanning ones would produce the same result, it would just be less simple?
That looks good, thanks. |
At what point in the section do you think this is helpful to point out? |
Well for example in https://drafts.csswg.org/css-grid/#algo-single-span-items after "consider the items in it with a span of 1" it could say that it's just a simplification, but with the same result, of the algorithm for spanning items. Or maybe in https://drafts.csswg.org/css-grid/#algo-spanning-items after "Repeat incrementally for items with greater spans until all items have been considered" it could say that performing an initial iteration for items with a span of 1 would have the same effect as running the non-spanning algorithm. |
…st a simplification of, the span=n instructions. #3616
@Loirooriol Done. Close out the issue if you are satisfied? :) |
Yes, thanks! |
I don't understand why there is a track sizing algorithm using items with a span of 1 (and intrinsic minimum and non-flexible maximum), and another one for items with a span >= 2 (not spanning tracks with flexible maximums).
I think both cases should use the same algorithm, just with the extra space distribution being more trivial to perform for items with a span of 1. However, they aren't exactly the same:
auto
minimums.auto
minimum under a sizing min/max-content constraint behaves asmin/max-content
. With span 1 it's not exactly like this, because the value is later clamped between the minimum contribution and the max track sizing function (or fit-content argument).Why the differences?
The text was updated successfully, but these errors were encountered: