W3C home > Mailing lists > Public > www-style@w3.org > February 2015

Re: [css-flexbox][css-grid] Reverting vertical % padding/margin to match block

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 27 Feb 2015 20:37:33 -0800
Message-ID: <CAAWBYDCF+H9MWfnhTz4MJ7LGiXCWk=eoUhAo5HTeEJaT8mb8Uw@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: www-style list <www-style@w3.org>
On Fri, Feb 27, 2015 at 7:14 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 02/26/2015 02:42 PM, Tab Atkins Jr. wrote:
>> Traditionally (for uninteresting reasons), vertical percentage padding
>> on elements was resolved relative to the *width* of the element, not
>> the height.  In other words, in ".foo { width: 100px; height: 200px;
>> padding-top: 50%; }", the value of padding-top is 50px, not 100px!
>>
>> This was a weird detail and quite different from how percentages work
>> pretty much everywhere else in the language, but some people came to
>> depend on it, such as to create elements with aspect ratios.
>>
>> Flexbox and Grid, being new layout modes, took the opportunity to fix
>> this, and defined that vertical percentage margins and padding are
>> relative to the height of the element, like you'd naively expect.
>>
>> Blink has never implemented this, and in talks with our implementors,
>> we don't plan to.  Some quotes: [...]
>>
>> So, while I understand and am totally sympathetic to the reasons we
>> defined the behavior the way we did, I also find the counter-arguments
>> reasonable.  Since we're fairly intent on willfully violating the spec
>> here, would it be okay to change the spec back to match the % behavior
>> that Block has?
>
> I don't have a strong opinion one way or another, and wouldn't mind
> changing the spec back if that helps authors with consistency or there's
> content depending on it or whatever. However, I'm strongly in favor of
> keeping Flexbox and Grid consistent. If we change, we change both of them.

Strongly agree, and why I purposely talked about both Flexbox and Grid
here.  These two are clearly linked up and should act the same,
regardless of which way we settle.

~TJ
Received on Saturday, 28 February 2015 04:45:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC