Re: [css-grid] Using brackets for line names

On 07/05/15 21:49, François REMY wrote:
>> Alan Stearns brought up a really great point that the repeat() syntax in Grid
>> Layout would be easier to read if line names used brackets instead of
>> parentheses
>>
>>    repeat([line-name] 10px [line-name] calc(60em+10px))
>>
>> vs
>>
>>    repeat((line-name) 10px (line-name) calc(60em+10px))
>>
>> Since there's no particular reason to go with one vs the other, we could just
>> change it. Thoughts?
>>
>> ~fantasai
> 
> FWIW, there's at least some non-subjective reason to prefer brackets, because parentheses conflict with the SASS/LESS value-computation syntax. I would actually be happy to use "width: (100% - 125px)" instead of "width: calc(100% - 125px)" in my stylesheets, especially if (in some hypothetic future) we expand the calc syntax to match things we can do in Media Queries L4. Anyway, even without this, I think naming a line isn't an essential feature enough to endorse the responsibility of closing the door to some general-purpose grouping feature in css, whichever it may be.
> 
> Given there's no shipped implementation of css grid and I've yet to see a good reason to prefer parentheses, I would welcome the change.

The SASS issue has been brought up some times in the past and what
fantasai is proposing here is just for repeat(), so "grid-template-rows:
(one two) 10px" will be still valid (and problematic for SASS).

IMO it would be a bad idea to have a different syntax just for the
repeat() case, authors will be really confused about whether to use
parentheses or brackets. I don't have a strong opinion on using either,
but I do believe that we should use the same syntax for all the
situations (always brackets or always parentheses).

BR

Received on Friday, 8 May 2015 07:03:02 UTC