W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css3-flexbox] remove flex() function

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 4 Jan 2012 19:27:15 -0800
Message-ID: <CANMdWTtErtcPFp1LO-kL2KEVMzx527ReOUeWFCZF2=V9nZnvVg@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Tony Chang <tony@chromium.org>, "www-style@w3.org list" <www-style@w3.org>
Nay from me. I don't think it's the end of the world if we make this
change, but I find the new flexbox much easier to make sense of largely
because the values you set are width and height. It's not great that we
don't have a concept of a logical width for when you want to switch between
row and column, but in practice you'll hit that use-case writing flexbox
tests far more often than you'll hit in with real-world use-cases.

I acknowledge that there are some use-cases better met by a flex property,
but I don't think it's worth the loss in clarity of just setting
width/height directly.

Ojan

On Sat, Dec 17, 2011 at 12:53 PM, Alex Mogilevsky <alexmog@microsoft.com>wrote:

>  From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>  Sent: Friday, December 16, 2011 3:40 PM
> 
>  Oof, I forget about min/max.  It's kinda silly to switch away from
>  'width' to avoid being tied to a physical direction when min/max still
>  tie you down.  So yeah, I guess we'd have to include min and max in the
>  property, for something like:
> 
>  flex: [ <pos-flex> <neg-flex>? ] || <preferred-size> || [ max <length-or-
>  %> ] || [ min <length-or-%> ]
>
> Min/max sizes *should* be directional, they have to do with known
> qualities of content. I don't recall lack of flex-specific min/max ever
> being raised as a problem for old syntax... I would very much prefer to not
> add another redundant measurement (even optional) unless there is a strong
> use case for it.
>
>  > - If width and preferred size are omitted, do we still flex with a
>  > preferred size of 0?
> 
>  It would have the same defaults as normal, which is to default the
>  preferred size to 0.
>
> Agree
>
>  > - If preferred size is omitted, but width is provided, do we
>  > completely ignore the width and use the default preferred size of 0?
> 
>  Yeah, that seems the sanest thing.
>
> Also agree, but I think there should be an option to use specified width.
> Perhaps 'auto' preferred width could mean that 'width' property is used? So
>
>        flex:1 auto; width:100px;
>
> would be same as
>
>        flex:1 100px;
>
> what do you think?
>
>  > - What is the initial value of flex? It would have to be "0 0 auto" to
>  > get the same behavior as the current spec (no flexing and auto
>  > sizing).  It's a bit weird that if you then use flex: 100px, it
>  > resolves to an initial value of "1 0 100px".
> 
>  Hmm, I don't find that particularly weirder than the fact that the
>  default for 'width' is "auto" (equivalent to "flex(0 0 auto)"), but
>  specifying "width:flex(100px)" is equivalent to "width: flex(1 0 100px)".
>
> Actually with this change of syntax, "flex:100px" really should mean
> "flex:0 0 100px". That would be much cleaner design and it is how initial
> values behave elsewhere.
>
> Note that if you really think default flex should be "1" you can make that
> initial value. I am not suggesting that's the right thing to do but it
> would also be consistent.
>
> 
>  > It's also a bit weird that, e.g., if you open a document using
>  > developer tools and you want to change the size of a flex item,
>  > changing width won't do anything.  This could also be confusing for
>  > user style sheets or user scripts.
> 
>  Yes, those are some downsides.
>
> Yes, and it makes me uncomfortable every time I think about it. It may be
> not intuitive if 'width' in flexbox is <preferred-width>, but it will be
> confusing only first couple of times somebody uses flexbox, and perfectly
> natural for the next 60 years that somebody uses CSS...
>
> --Alex
>
Received on Thursday, 5 January 2012 03:28:03 GMT

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