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

Re: layout idea

From: Jonathan Snook <jonathan.snook@gmail.com>
Date: Sun, 15 Mar 2009 22:43:45 -0400
Cc: www-style@w3.org
Message-Id: <95071DAC-6119-4B18-B4F4-417381776059@gmail.com>
To: Tab Atkins Jr. <jackalmage@gmail.com>

> It feels like this is nearly exactly like Grid Layout, except not
> quite as flexible.

There are things within Grid Layout that do give it some flexibility,  
such as the ability to define repeating grid sequences).

> As well, it commits the (what I consider a) sin of defining the page's
> layout only in the aggregate - you have to know *all* of the matrix
> declarations to figure out just how many cells are in the grid.

Grid Layout has this problem as well. You can define repeating grid  
patterns. Therefore, you can't determine the page layout until all  
items are placed within that grid.

A concern of mine with grid layout is how an element's dimensions are  
determined (assuming the grid-columns/rows is defined on an element  
and not the body). Take the following example HTML/CSS:

<div id="a">
   <div id="a1"></div>
   <div id="a2"></div>
</div>

#a { grid-columns: * *; grid-rows: *; }
#a1 { position: absolute; top: 0; bottom: 1gr; }
#a2 { position: absolute; top: 0; bottom: 1gr; }

How tall is #a? If absolute positioning takes the elements outside of  
document flow, and a grid row height is flexible, how do you determine  
that? This is why I took the approach I did.

I also dislike that elements now have a more verbose syntax to lock  
all sides to the grid (which, to me, seems like the more common use  
case).

Example:

foo {
   position: absolute;
   left: 1gr;
   right: 2gr;
   top: 1gr;
   bottom: 2gr;
}

> Andrew does make an excellent point wrt the weaknesses of using the
> position property for specifying grid, namely that it prevents you
> from doing things like position:relative on the blocks afterwards.

Yes, I admit that it has this weakness. It is a weakness I'm willing  
to have in there to maintain the simplicity of implementation. If the  
issues with the Grid Module can be worked out, I'm okay with that. I'd  
rather see a simpler implementation (with limitations and all) get  
implemented sooner than a complex solution implemented later (or not  
at all).

-js
Received on Monday, 16 March 2009 02:44:24 GMT

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