Re: [css3-flexbox] is this correct use case?

On Thu, Aug 2, 2012 at 9:34 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Thu, Aug 2, 2012 at 12:24 AM, Andrew Fedoniouk
> <news@terrainformatica.com> wrote:
>> Do you know what is flex value of 'auto' in margin-left:auto ?
>
> Free space is first given to the 'flex' property, then if there's any
> left over, to the 'margin' property, then if there's any left over, to
> the 'justify-content' property.  So, auto margins aren't comparable to
> flex.
>
>> In other words: what would be computed
>> values of margins/width here:
>>
>> .flex > div {
>>   margin-left: auto;
>>   width: auto; /* or shall it be flex-grow:1 ? */
>>   margin-right: auto;
>> }
>
> If you change it to "flex-grow: 1" (auto widths don't activate flexing
> by themselves), then the width will take up the whole space, and the
> margins will be 0.

So css3-flexbox demands three "layers" or steps in free space
distribution algorithm:
1. Distribute space to things defined by flex-grow.
2. Distribute space left after 1 among margins that have 'auto' value.
3. And finally do distribution defined by alignment.

It is not clear why steps 1 and 2 are separated.

And again 'auto' gets one more role/sense... This time
it will be a synonym of something like secondaryFlex(1).

>
>> And things like:
>>
>>   margin-left:1*auto;
>>   margin-right:2*auto;
>>
>> seem like still not there yet.
>
> Correct.  We may address this in the future; until then, you can use
> spacer elements in your markup to achieve arbitrary spacing ratios.
>

This will require introduction of real flex units.
When you will have flex units then it is not clear what you will
do with all those flex-*** properties that define flexes for width/height only.

Why not to use flex units from very beginning?

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Friday, 3 August 2012 06:42:56 UTC