Re: layout idea

On Fri, Mar 13, 2009 at 3:54 PM, Jonathan Snook
<jonathan.snook@gmail.com> wrote:
> I've spent a little time over the past week working on an idea. I
> don't know if it's viable or not or whether something like it has
> already been proposed (besides Advanced Layout and the Grid module).
> But it never hurts to pitch my own stone into the pond.
>
> Matrix Layouts:
> http://snook.ca/technical/matrix-layouts/
>
> Along with the accompanying blog post:
> http://snook.ca/archives/html_and_css/matrix-layouts

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

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.  This
is why I dislike Andrew's grid layout as well.  The official Grid
Layout module declares a grid explicitly on a positioning ancestor, so
you know precisely what's going on from a single declaration.

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.
However, this can likely be dealt with by extending calc() to accept
gr units as well.  That is, if you wanted to put something in a
particular grid cell and then move it to the left by 1em, you could do
something like:

foo {
  position: absolute;
  left: calc(2gr - 1em);
  top: 1gr;
}

Does this seem reasonable?

I should also state that I love *both* the Grid Layout and Template
Layout modules, and would make heavy use of both of them were they to
exist.

~TJ

Received on Monday, 16 March 2009 01:28:01 UTC