Re: Flexbox Draft, with pictures!

On Jun 1, 2010, at 4:16 PM, David Hyatt wrote:

> 
> I think we could just support vertical-align in horizontal boxes as a means of getting baseline alignment.  There would be many details to work out though.  I think you could probably say that any value that doesn't involve text alignment (baseline, text-top, text-bottom) would result in alignment using margin boxes (so vertical flex would be applied first).  If text-dependent vertical align values are used, stuff could still flex... you'd just move the box's position such that the baselines align (causing the child box to possibly stick out of its container).
> 
> 

I should emphasize that box-align comes into its own in 2-dimensions, because you can specify it on a row or a column.  For example, although you can specify vertical-align for table rows, there is no corresponding capability for table columns.  Sure, you can say "Just set alignment on the cells dummy", but then the 2-dimensional style inheritance problem rears its ugly head;  basic capabilities like right-aligning the contents of all the cells in a column actually aren't possible today in Gecko or WebKit.

However with box-align, once you extend into two dimensions, think of it like "vertical-align" but axis independent.  It can apply to the rows of a XUL grid, but it can also be applied to the columns of a XUL grid.  I won't get into much more detail than that, but suffice it to say that both the row and the column are able to control the placement of content within the cell at the intersection of that row and column.

This is what you lose if you dump box-align.  Once you make it the responsibility of the cell contents to right-align themselves using flex units, you have the exact same problem of not being able to specify at the column-construct level that all cells in that column should be right-aligned.

I think this absence of 2-dimensional information from the current spec has left it hard to understand some of the design decisions, but control at the container level over what happens to the kids is very powerful once you consider grids instead of just boxes.

dave
(hyatt@apple.com)

Received on Tuesday, 1 June 2010 21:31:03 UTC