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

On 02/27/2015 11:37 PM, Tab Atkins Jr. wrote:
> 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.

The initial reason for the change was that Grid, as drafted and implemented
by Microsoft, was the other way around. If they refuse to change Grid, and
Blink refuses to change Flexbox, then we have a problem.

~fantasai

Received on Saturday, 28 February 2015 17:57:08 UTC