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

Re: [css3-grid-layout] [css3-layout] Grid-Template Declaration Merge

From: Bert Bos <bert@w3.org>
Date: Fri, 2 Mar 2012 00:24:31 +0100
To: www-style@w3.org
Message-Id: <201203020024.31652.bert@w3.org>
I worked a little more on this and wrote out a good part of the details. 
Some of those turned out to be neither exactly as Elika wrote nor what 
Phil suggested, but somewhere in between. In summary, my proposed text 
does this:

A) An element has a grid if any of 'grid-template', 'grid-rows' and 
'grid-columns' (or the shorthand 'grid') has a value other than its 
initial value. These properties only apply to block containers. (I.e., 
'grid' is modeled on 'columns'.)

B) The number of rows is determined in the three ways that Phil 
mentioned, whichever gives the largest number. (Columns are analogous.)

   1) The number of rows in 'grid-template'

          DIV { grid-template: "abc" "adc"  /* Two rows */ }

   2) The number of values in 'grid-rows'.

          DIV { grid-rows: auto auto auto; /* Three rows */ }

   3) The absolutely positioned element with the largest
      'grid-position-y' value. (I named it this instead of 'grid-row',
      to avoid confusion with 'grid-rowS' and to allow an easy choice of
      shorthand, viz. 'grid-position'. But maybe there are even better
      names.)

          H3 { position: absolute; grid-position-y: 4 /* Fourth row */ }

This means 'grid-template' does not take precedence over 'grid-rows', 
unlike Elika suggested. And I'm still not sure this whether I actually 
like this better: It is inconsistent with 'background-
image'/'background-size' and 'transition-property'/'transition-
duration'. But if you allow automatic creation of additional rows as in 
(3) above, it seems to make some sense to not require a template...


For more details, see "Declaring templates":
http://dev.w3.org/csswg/css3-layout/new2.html#declaring-templates

I also tried to collect the arguments for different syntaxes:
http://dev.w3.org/csswg/css3-layout/new2.html#syntax-features-and-levels



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Thursday, 1 March 2012 23:24:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:51 GMT