W3C home > Mailing lists > Public > www-style@w3.org > March 2013

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Mar 2013 16:39:54 -0700
Message-ID: <CAAWBYDBEMaTH60_CjyuvczFFLTOSqd4eq39FnBbNRLCpG92d2w@mail.gmail.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: www-style list <www-style@w3.org>
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

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.

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:27 UTC