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

I have not noticed the warning of margins collapsing in the new draft. Please say it was accidentally copied from elsewhere and you didn't really mean it.

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Tuesday, May 11, 2010 5:00 PM
To: robert@ocallahan.org
Cc: Alex Mogilevsky; Adam Del Vecchio; www-style@w3.org
Subject: Re: Fw: RE: [css-flexbox] Summary of planned changes to Flexbox Module

On Tue, May 11, 2010 at 2:47 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Wed, May 12, 2010 at 9:45 AM, Robert O'Callahan 
> <robert@ocallahan.org>
> wrote:
>>
>> On Wed, May 12, 2010 at 8:55 AM, Tab Atkins Jr. 
>> <jackalmage@gmail.com>
>> wrote:
>>>
>>> box { display: flexbox; }
>>> box > * { margin: 0 1fl; } /* Margins will collapse in the new draft 
>>> */
>>
>>
>> Yikes. Collapsing margins containing flexes sounds ... hard.
>
>
> Well, it's not hard if margins can only be a fixed length or a flex, 
> but not both. If you allow additive flex in margins, collapsing them 
> will be very hard.

Not necessarily.  Say two adjacent margins are calc(20px+1fl) and calc(10px+2fl).  I think we could get away with collapsing their pieces separately, so it's equivalent to a single margin with calc(20px+2fl).

This isn't the only possible way to do this, but it's a simple way to handle it that I think will typically do what you want.

~TJ

Received on Wednesday, 12 May 2010 00:09:02 UTC