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

[css-grid] grid-template removal

From: Eric A. Meyer <eric@meyerweb.com>
Date: Wed, 23 Mar 2016 12:45:36 -0400
To: "www-style list" <www-style@w3.org>
Message-ID: <7E0A5985-0CF6-41F2-9A9A-896D8BE93DB1@meyerweb.com>
Now that I've worked with some grid experiments since 'grid-template' 
was dropped, I've found a reason why dropping it might be undesirable.  
It's not an absolute blocker or anything, but it does bug me a bit.

In the past, I might've written something like this:

     .galleries {display: grid;
         grid-flow: dense column;
         grid-auto-rows: 100px;
         grid-auto-columns: 100px;
         grid-gap: 10px 15px;
     }
     #gallery01 {
         grid-template: 2em 1fr 3em / 1fr repeat(4,2fr) 1fr;}
     #gallery02 {
         grid-template: 2em 1fr 1fr 1em / 1fr repeat(5,2fr) 1fr;}


Now that 'grid-template' is gone, I might convert that to:


     .galleries {display: grid;
         grid-flow: dense column;
         grid-auto-rows: 100px;
         grid-auto-columns: 100px;
         grid-gap: 10px 15px;
     }
     #gallery01 {
         grid: 2em 1fr 3em / 1fr repeat(4,2fr) 1fr;}
     #gallery02 {
         grid: 2em 1fr 1fr 3em / 1fr repeat(5,2fr) 1fr;}

…except the 'grid' shorthands will reset everything I declared under 
'.galleries', due to the shorthand behavior and specificity.  So I end 
up in a specificity arms race with myself that I didn't have to get into 
before.

Of course, I could even now use 'grid-template-rows' and 
'grid-template-columns' in place of 'grid', and obviously will do.  
Perhaps my problem is really that 'grid' is currently limited to set a 
template OR set flow and auto-tracks (but not gutters, even though 
they're reset too).  This dramatically limits the circumstances in which 
it can be used.

Either way, I wanted to contribute my observations.


--
Eric A. Meyer - http://meyerweb.com/
Received on Wednesday, 23 March 2016 16:46:04 UTC

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