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

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

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 9 Aug 2012 13:54:33 -0700
Message-ID: <CANMdWTu0pr=UMO12nU+m8zPOiW_bVsQfECgVV2xnMOmw1Xyizw@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "www-style@w3.org" <www-style@w3.org>
On Thu, Aug 9, 2012 at 10:01 AM, fantasai <fantasai.lists@inkedblade.net>wrote:

> 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<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.
Do you have a link to this example?

 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 20:55:23 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:18 UTC