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

Re: [css3-flexbox] when are margins on flexbox-items computed & subtracted from available space?

From: Daniel Holbert <dholbert@mozilla.com>
Date: Fri, 17 Feb 2012 10:57:58 -0800
Message-ID: <4F3EA336.8050800@mozilla.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org list" <www-style@w3.org>
On 02/16/2012 06:42 AM, Alex Mogilevsky wrote:
 > All flexbox algorithms deal with margin boxes. If it is not
 > made clear in the algorithm, it may need to say somewhere that
 > margins, border and padding are added to the preferred size.

Ok -- thanks for clarifying that.  I think that's not particularly clear 
in the current spec (though it makes intuitive sense).

I think it's also not quite as simple as you say -- IIRC, the MBP size 
isn't supposed to be considered in "max-width" / "min-width" checks 
(correct me if I'm wrong?), so it's not as simple as just adding it to 
the preferred size.

So, it's probably better to instead _subtract_ MBP from available space, 
before distributing anything.

One other point of confusion would be if (per an outstanding proposal) 
we wait to resolve auto margins until _after_ the flexbox algorithm has 
run.  I guess we'd just need to say that "margin:auto" is treated as 0 
during the flexbox algorithm, up until the point where we explicitly 
resolve it.

Received on Friday, 17 February 2012 18:58:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC