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

On Fri, Dec 16, 2011 at 3:28 PM, Tony Chang <tony@chromium.org> wrote:
> On Fri, Dec 16, 2011 at 3:04 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>>
>> On Tue, Nov 29, 2011 at 4:13 PM, Alex Mogilevsky <alexmog@microsoft.com>
>> wrote:
>>
>> >
>> > I like the idea 'flex' property much more than 'flex' function. That IMO
>> > is totally "CSS way".
>> >
>> >        flex: [ <pos-flex> <neg-flex>? ]? || <preferred-size>?
>> [snip bit about sub-properties]
>>
>> So, yay/nay on this?  I'm okay with it, but I'm also okay with the
>> status quo.  Tony, Ojan, thoughts?
>
>
> I think it's workable, but I have some questions.
> - Would min-width/max-width still apply or should there be a
> flex-preferred-min-size?

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-%> ]

> - 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.

> - 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.

> - 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)".

> 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.

~TJ

Received on Friday, 16 December 2011 23:40:31 UTC