Re: [css-flexbox] performance concern over align-items: 'stretch' as default value

On Fri, Nov 8, 2013 at 8:03 PM, Bruno Racineux <bruno@hexanet.net> wrote:
> Just curious at to why it was determined that the default for 'align-items'
> should be 'stretch'?
>
> I am doing my first site using a Flex framework with Table-cell(s) fallbacks
> and,  I have many instances where the vertical stretch is not needed
> especially if it only consist of one nowrap row. Hence me thinking to
> default my main flex class to "flex-start" instead. I was a bit surprised
> seeing 'stretch' as default.
>
> Isn't that an unnecessary overkill performance-wise for those who are not
> aware?
>
> I just want to raise that concern in correlation with the following article
> mentioning a 2-pass when align:stretch is involved:
> http://updates.html5rocks.com/2013/10/Flexbox-layout-isn-t-slow
>
> I am thinking a 'flex-start' default might be more appropriate.

A significant number of basic use-cases want 'stretch', so it's a
reasonable default.  This was carried over from the earlier 2009
draft.

For example, in the case you bring up, where you're using table-cell
as a fallback, 'stretch' matches the 'table-cell' behavior.  It may be
that in your particular case that matching isn't important, but for
many people it will be.  We're optimizing the default case for
usability, not performance, here.

Finally, Flexbox has been shipping with its current defaults for too
long to change anymore, even if we wanted to.  Oh well.

~TJ

Received on Sunday, 10 November 2013 18:01:37 UTC