Re: [css3-grid-layout] Grid-cell-stacking question

On Thu, Apr 14, 2011 at 5:22 PM, Rob Crowther <robertc@boogdesign.com> wrote:
> What would I add the grid-cell-stacking property too?  I initially assumed
> it would be like this:
>
> aside { grid-column: 1; grid-row: 2; grid-cell-stacking: rows; }
>
> I'm aiming for: put all my aside elements in the first column, second row
> and stack them vertically.
>
> But then I read the section again, and looked at Example XIX, and it seems
> like the property should apply to the Grid Cell rather than the Grid Item,
> so I'd have to explicitly call out a cell with the ::grid-cell pseudo and
> apply the grid-cell-stacking to that:
>
> #grid::grid-cell("sidebar") {
>        grid-column: 1;
>        grid-row: 2;
>        grid-cell-stacking: rows;
> }
> aside { grid-cell: "sidebar"; }
>
> Is this correct, or was I OK with the first one?

grid-cell-stacking doesn't make any sense applied to the grid items;
what would you do if two grid-items put in the same grid cell
specified different values?  So, yes, it should be specified on the
cell.

As the note in the spec says, though, the 'rows' and 'columns' values
should instead just be done by setting the 'display' on the grid-cell
to 'flexbox'.  The 'layers' property should presumably be done the
same way, with a display value that works in the desired fashion.
This would probably involve inventing a relatively simple new layout
model like "Stack Layout" or something.

~TJ

Received on Friday, 15 April 2011 00:57:10 UTC