Skip to content

[css-grid-2][css-grid] grid-template-rows/columns Computed / Resolved Values for 'subgrid' values #4362

@MatsPalmgren

Description

@MatsPalmgren

CSS Grid specifies grid-template-rows/columns computed values and resolved values. Note however that this is only for Track Listing values and thus does not include the extension for subgrid values made in CSS Grid 2.

I can't find anything in either spec that defines how this is supposed to work for subgrid values and I think this needs to be explicitly defined somewhere. I'd suggest that CSS Grid 2 add a section/paragraph to say how the computed/resolved subgrid values works. I tend to think that similar rules should apply in this case, namely that repeat() and empty line-names are preserved in the computed value, and that the resolved value contains expanded line-names for the explicit grid (which in a subgridded axis is its entire span) with any excess lines in the computed value dropped. IOW, the same rules as for Track Listing but without the track sizes (and prefixed with subgrid).

IIUC, the rules regarding Track Listing were somewhat influenced by backward compatibility concerns with Microsoft's non-standard implementation. There are no such concerns for subgrid but it seems reasonable to use the same rules for the new values for consistency and to avoid confusion.

For example, assuming the subgrid's column axis spans 4 tracks, the resolved value for grid-template-columns: subgrid [a] repeat(auto-fill, [b]) [c] is subgrid [a] [b] [b] [b] [c] and grid-template-columns: subgrid [a] [a] [a] [a] repeat(auto-fill, [b]) [c] [c] resolves to subgrid [a] [a] [a] [a] [c].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions