-
Notifications
You must be signed in to change notification settings - Fork 661
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] Collapsed grid tracks and content distribution #1140
Comments
I agree this should be clarified in the CSS Box Alignment specification: https://drafts.csswg.org/css-align-3/#distribution-grid
Perhaps it should specify whether those tracks can be or not collapsed tracks. |
I think as an author I prefer the Gecko version - although I can see the logic of both. However if I am distributing space I probably want it distributed between the things I can currently see. |
Yeah, the collapsed tracks should be essentially invisible, as they are when gaps are added. Content distribution effectively increases the gaps, and if we later add the ability to style gaps (e.g. by adding column/row rules), then that will be noticeable. |
@javifernandez Note that Chrome's implementation is actually wrong for a different reason - if you put i2 into the fourth column (so it's columns 2 and 3 that collapse), Chrome's rendering puts a lot of extra space in the middle, indicating that each of the gutters there are getting the extra space and independently laying out. The spec requires that the gutters coincide, tho, so it should look exactly like your current example, with the tracks shifted to the left side. But yeah, Firefox's rendering is intended, and we're clarifying now. |
Well, we technically didn't specify that the space is part of the gutter, either, so they can't have been wrong for that reason just yet. But now they are! All clarified! Thanks for the report! |
Man, where's that space gonna even go if the gutters coincide, tho? Even if you put it to one side of the gutter (rather than expanding the gutter), the gutters are on top of each other! |
Thanks a lot for clarifying the specs! |
According to the CSS Grid spec, the grid tracks that collapse because of
auto-fit
repetition, have zero width and the gutters between them also collapse:The question is, how these collapsed tracks and gutters should be treated for the
justify-/align-content
purposes? On the one hand, the collapsed tracks are still technically separate tracks, so they may be distributed as usually (which we currently see in Blink/WebKit implementation). On the other hand, "the exact coincidence" of the collapsed grid gutters, one of which is the last track gutter, seems to imply that there would be effectively no gutter after the last non-empty track, so no extra space to distribute, and the non-empty tracks should be distributed as if the collapsed tracks didn't exist at all. This is what currently the Gecko implementation does.The difference in the two implementations behavior can be seen in this example (provided by @mrego): http://jsbin.com/rosarub/edit?html,css,output
Personally, I believe that the Firefox's behavior (ignoring the collapsed tracks completely) makes more sense from the practical perspective. Having invisible things that affect distribution of the visible content is confusing and sometimes even annoying, the same way as wrapping abspos children of the flex container in anonymous flex items was. I supposed that that the whole point of collapsing tracks is making them not affecting the layout at all. But it's just my opinion.
Should the spec be clarified for this aspect?
The text was updated successfully, but these errors were encountered: