Skip to content

[css-grid] Clarification about <auto-track-list> and <line-names> syntaxes #2676

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
lahmatiy opened this issue May 13, 2018 · 1 comment
Closed

Comments

@lahmatiy
Copy link
Contributor

Spec: https://drafts.csswg.org/css-grid/#typedef-auto-track-list

The spec defines <auto-track-list> syntax as following:

[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? <auto-repeat>
[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?

I suppose | combinator is missed in that syntax.

<line-names> is defined as following:

'[' <custom-ident>* ']'

According to this syntax, an empty brackets is a valid value for the <line-names>. It looks odd, I guess * multiplier should be replaced for +.

@tabatkins
Copy link
Member

I suppose | combinator is missed in that syntax.

No, it's written correctly. The point is that you can have one <auto-repeat>, but then as many <fixed-repeat>s as you want before/after it.

According to this syntax, an empty brackets is a valid value for the . It looks odd, I guess * multiplier should be replaced for +.

I don't see anything particularly wrong with allowing [] there. Yeah, it defines no line names, but that seems clear. And allowing it has some good points: it can make it slightly easier for code-generators (don't need to test for the presence of line names and manually omit the [] when generating a template); and it can help visually line things up if people are naming lines between most of the tracks and want the symmetry of having an empty [] calling out that there's no named lines there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants