W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Auto margins and shrinkwrapping [css-flexbox][css-grid][css-writing-modes]

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 25 Jul 2014 20:12:29 +0100
Message-ID: <53D2AC1D.6070709@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
(This is mostly a note to myself.)

Issue is wrt auto margins. Note: Margins default to zero.

For auto-sized items, a block-level block will fill its containing
block in the inline dimension. Setting margins to auto has no effect,
it's just like having zero margins. If you make the block smaller
than the containing block by setting an explicit width (or turning
it into a table), then it can be aligned with auto margins.

In flex and grid layout, if you have at least one auto margin, the
item shrinkwraps. Therefore, if its content is smaller than the
container, it can be margin-aligned.

I can't remember what we do with block-level grid and flex containers.
I think we should make them shrinkwrap if either margin is zero,
because that would be useful and make sense and the current behavior
is easy to get by *not doing anything* and getting the default margins
of zero.

This also shows up in orthogonal flows. Currently trying to unravel
that as well, and came to this conclusion, that they should shrinkwrap
if a margin is auto and fill-available otherwise.

~fantasai
Received on Friday, 25 July 2014 19:13:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC