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

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

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 8 Nov 2011 17:31:02 +0000
To: Ojan Vafai <ojan@chromium.org>, Tab Atkins Jr. <jackalmage@gmail.com>
CC: "www-style@w3.org list" <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928412D4C8C4@TK5EX14MBXC214.redmond.corp.microsoft.com>
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: ojan@google.com [mailto:ojan@google.com] On Behalf Of Ojan Vafai
Sent: Tuesday, November 08, 2011 8:59 AM
To: Tab Atkins Jr.
Cc: Alex Mogilevsky; www-style@w3.org list
Subject: Re: [css3-flexbox] cascading of flex()


On Tue, Nov 8, 2011 at 5:58 AM, Tab Atkins Jr. <jackalmage@gmail.com<mailto:jackalmage@gmail.com>> wrote:
On Tue, Nov 8, 2011 at 5:02 AM, Alex Mogilevsky <alexmog@microsoft.com<mailto:alexmog@microsoft.com>> 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 http://dev.w3.org/csswg/css3-flexbox/#resolving-flexible-lengths 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 Tuesday, 8 November 2011 17:31:41 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT