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

Re: [css-flexbox] Making percentage margins/padding consistent with Grid

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 15 Mar 2013 09:17:51 -0700
Message-ID: <CAAWBYDC9XDL+ct0y9uDmFM57hhh6oHgve44SwwM963JXah8LKA@mail.gmail.com>
To: James Holderness <j4_james@hotmail.com>
Cc: Ojan Vafai <ojan@chromium.org>, Andrew Fedoniouk <news@terrainformatica.com>, www-style list <www-style@w3.org>
On Fri, Mar 15, 2013 at 5:57 AM, James Holderness <j4_james@hotmail.com> wrote:
>> What are the use-cases for percentage margin/padding? The block approach
>> is
>> easier to implement. I agree that flexbox and grid should be consistent
>> with each other, but unless we have actual use-cases, I don't see the
>> benefit (beyond theoretical purity) of diverging from the block behavior.
>
> The most common use-case I'm aware of is for creating blocks with a specific
> aspect ratio that can still scale to fit the width of their container. For
> example, you set the width to 100%, the height to 0, and padding-top to 75%,
> and your block will fill the width of its container while retaining a
> constant 4:3 aspect ratio.
>
> Obviously this relies on the current block behaviour. I don't know whether
> there are perhaps better ways of accomplishing the same thing with flexbox
> and grid.

The better way is for us to add the aspect-ratio property, like how I
have it documented on my blog: <http://www.xanthir.com/blog/b4810>
(This proposal, as written, won't work, but it's close.)

~TJ
Received on Friday, 15 March 2013 16:18:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT