W3C home > Mailing lists > Public > www-style@w3.org > November 2013

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 10 Nov 2013 10:00:50 -0800
Message-ID: <CAAWBYDBQeS8BhKypLP268HV2S3oPSg0aeBzn269QhjE-Q4xc=w@mail.gmail.com>
To: Bruno Racineux <bruno@hexanet.net>
Cc: www-style list <www-style@w3.org>
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

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.

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

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:34 UTC