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

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.

~Daniel

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