W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: [css-flexbox] percentage paddings, again

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 17 Apr 2014 18:55:15 -0700
Message-ID: <CANMdWTt1wabPJzEM8GWBtxJMZphL0rTy+G0pQwMnEwsHwqVkSg@mail.gmail.com>
To: Greg Whitworth <gwhit@microsoft.com>
Cc: John Kreitlow <john.kreitlow@gmail.com>, Christian Biesinger <cbiesinger@google.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Daniel Holbert <dholbert@mozilla.com>, "www-style@w3.org" <www-style@w3.org>
On Thu, Apr 17, 2014 at 8:50 AM, Greg Whitworth <gwhit@microsoft.com> wrote:

> > I made this codepen to outline the case:
> http://codepen.io/radium-v/pen/ropFz
> > The example works as I'd expect in Chrome 34, IE11, and Safari 7 - but
> it unfortunately breaks in Firefox 28 (Daniel suggests the opposite though,
> that FF
> > exhibits the correct behavior while the other browsers fail to match the
> spec).
> > It seems to me that the paragraph from the spec is intended for
> single-line flex containers. It doesn't take into account how multi-line
> containers
> > should behave, especially their dimensions aren't explicitly defined.
> > There's some more detail regarding this section of the spec found here
> http://lists.w3.org/Archives/Public/www-style/2013Mar/0688.html
> > I'm in favor of changing things here - it shouldn't be assumed that a
> flex container is more likely to be given an explicit height, since it's
> not assumed in most other cases.
>
> Those are all valid points, but we would prefer Grid and Flex being
> consistent with one another and resolving these values in the same manner.
> Because of that, we are in favor of IE and Chrome updating their
> implementations to match Gecko and the spec. I do think you bring up an
> interesting use case and would love to see us address it since authors will
> undoubtedly hit it.
>

I agree that grid and flex should be consistent, but disagree with your
conclusion.


> I do like Tabs idea of a property because then there is no confusion to
> the author as to what they are selecting to resolve against. I also think
> that resolving padding-top against the width is similarly confusing to
> authors and we shouldn’t repeat that (I understand why they chose that for
> flows) but for a long time I always assumed that it _WAS_ resolved against
> the height.
>

Yes it's confusing and weird. If I were designing the platform from
scratch, I would just disallow percentage height/padding entirely. But,
making flexbox/grid be different than every other display type just adds to
the confusion.

If there were significant use-cases that we couldn't meet with percentage
paddings resolving against the width, then it might be worth reconsidering,
but I have yet to see compelling use-cases and have seen bugs from web
developers where they want the resolve-against-width behavior. In the time
we've been shipping flexbox, we've never once gotten a bug filed where
someone wanted to have percentage paddings resolve against height.
Received on Friday, 18 April 2014 01:56:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC