W3C home > Mailing lists > Public > www-style@w3.org > April 2011

RE: [css3-flexbox] multiline

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Wed, 13 Apr 2011 02:04:38 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928411F2BDCE@TK5EX14MBXC213.redmond.corp.microsoft.com>
> 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)

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:45 UTC