W3C home > Mailing lists > Public > www-style@w3.org > August 2012

RE: [css3-grid-layout] "stretch" value in grid-row/column-align is underspecified

From: Phil Cupp <pcupp@microsoft.com>
Date: Mon, 6 Aug 2012 17:56:04 +0000
To: 'Tab Atkins Jr.' <jackalmage@gmail.com>, www-style list <www-style@w3.org>
CC: Chris Jones <cjon@microsoft.com>, Markus Mielke <mmielke@microsoft.com>, Alex Mogilevsky <alexmog@microsoft.com>, Sylvain Galineau <sylvaing@microsoft.com>, "fantasai (fantasai.lists@inkedblade.net)" <fantasai.lists@inkedblade.net>
Message-ID: <9BFF145D69548148BC2B26C0C9EE103314DB6BF5@SN2PRD0310MB396.namprd03.prod.outlook.com>
Stretch can impact auto margins when width/height are not auto.  Also in the over-constrained case the ending margin is adjusted to make the grid item's box fit its grid cell.  Here is what we have in the current working draft [1] (note: please ignore section 8 of the current editor's draft, important bits were accidentally edited out in the last round of updates but will be restored shortly):

Section 8.1
A value of ‘stretch’ causes the Grid item’s width to shrink or grow in accordance with the equation for calculating block width described in section 9.3 of the CSS3 Box Model. Note that this calculation is symmetric for both the width and height of the Grid item.

Section 9.3 of CSS3 Box [2] defines the sizing for block-level, non-replaced elements in normal flow when ‘overflow’ computes to ‘visible’, which I think is the behavior that both the grid and flexbox implement for stretching items.

Let me know if you think more is needed and I'll open an issue in bugzilla.  

Also, should we centralize this definition?  Fantasai's alignment spec [3] has the following for defining align-self stretch which we could expand on: ‘stretch’ Sizes the box to exactly fit its containing block.

Thanks, Phil

[1] http://www.w3.org/TR/css3-grid-layout/#calculating-the-size-of-grid-items

[2] http://www.w3.org/TR/css3-box/#blockwidth

[3] http://www.w3.org/TR/2012/WD-css3-align-20120612/#align-self

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Thursday, August 2, 2012 11:46 AM
To: www-style list
Subject: [css3-grid-layout] "stretch" value in grid-row/column-align is underspecified

I presume that the "stretch" value only has an effect when the width/height of the item is "auto", right?  This should be specified similarly to Flexbox.


Received on Monday, 6 August 2012 17:56:43 UTC

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