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

RE: [css3-grid-layout] grid-column-span: auto

From: Phil Cupp <pcupp@microsoft.com>
Date: Fri, 24 Feb 2012 21:15:55 +0000
To: François REMY <fremycompany_pub@yahoo.fr>, Alex Mogilevsky <alexmog@microsoft.com>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Markus Mielke <mmielke@microsoft.com>
CC: CSS 3 W3C Group <www-style@w3.org>, Alexander Shpack <shadowkin@gmail.com>
Message-ID: <58A081B0F3FA704EAB1082E64639BB010A4216C8@TK5EX14MBXC284.redmond.corp.microsoft.com>
Hi Francois,

Thanks for the message.  Comments inline below...

> From: François REMY [mailto:fremycompany_pub@yahoo.fr] 
> This mail concerns the addition of “grid-*-span: auto”.
>Suppose I have a grid defined like this :
><div id=”grid”>...<div class=”tile”>Some content</div>...</div>
>#grid { grid-columns: repeat(100px); grid-rows-sizing: 100px; grid-flow: columns; }
>#grid > div.tile { background: #333; margin: 10px; padding: 10px; color: white; }
[pcupp] There is currently no syntax that supports indefinite repetition of a track sizing group - though this would be an interesting problem to work on.  Currently, you need to specify explicitly how many times you want to repeat.

>Now, imagine that some tiles contains more text than some other, and that I would like to get a result close to what you can see in the image I attached to this mail.  I propose to add a “grid-row-span: auto” and a “grid-column-span: auto” values. Those values have the following effect: 
>(1) if grid flow is set to none, that property is silently ignored for elements whose (min-)width/(min-)height isn’t specified. For elements for which (min-)width/(min-)height is specified, find the minimal row/column span needed to fit the element in (depends on where the element is drawn). Auto-size columns/rows have infinite width/height.
>(2) if grid flow is set to rows, increment the number of columns so that the element fit in resulting cell range. If the maximal number of of columns has been reached, increase row-span by one and reset column-span to one, and restart.
>(3) if grid flow is set to columns, do like (2) but inversing the role of columns and rows.
>Does this seem an implementable thing? (it can be delayed for level 4 if it’s possible to do but difficult to specify)
 [pcupp] I'm not sure I fully understand the proposal yet.  I think it is: having determined the min-content width/height of an item and the used sizes of all tracks, adjust the span of the item to avoid overflowing the tracks into which the item is positioned (whether or not the position has been explicitly supplied or has been determined automatically).  Is that right?

If so, the feature can't work with content-sized tracks because the position of all items must be determined before you know the used size of all tracks, and the used size of all tracks seems necessary for this feature to work.  I think you've recognized that and declared that content-sized tracks can satisfy the auto span requirements for any item, but it seems strange for an auto-placed item having an auto span to "stick" in the first auto track it encounters as it searches for its spot in the grid.

Not all grids need to have content-sized tracks though, so this may be useful in those cases, but I'd rather defer work on it unless you feel there are scenarios that are important and can't be made to work without such a feature. 

Let me know if I've misinterpreted your comments.
>BTW, the specification doesn’t seem to recommand to use [css3-grid-layout] when sending comments about the spec, that should probably be changed.

Thanks.  I can fix that in the next update.
Received on Friday, 24 February 2012 21:16:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC