Skip to content

[css-grid-1] gCS() of grid-row-start/etc properties should return used values? #2681

Closed
@tabatkins

Description

@tabatkins

In #1465, an author requested a way to find out what grid area a grid item ends up occupying, after placement. This seems like a reasonable request! There also seems to be a straightforward way to achieve it - specify that the used values of the grid-row-start/etc properties are the line numbers the item actually lands on, and then specify that gCS() returns the used value of those properties.

(We already have a precedent of several grid-related properties returned used valued for gCS().)

Browser compat on what's returned for those properties today seems to be relatively consistent on returning the specified values, so this would be breaking compat. Whether that's important or not is unclear.


The rest of the requests in #1465 (finding out how many rows/columns are in the implicit grid, and finding out what items overlap a given area) can both be determined from this one change, as you can just iterate over the grid items and build up a map of where they live yourself. We shouldn't need to add any API surface for those.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions