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

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

From: James Holderness <j4_james@hotmail.com>
Date: Fri, 15 Mar 2013 12:57:06 +0000
Message-ID: <BLU0-SMTP133B0C2DF67A72D2F4F837ABEED0@phx.gbl>
To: "Ojan Vafai" <ojan@chromium.org>, "Andrew Fedoniouk" <news@terrainformatica.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style list" <www-style@w3.org>
> 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.

Received on Friday, 15 March 2013 12:57:31 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:25 UTC