Re: [css3-flexbox] ED updated: algorithms and 'flex' property

On Tue, Feb 28, 2012 at 4:06 PM, Alex Mogilevsky <alexmog@microsoft.com>wrote:
>
> My preference BTW, just in case I haven't said before, to not have
> preferred size in 'flex' property at all. It is there because "flex:1;
> width:0;" is supposedly not intuitive.
>

Anecdotally, in helping debug old flexbox designs, the main confusion was
with percentage sizes and vertical flexboxes.  Often times there would be
code with flex: 1; height: 50%; and people would be confused why their
vertical flexbox doesn't fill half the available space.  Having separate
properties makes it hard to know the order in which flex and width/height
evaluate.

Perhaps "flex:1; flex-preferred-size:0; width:<ignored>;" would work better
> - it is more verbose, but totally clear and doesn't involve funky defaults.


I like this idea.  To expand on it further, we would have three separate
properties (e.g., positive-flex, negative-flex, flex-preferred-size) and
flex would just be a shorthand.  All would default to 0.  If we're not in a
flexing context or if positive flex and negative flex are both 0, we would
use width/height.  We only use flex-preferred-size if we have a positive or
negative flex value.

Received on Wednesday, 29 February 2012 01:00:07 UTC