RE: [css3-flexbox] [css3-grid-layout] Too Many Alignment Properties

Personally I like the clarity that comes with layout-prefixed properties.  It seems clear that flex-align is mean to apply to a Flexbox.  If I had a generic row-align and column-align that could be shared between layouts like Grid and Flexbox, from the names alone I not sure which properties apply to which layout type.  Further, does the applicable alignment property change for Flexbox when I switch flex-direction from column to row?  Maybe that's just a problem with the names I'm using in my example though.

However, I also don't like the idea of having only a subset of the values for some common property being applicable to a particular layout.  For example, if we merged the grid-column-align property with flex-pack property for the sake of having a common alignment property, it's not clear to me what the Grid would do with 'distribute' or what Flexbox would do with 'stretch'.  I think that problem is bound to grow as future layouts also attempt to union their alignment concepts into common properties.

My vote is to continue with the layout-prefixed property names.

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Thursday, February 02, 2012 3:11 AM
To: fantasai
Cc: www-style@w3.org
Subject: Re: [css3-flexbox] [css3-grid-layout] Too Many Alignment Properties

On Wed, Feb 1, 2012 at 2:25 AM, fantasai <fantasai.lists@inkedblade.net> wrote:
> So far we have 'vertical-align' and 'text-align', which mainly have to 
> do with text, but the new layout models are starting to introduce a 
> lot more aligns.
> Flexbox has four different alignment properties. IIRC Grid introduces 
> several more that do roughly the same thing but not quite. And there 
> are use cases for alignment in general block layout -- there's been 
> drafts for alignment properties in both dimensions there (that need 
> homes, but that's a separate issue).
>
> Rather than having every layout system design and implement its own 
> set of alignment properties, I'd like us to take a good look and see 
> if we can boil these down to a single set of properties that we can all share.
>
> There are basically two concepts of what alignment applies to:
>  a) the thing itself
>  b) the thing's contents
>
> And then there are the two axes: main axis vs. cross axis; inline axis vs.
> block;
> rows vs. columns; etc.
>
> There's the problem of needing four appropriately generic and 
> appropriately precise names, but I think we should be able to get away 
> with four properties in CSS total. Values that don't apply in a 
> particular layout mode can be defined to fall back to something 
> sensible. I think that's better than having more and more properties 
> that do roughly the same thing but take effect or not depending on the 
> layout mode.

I'm willing to try it out, but I'm not confident it'll be an improvement.  Let's work on it, though.

~TJ

Received on Thursday, 2 February 2012 13:07:40 UTC