Re: [css3-flexbox] cascading of flex()

To accomplish this:
“that start at 100px, grow and not shrink in horizontal ”

you just need to define

{ width:flex(1); min-width:100px; } 

May I remind again that this preferred stuff in flexes is just useless. BTW: I asked many times for examples of  flexes with preferred lengths
but did not get any real examples. 

Andrew Fedoniouk

From: Alex Mogilevsky 
Sent: Tuesday, November 08, 2011 9:31 AM
To: Ojan Vafai ; Tab Atkins Jr. 
Subject: RE: [css3-flexbox] cascading of flex()

Here is a use case: I have a flexbox that I want to be sometimes horizontal and sometimes vertical. It has buttons in it. Setting “width:flex(1 0 100px);” will get me buttons that start at 100px, grow and not shrink in horizontal and are all 100px wide in vertical. If I lost “100px” when flex is not applicable to width (vertical) I would resort to “auto” which is not necessarily what I want.


I still like the choice of using “preferred”. It has an odd case of zero – flex(1) is clearly meant for flexbox and almost never will translate into zero actually being preferred size otherwise. But any other value for actual preferred width, including auto, will usually be preferred in any other layout type.


From: [] On Behalf Of Ojan Vafai
Sent: Tuesday, November 08, 2011 8:59 AM
To: Tab Atkins Jr.
Cc: Alex Mogilevsky; list
Subject: Re: [css3-flexbox] cascading of flex()



On Tue, Nov 8, 2011 at 5:58 AM, Tab Atkins Jr. <> wrote:

On Tue, Nov 8, 2011 at 5:02 AM, Alex Mogilevsky <> wrote:
> Now, when happens to not be a flexbox, what is computed value of ‘width’ ?
> I see two options:
> 1)      100px (the ‘preferred’ part of flex)
> 2)      auto (initial value)

I am fine with it computing to the preferred width.


The last paragraph of already requires this, no?

As for flex(1), I believe that for simplicity sake, we should say that sets the preferred size to 0 in non-flex contexts. There's no use-case for doing this. If authors doing it, they're surely making a mistake and will need to fix it. So, we should do the behavior simplest to implement/understand.

Received on Wednesday, 9 November 2011 05:45:20 UTC