W3C home > Mailing lists > Public > www-style@w3.org > April 2016

Re: [css-grid] Reduced Subgrid Proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 20 Apr 2016 11:16:27 -0700
Message-ID: <CAAWBYDBhV49Y92b=iWnituacPWH7PZ+ib82ohcMhPGwFT1Gn5g@mail.gmail.com>
To: Rachel Andrew <rachelandrewuk@gmail.com>
Cc: www-style list <www-style@w3.org>
On Tue, Apr 19, 2016 at 9:55 PM, Rachel Andrew <rachelandrewuk@gmail.com> wrote:
> On 19 Apr 2016, at 23:53, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> The more complex case that isn't handled is if, for example, the
>> "main" area spans several columns, and you want the catalog items to
>> care about those columns, but you don't know how many rows there will
>> be so you can't line it up with the parent grid's rows.
>
> What I’m trying to wrap my head round in this case is what happens to
> additional row tracks created in the subgrid.

You can't create additional tracks in this proposal - subgrids have no
implicit grid.  You have to plan ahead and allocate exactly as many
tracks as you're going to need.

We acknowledge that this is a limitation, but not a killer one for
most cases.  A lot of cases that look like "subgrid" can actually just
be handled by nesting a grid, which has full powers to create implicit
tracks.  The main unhandled case is wanting a nested grid that cares
about the parent grid's lines in one axis only; this case appears to
be relatively rare/niche, and requires a *significantly* more
complicated solution, so we're proposing to defer it.

> So with this example:
>
> header  header
> sidebar main
> footer  footer
>
> If this is actually a 12 column grid, main might span 8 column tracks.
> However as we don’t tend to specify rows, a single row.
>
> If I’m using subgrid to line up my auto-placed catalog items inside main
> against the column tracks, but due to the amount of content if this were a
> normal grid new implicit row tracks need to be created.
>
> However this is a subgrid, are those additional tracks invalid or do they
> essentially add additional row tracks to the parent grid? Does sidebar now
> have additional rows?

This can be done if your 12 columns don't depend on content-based
sizing; if they're all lengths or percents or the like, you can do
this by just nesting a grid for "main" and *duplicating* the 8 columns
it crosses of the parent grid.

If you do depend on content-sizing, then yeah, can't do it.

~TJ
Received on Wednesday, 20 April 2016 18:17:14 UTC

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