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

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

From: Linss, Peter <peter.linss@hp.com>
Date: Tue, 19 Mar 2013 01:42:44 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
Message-ID: <0C06B9E2-ADF6-43A3-8257-1CE414733C4D@hp.com>

On Mar 14, 2013, at 11:10 AM, 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.
> * The syntax is hard to scan and see how many columns/rows there are,
> and how things are grouped.
> 
> 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);
> 
> This immediately seems to be much easier to read and scan - it's easy
> for the eye to skip over parentheticals, so you can quickly see how
> many tracks there are and what their sizing functions are.
> 
> Suggestions?  Anything better?  We'll bring this up on next week's
> telcon to decide.
> 
> ~TJ and fantasai
> 

The problem with using idents for line names is that you run in to potential collisions with other idents in all the places where lines names can be used. For starters, you're precluding the use of 'span' and 'auto', which is straight-forard enough, but it prevents us from ever adding any other ident values to grid-start/-end/...

I know there's history of using user-defined idents in other places, but I seem to recall a resolution where we agreed this was a dangerous practice and in the future user defined names should be strings (or wrapped in function tokens) to avoid collisions.

Peter
Received on Tuesday, 19 March 2013 01:44:33 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT