Re: Fw: RE: [css-flexbox] Summary of planned changes to Flexbox Module

On Sun, May 9, 2010 at 3:33 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Mon, May 10, 2010 at 4:46 AM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>>
>> You can still set min/max-width.  Does that address your needs?  Using
>> flex units means changing from the additive flex model that Flexbox
>> currently describes to an absolute flex model.
>
> This is actually a problem, as David pointed out.
>
> Maybe we can solve it using calc()? I.e., "width: calc(200px, 2*)"?

I assume you mean calc(200px + 2*)?  Yeah, that's definitely a
possible solution.

However, the situation David presents doesn't *necessarily* require
additive flex, I believe.  The Firefox toolbar is set up something
like this:

<toolbar>
  ...stuff...
  <urlbar>
    <identifier>
    <input>
    <dropdown>
  </urlbar>
  <searchbar>
    <identifier>
    <input>
    <dropdown>
  </searchbar>
</toolbar>

Now, the way it flexes right now is equivalent to this:

urlbar { width: calc(fit-content + 3*); }
searchbar { width: calc(fit-content + 1*); }
input { width: 1*; }

But most of the time, the following will be nearly equivalent:

urlbar { width: 3*; min-width: fit-content; }
searchbar { width: 1*; min-width: fit-content; }
input { width: 1*; }

The difference only becomes noticeable for very small sizes if the
ratio of the intrinsic widths of the urlbar and searchbar are
significantly different from 3:1.  In that case, one bar will start to
flex before the other one as free space becomes available.  Once
you've gotten a decent chunk of free space, though, the difference is
only a couple of pixels.

~TJ

Received on Sunday, 9 May 2010 23:31:16 UTC