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

On 29/02/2012 19:11, Tony Chang wrote:
> On Tue, Feb 28, 2012 at 6:58 PM, Alex Mogilevsky<alexmog@microsoft.com>wrote:
>
>> ± From: Daniel Holbert [mailto:dholbert@mozilla.com]
>> ±
>> ± I like the sound of this too -- one thing though.  It sounds like with
>> ± your proposed semantics, the 50px here would be ignored:
>> ±
>> ±<div style="display: flexbox">
>> ±<div style="flex: 0 0 50px"/>
>> ±</div>
>> ±
>> ± That seems undesirable.
>>
>
> I agree that this is undesirable, but I am a bit skeptical it will happen
> that much in practice.  It's hard to say without developer feedback.
>
>
>> I think the current syntax is a very reasonable compromise:
>>
>>         * When flex is not specified - no flexibility and
>>           width/height work as usual
>>         * When flex is specified, default "preferred size" is zero,
>>           overriding width/height
>>         * "flex:1 100px; width:200px;" makes width ignored, not perfect,
>>           but is clear enough since there are two values and one must win
>>         * "flex:1 auto" (no width/height) means
>>           "calculate natural size, then flex"
>>
>
>   Wouldn't something like 'flex: 1 derived' be more clear?
>
>
>>         * "flex:1 auto; width:50%;" is the only case that can lead
>>           to confusion. But if you think about it as 'width' property
>>           providing additional info for calculating "natural size",
>>           it makes perfect sense.
>>
>
> 'flex: 1 derived; width: 50%' also seems more clear than using auto here.

I sympathize with your argument that an explicit keyword might be easier 
to understand, and that the current setup prevents us from choosing a 
preferred size of 'auto' (as opposed to choosing a preferred size of 
"natural size").  However, I think the cognitive overhead of an 
unfamiliar keyword to achieve what is frequently the desired behaviour 
(when 'auto' is commonly used elsewhere for that kind of thing), 
together with the fact that I can't actually come up with any use cases 
where I'd want the preferred size to be what you'd get with width:auto 
instead of the natural size arising from a non-auto specified width, 
together with the fact that if you /did/ want that then you could just 
specify width:auto in the first place, I think the current syntax is OK.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Monday, 23 April 2012 09:33:35 UTC