[css-grid] Collapsed grid tracks and content distribution · Issue #1140 · w3c/csswg-drafts · GitHub
Skip to content

[css-grid] Collapsed grid tracks and content distribution #1140

Closed
@SelenIT

Description

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:

When a collapsed track’s gutters collapse, they coincide exactly—the two gutters overlap so that their start and end edges coincide. If one side of a collapsed track does not have a gutter (e.g. if it is the first or last track of the implicit grid), then collapsing its gutters results in no gutter on either “side” of the collapsed track.

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?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions