Skip to content

[css-grid-2] Clarify duplicate line name resolution in grid-template-areas #11866

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

Closed
gitspeaks opened this issue Mar 9, 2025 · 1 comment
Closed
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1 css-grid-2 Subgrid; Current Work

Comments

@gitspeaks
Copy link

In section 7.3.2, it states:

These implicitly-assigned line names behave just like any other line names, except that they do not appear in the value of grid-template-rows/grid-template-columns. Even if an explicitly-assigned line name with the same name is defined, the implicitly-assigned line names are just more lines with the same name.

This implies that implicit line names (e.g., “foo-start” from grid-template-areas: "foo foo" "bar bar") and explicit line names (e.g., “foo-start” from grid-template-rows: 100px [foo-start] 200px) coexist as separate lines, even with the same name. However, it’s unclear how the grid resolves a reference like grid-row-start: foo-start when multiple lines share the name “foo-start.” Does it default to the first occurrence ?

@fantasai fantasai added css-grid-1 css-grid-2 Subgrid; Current Work labels Mar 27, 2025
@fantasai
Copy link
Collaborator

fantasai commented Mar 27, 2025

Does it default to the first occurrence ?

Yes. See https://www.w3.org/TR/css-grid-1/#line-placement

<custom-ident>
First attempt to match the grid area’s edge to a named grid area...

Otherwise, treat this as if the integer 1 had been specified along with the <custom-ident>.

@fantasai fantasai added the Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. label Mar 27, 2025
@fantasai fantasai added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-grid-1 css-grid-2 Subgrid; Current Work
Projects
None yet
Development

No branches or pull requests

2 participants