W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-flexbox] auto margins and flex-align: baseline

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 17 May 2012 15:10:30 -0700
Message-ID: <CAAWBYDAGEsBAbEMhyoXrue8vj1WTwyV4gUy6NgGhq80LCkSsKQ@mail.gmail.com>
To: Daniel Holbert <dholbert@mozilla.com>
Cc: Ojan Vafai <ojan@chromium.org>, Alex Mogilevsky <alexmog@microsoft.com>, Tony Chang <tony@chromium.org>, "www-style@w3.org" <www-style@w3.org>
On Thu, May 17, 2012 at 3:01 PM, Daniel Holbert <dholbert@mozilla.com> wrote:
> On 04/04/2012 06:06 PM, Tab Atkins Jr. wrote:
>> On Wed, Apr 4, 2012 at 4:47 PM, Ojan Vafai <ojan@chromium.org> wrote:
>>> Why does it make sense to do this? margin:auto is the legacy api for
>>> centering. flex-align/flex-pack are more explicit and easier to understand.
>>> Why not have non-auto flex-align/flex-pack cause margin:auto to be ignored?
>>
>> I think either way is fine, but I'm actually somewhat partial to the
>> current spec ordering.  It keeps the box-model property effects as
>> close together as possible - non-auto margins have their effect in the
>> very beginning when figuring out free space, and then auto margins
>> have their effect immediately after flexing.
> [...]
>>
>> This seems to be a minor detail with no real effect on functionality,
>> and I'm attempting to stabilize this spec ASAP for Last Call, so I'd
>> prefer to do nothing with this feedback.  That okay?
>
> I'm a bit worried on this -- the spec is still confusing on the behavior
> of auto margins on baseline-aligned items, IMHO -- I think it needs some
> clarification.  Moreover, to the extent that this behavior is defined,
> it can easily lead to content overflowing its its flexbox line (and its
> flexbox, if the flexbox is auto-sized), and I think that's also bad.

You're right, it was still slightly unclear, and the way it was
defined, it could be read in a bad way.

I've added a line to the layout algorithm so that items explicitly
only use flex-item-align if they didn't have auto cross-margins.

~TJ
Received on Thursday, 17 May 2012 22:11:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT