Re: [css3-grid-layout] Syntax of track lists wrt named grid lines

On Thu, Mar 14, 2013 at 3:38 PM, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
> * Tab Atkins Jr. wrote:
>>Looking over the current syntax for declaring named grid lines in
>>grid-definition-rows/columns, we've come to the conclusion that the
>>current syntax is *terrible*:
>>
>>* We're using strings to represent a user-ident, which is inconsistent
>>with everything else in CSS.
>
> That's not quite correct, e.g. font-family as property and descriptor
> allows user-defined identifiers as strings, as it should, because the
> use of white space in font family names is quite common. Having to hy-
> phenate or CamelCase all the time can be inconvenient in some settings,
> if the idea is to allow only <identifier>s, as CSS does in some places;
> I'm not sure whether this is such a case, but it should be kept in mind.

Nope, we're consistent there - names defined *by things that aren't
CSS* are written as strings.  'font-face' values fall into this
bucket.

Names defined by the author are always idents, though, because they
have the ability to conform to our ident rules without needing to
escape anything.

>>An example of the current syntax, taken from the current spec:
>>
>>grid-definition-columns: "first" "nav" 150px "main" 1fr "last";
>>grid-definition-rows: "first" "header" 50px "main" 1fr "footer" 50px "last";
>>
>>Our current suggestion for fixing this is to switch the line names to
>>idents, and then use () to surround each set of line names:
>>
>>grid-definition-columns: (first nav) 150px (main) 1fr (last);
>>grid-definition-rows: (first header) 50px (main) 1fr (footer) 50px (last);
>
> That does seem better to me, but I note that juxtaposed identifiers
> without a separator can be quite confusing; some might read this as
>
>   grid-definition-columns: "first nav" 150px ...
>   grid-definition-rows: "first header" 50px ...
>
> and that is probably not intended.

Juxtaposed identifiers are used all over CSS without any confusion.  I
can see what you mean, but it should be clear from the grammar, and
immediately clear upon use.

~TJ

Received on Thursday, 14 March 2013 23:40:41 UTC