[css-grid] grid-template shorthand issues

Hi,

I'm trying to implement the "template-grid" shorthand following the
latest specification, but I'm having some problems trying to understand
the last syntax form:

[ <track-list> / ]? [ <line-names>? <string> [ <track-size> <line-names>
]? ]+

The description of the last component,  " [ <track-size> <line-names> ]?
",  indicates the following:

* Sets "grid-template-rows" to the <track-size>s following each string
(filling in auto for any missing sizes), and splicing in the named lines
defined before/after each size.

First question is, wouldn't be necessary, or clearer, to add an "OR" to
such clause ? perhaps something like  " [ <track-size>  | <line-names>
]? "  ? or does the original clause mean that any of the elements inside
the [] are optional ?

Also, wouldn't be clearer to define this shorthand in a way more
consistent with the track-list definition, so as the track-size would be
mandatory ?

I have some other doubts on the use of brackets, for instance, in the
"grid-line" syntax definition:

  <grid-line> =
    auto |
    <custom-ident> |
    [ <integer> && <custom-ident>? ] |
    [ span && [ <integer> || <custom-ident> ] ]

In that case," [ <integer> && <custom-ident>? ] " wouldn't be clearer "
[<integer> [&& <custom-ident>] "

Thanks,

--
Javier Fernandez

Received on Tuesday, 4 February 2014 12:53:21 UTC