Skip to content
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

[css-grid] Sizing algorithm should work for span > 2 #3617

Closed
Loirooriol opened this issue Feb 5, 2019 · 2 comments
Closed

[css-grid] Sizing algorithm should work for span > 2 #3617

Loirooriol opened this issue Feb 5, 2019 · 2 comments
Labels
Closed Rejected as Invalid Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1 Tracked in DoC

Comments

@Loirooriol
Copy link
Contributor

https://drafts.csswg.org/css-grid/#algo-spanning-items has an algorithm for items with a span of 2. Items with a span of 1 are handled beforehand. Items with a span greater than 2 are not explicitly handled anywhere. Why?

I tried this example: https://jsfiddle.net/qg5v0zLa/

The grid container has an explicit width of 200px. The columns are sized with min-content max-content, and extra ones with 0. The grid item has a min-content contribution of 50px and a max one of 100px.

If the grid item spans 2 columns, they become 25px 75px according to https://drafts.csswg.org/css-grid/#algo-spanning-items.

But if the item spans 3 columns, https://drafts.csswg.org/css-grid/#algo-grow-tracks should be reached with base sizes of 0 0 0 and growth limits of infinity infinity 0, so the columns should become 100px 100px 0.

This is not what Firefox and Chromium do, though. The columns end up being 25px 75px 0px, as expected.

So instead of "items with a span of 2" the spec should say "items with a span of at least 2"

@fantasai
Copy link
Collaborator

fantasai commented Feb 6, 2019

You missed the last sentence: “Repeat incrementally for items with greater spans until all items have been considered.”

It has to be ordered this way or you don't get a tight fit where needed.

@Loirooriol
Copy link
Contributor Author

Ah, you are right, I missed that XD

@fantasai fantasai added this to the css-grid-1 CR 2017-12-14+ milestone Feb 7, 2019
@fantasai fantasai added Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. and removed Commenter Response Pending labels Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Invalid Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1 Tracked in DoC
Projects
None yet
Development

No branches or pull requests

2 participants