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

On 08/09/2012 09:25 AM, Tab Atkins Jr. wrote:
> On Thu, Aug 9, 2012 at 12:40 AM, fantasai<>  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.


Received on Thursday, 9 August 2012 17:02:01 UTC