Re: [css-grid] improving the grid shorthand

On Wed, Apr 20, 2016 at 11:07 AM, Eric A. Meyer <eric@meyerweb.com> wrote:
> On 14 Apr 2016, at 14:08, fantasai wrote:
>
>> 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.
>>
>> For example,
>>   grid: auto-flow 10em / repeat(auto-fill, 30em);
>> sets up a grid that
>>   * fills the inline axis with as many 30em columns as will fit
>>   * auto-flows into rows 10em tall
>
>
> Unless I've drastically misunderstood, I see the same basic problems as
> before-- that you can address one set of properties at a time, but not all
> properties the shorthand can represent at once, so you end up
> force-defaulting the ones you can't address.

This isn't trying to fix that problem, don't worry.  This is just
trying to make the 'grid' shorthand a little more useful by giving it
another slice thru the six properties that it controls.

We separately discussed in the telcon today the "grid is a big
shorthand that resets all 6 properties, and there's no way to set a
smaller set of them, so we should add grid-template back", and the WG
weakly agreed to do so.

> This is like defining 'font' to either let authors set a size and family, OR
> set the weight, style, and variant, but never both at once; and so, if you
> declare 'font: bold', then the size and family are reset to browser
> defaults.  (Yes, 'font' has its own oddities, but at least not THAT oddity.)
>
> I also would want to remove the resetting of grid gaps via 'grid', since
> gaps can't be defined with the shorthand at all.  Having a shorthand reset
> properties it can't itself define seems deeply squamous, if not rugose.

That's actually already attested: 'font', at least, does so.  When you
get a large shorthand that touches a bunch of properties, it's not
always possible to do them all together in a way that's still
understandable.

~TJ

Received on Wednesday, 20 April 2016 18:48:18 UTC