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

Re: [css3-grid-layout] grid-descendant grid items

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 09 Aug 2012 10:01:28 -0700
Message-ID: <5023ECE8.5080706@inkedblade.net>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
On 08/09/2012 09:25 AM, Tab Atkins Jr. wrote:
> On Thu, Aug 9, 2012 at 12:40 AM, fantasai<fantasai.lists@inkedblade.net>  wrote:
>> Basically what's needed is a way for a grid item to itself be
>> a grid whose items in turn participate in its parent's grid.
>> Here's a (very rough) proposal:
>>
>>    * Set the grid-span initial value to 'auto'. Have it generally
>>      compute to 1.
>>    * Define 'display: subgrid' to be an element that
>>       * itself is a grid element
>>       * determines its own number of rows and columns and uses
>>         that as its grid-span in its parent grid
>>       * has its items participate in the sizing of the parent grid
>>
>> Then you can place items into a grid, either as auto-placed children
>> or as explicitly-placed descendants, and have their contents
>> participate in the grid. This allows aligning content within grid
>> items across the grid, as with the inputs and labels in the form
>> example Bert gave.
>
> I don't see quite how this works.  Do you assume that the subgrid's
> margin/border/padding are subtracted from the sizes of the appropriate
> grid areas inside of itself?

Yeah, sorry, I forgot that bit. You treat the sub-items as if they had
an extra amount of margin equal to the grid-item's border/padding/margin.

> If so, what happens when the sum of this is larger than the size of
> one of the grid areas that its child wants to participate in?

You get bad layout, exactly as if the sub-item's margins were too large.

~fantasai
Received on Thursday, 9 August 2012 17:02:01 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT