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

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.

~fantasai

Received on Saturday, 28 February 2015 03:15:18 UTC