Re: [CSS Box Alignment] Comments on CSS Box Alignment proposal

On Tuesday 2012-05-08 11:51 +0200, Tab Atkins Jr. wrote:
> On Tue, May 8, 2012 at 11:11 AM, L. David Baron <dbaron@dbaron.org> wrote:
> >   (a) there's no point distinguishing between 'content-align' and
> >   'child-align' since there's only one child at any given point in
> >   the secondary direction
> 
> Nope - in Flexbox 'content-align' is what we currently call
> 'flex-line-pack', while 'child-align' is what we currently call
> 'flex-align'.  ('box-align' is 'flex-item-align'.)

Ah, ok, so content-align aligns the lines and child-align and
box-align align the items within a line.

(And, by the way, there seems to be duplication of named anchors
which breaks many of the links in the table of contents... since
they go to the wrong section, which makes things very confusing when
one doesn't notice.)

> >   (b) the 'box-justify' property is meaningless since the children
> >   in the primary direction have to be aligned together (so I'm
> >   confused by the checkmark in the 'box-justify'/Block cell)
> >   *unless* there are external constraints on the space allocated to
> >   children (like constraints from other rows for the horizontal
> >   space given to cells within a table row) that don't (like they do
> >   for tables) actually change the size of the cells.
> 
> Hm, it looks like fantasai defined the primary axis of Block Layout to
> be the inline-axis.  Not sure if that's valid - it's opposite that of
> a column flexbox, which should look a lot like Block Layout by
> default.

I think what she wrote makes sense once you consider multi-line
flexbox.

> >  * I'm confused about whichever of 'grid-row-align' and
> >   'grid-column-align' is in the block direction (I'm not sure this
> >   is fixed as the table suggests) is supposed to work when there is
> >   more than one grid item in a cell.  In particular, aren't the
> >   items going to be laid out as blocks in one dimension?  If so,
> >   how can they be *individually* aligned in that dimension?  (And
> >   isn't the ability to have multiple items in a cell the only
> >   reason that grid doesn't behave like tables (resizing the items)
> >   and avoid case (b) in the point above?)
> 
> Grid is defined to always pay attention to writing mode, such that the
> rows are along the inline axis and the columns are along the block
> axis.
> 
> Grid Items always overlap if they're positioned in the same cells.
> You're probably thinking about the older Template Layout, where
> putting multiple items in the same cell would make them flow together.
>  I think Grid is intending to handle that sort of thing with Regions
> flowed into ::cell pseudos.

In that case, why not make the item fill the entire cell (as for
tables)?  Then you take care of the alignment in terms of aligning
its contents.

This removes the need for 2 extra alignment properties which
otherwise don't make sense in this general model.

> > These lead me to believe (if I've thought this through correctly,
> > which I'm not particularly confident of) that the six properties
> > given in the table should be collapsed into three:
> >
> >  * 'box-justify' should be removed since you can't align an element
> >   in the direction in which its parent lays out children (despite
> >   that grid claims to have such a property without actually saying
> >   how it works -- unless I'm missing something here, which I
> >   certainly could be)
> 
> You are.  ^_^  See above.

I still think this (and 'child-justify') is extra complexity that we
don't need.

> >  * 'child-align' should be removed since there's no reason to
> >   separate it from 'content-align': if an element's children
> >   support 'box-align' or auto margins then 'content-align' is
> >   perfectly fine to use as the default rather than needing a
> >   separate property for this
> 
> The two are quite different, and Flexbox absolutely needs both of
> them, since it already has three different cross-axis alignment
> properties.

OK, agreed here.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Tuesday, 8 May 2012 12:28:58 UTC