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

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.

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

~TJ

Received on Thursday, 2 August 2012 16:34:55 UTC