Re: [css-flexbox] Computation Algorithm

From: "Tab Atkins Jr." <>
Sent: Monday, May 10, 2010 8:33 PM
To: "Andrew Fedoniouk" <>
Cc: <>
Subject: Re: [css-flexbox] Computation Algorithm

> On Mon, May 10, 2010 at 8:16 PM, Andrew Fedoniouk
> <> wrote:
>> Looking on this document in Mozilla:
>> I am getting this rendering:
>> Two boxes here are defined as:
>> #box2 { box-flex: 1.0; width:200px; background:gold;}
>> #box3 { box-flex: 2.0; width:200px; background:red;}
>> According to the name of the property ("box-flex") I would expect that 
>> box3
>> (flex:2) and box2 (flex:1)
>> widths will be in proportion 2:1. At least box3 should be wider than 
>> box2.
>> But in fact box3 is smaller! That is completely unexpected
>> as all other properties of these two elements are the same.
>> It appears that different values of the 'width' may change
>> meaning of 'box-flex'. Larger values of the flex may lead to larger 
>> widths -
>> proportion A/B. But as we can see larger flexes may lead to smaller 
>> widths
>> too - suddenly to change to B/A.
>> In any case box-flex multiplier appears as completely unpredictable when
>> 'width's are expressed in percents.
>> Question to authors of the FlexBox proposal:
>> what is the motivation to use such an algorithm?
>> And yet: if someone would ask to define in one sentence (for dummies)
>> meaning of such "box-flex" what would be that sentence? What does it
>> mean/flex to be short?
> I've tried to explain this multiple times, and the spec for Flexbox
> explains it as well.  Let me try one final time, with a few examples.


Tab, I asked for one sentence explanation of the box-flex. For the army
of web developers who will try to use this. Just imagine that
you are writing manual explaining the flex for ordinary people.

So far we've got this: "box-flex define flexibility of the element" (C) Rob.
A bit of tautology of course but may work for some people.

is slightly better version of the definition. But it just expresses the 
"Elements with larger flex values will be made larger than elements
with lower flex values, at the ratio determined by the two elements."
- not the real situation.
If to use my example then a) it is "larger" only when Jupiter is in 
and b) "at the ratio" is not relevant at all.

That is why my question. I am lost in getting any idea of
author's motivation for such flex algorithm.

Probably I am poison by my own implementation that
was just taken from existing HTML spec "as is":
I've found this explanation as simple and quite obvious - I see no
reasons to change it.

My sarcasm is probably over-expressed but flexes are very critical
as they are foundation of bunch of new possibilities and technologies.
We have to make them right.

Andrew Fedoniouk


Received on Tuesday, 11 May 2010 05:19:15 UTC