RE: [css3-flexbox] multiline

> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> Sent: Tuesday, April 12, 2011 6:07 PM
>
> How do you calculate where linebreaks occur?  Presumably, you try to lay
> the element out using preferred widths first, break based on that, then do
> flex distribution in the measure axis per-line?

Exactly. I think that's the only reasonable way to calculate breaks.

> What about flexing in the length/extent axis in the presence of multiple
> lines, when the flexbox has a definite size in that direction?  In my
> original algorithm, I determined the extent of each line by looking for
> the element in each line with the largest size in that axis, and let the
> last line flex out to fill any leftover space in the flexbox.  That is, if
> a flexbox is 100px high, and has two lines of 40px tall items, the first
> line would just be 40px tall, while the latter would flex in a 60px space.
> This might not be the best solution.

I use exactly same flexing algorithm in both directions. 
If 'box-align' is 'stretch', each line is considered to have positive flex of 1 (there is no negative flexing for lines, we don't want them to overlap)
If 'box-align' is any other value, lines have flex of 0 and are packed in the direction of alignment ('box-align' is automatically mapped to transverse packing).

I don't particularly like reusing one property for two settings, it really should be a separate property 

 flex-line-pack: before|middle|after|justify

(with same behavior, unless we can think of something better)

Alex

Received on Wednesday, 13 April 2011 02:05:09 UTC