W3C home > Mailing lists > Public > www-style@w3.org > April 2016

Re: [css-grid] improving the grid shorthand

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Apr 2016 15:04:55 -0700
Message-ID: <CAAWBYDBAqoT=kctqxhj=PnNBLO6D7LUUkJUTDW1WQeem=5HmMg@mail.gmail.com>
To: Francois Remy <francois.remy.dev@outlook.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, www-style list <www-style@w3.org>, "Eric A. Meyer" <eric@meyerweb.com>, Rachel Andrew <rachelandrewuk@gmail.com>, Jen Simmons <jen@jensimmons.com>
On Thu, Apr 14, 2016 at 1:57 PM, Francois Remy
<francois.remy.dev@outlook.com> wrote:
>> https://drafts.csswg.org/css-grid-1/issues-wd-20150917#issue-41
>>
>> Eric pointed out earlier that 'grid' being able to set either template values OR
>> auto-flow values is quite limiting:
>>    https://lists.w3.org/Archives/Public/www-style/2016Mar/0345.html
>>    https://lists.w3.org/Archives/Public/www-style/2016Apr/0093.html
>>
>> In particular, when one wants to set up an auto-flow grid, one of the
>> dimensions is *not* auto-flow, and therefore needs to set up an explicit
>> template. For example, you'll set up your columns and auto-fill into rows. But
>> the grid shorthand right now does not allow this, even though this is the
>> primary usage pattern of auto-flow grids.
>>
>> To fix this, we'd like to change the syntax of 'grid' to remove the current grid-
>> auto branch
>>    <‘grid-auto-flow’> [ <‘grid-auto-rows’> [ / <‘grid-auto-columns’> ]? ]?
>> which isn't particularly useful, and instead extend the branch that sets grid-
>> template-rows / grid-template-columns
>>    <‘grid-template-rows’> / <‘grid-template-columns’> to also be able to
>> specify auto-flow values.
>>
>> Our current idea for this is
>>    <grid-template-rows>  / [ auto-flow && dense? ] <grid-auto-columns>? |
>>    [ auto-flow && dense? ] <grid-auto-columns>?  / <grid-template-columns>
>> which merely extends the syntax for rows or columns in the shorthand to be
>> either a track listing or an auto-flow setup.
>
> I guess you meant:
>     <grid-template-rows> / <grid-template-columns> |
>     <grid-template-rows>  / [ auto-flow && dense? ] <grid-auto-columns>? |
>     [ auto-flow && dense? ] <grid-auto-rows>?  / <grid-template-columns>
>
> Correct?
>
> If yes, I think it makes sense.

No, we were explicitly replacing the existing grid-auto branch (see
the sentence starting with "To fix this").  So yes, the existing
"explicit rows/cols" and "ascii layout" branches stay.

~TJ
Received on Thursday, 14 April 2016 22:05:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:02 UTC