8000 [css-grid-2] Computed value for integer repeats on grid-template-columns and grid-template-rows for non-subgrids · Issue #8555 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-grid-2] Computed value for integer repeats on grid-template-columns and grid-template-rows for non-subgrids #8555

@KurtCattiSchmidt

Description

@KurtCattiSchmidt

I'm working on implementing this in Chromium, and I see that Firefox and Safari have implemented this case differently.

To repro, you can paste this in your browser's address bar and look at the computed value in developer tools:
data:text/html,<div style="grid-template-columns: subgrid repeat(2, [a]);"></div>

Firefox reports subgrid [a][a], while Safari preserves the repeat syntax and reports subgrid repeat(2, [a])

https://www.w3.org/TR/css-grid-2/#computed-tracks

"The computed track list of a subgridded axis is the subgrid keyword followed by a list of line name sets representing each line in that axis."

There's also a section below (https://www.w3.org/TR/css-grid-2/#resolved-track-list-standalone) which explains what to do for grid-template-rows on a non-grid, and has an example that expands integer auto repeaters. It doesn't say what to do for when subgrid is included, however. It also doesn't say whether to expand for auto-fill or auto-fit in either case.

I think the most consistent behavior here is to expand the integer auto repeaters, as Firefox does, as that's most consistent with standalone grids. Since auto-fit can't be expanded (as this requires grid layout to compute), it makes sense to preserve the specified repeat(auto-fit, ...).

But that's my opinion. I'm curious what the working group thinks, and if this should be clarified more in the spec. I'm happy to implement whichever is preferred in Chromium.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0