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

Re: [css-grid] Subgrids considered essential

From: Eric A. Meyer <eric@meyerweb.com>
Date: Tue, 26 Jan 2016 20:50:45 -0500
To: "CSS WG" <www-style@w3.org>
Message-ID: <12A38AB3-4B6E-4ED3-B188-2AB2D1DE42BB@meyerweb.com>
On 26 Jan 2016, at 20:21, Robert O'Callahan wrote:

> Can you explain why 'display:contents' is not a good solution to the
> problem you describe?
> It seems much simpler than subgrids to me. On your blog you described 
> it as
> "a hack", but I don't see it that way. Normally in CSS an element lays 
> out
> its children but not (directly) their descendants; display:contents is 
> a
> generic way to lift an element's children to be laid out by its 
> parent.
> This is exactly what we need here. It makes more sense to me to have
> display:contents than separate specs for subgrids, subblocks, 
> subflexboxes,
> subtablerows, etc.

Yes, *in this very limited and specific case*, subgrids can meet the 
criteria.  But as I tried to make clear in the post, this is *a very 
limited and specific case*, meant to illustrate the basic principles at 
play without overcomplicating things, since it was meant for a more 
general audience-- in other words, authors who have little to no 
exposure to grids at this point.

I will try to find the time to produce some more complex examples that 
illustrate why I believe 'display: contents' is not up to nearly the 
same level of sophistication as subgrids.  Hopefully others can also 
provide some examples as well.

As for why I describe it as a "hack", I regard using 'display: contents' 
to take the place subgrids much as I regard using floats to take the 
place of an actual layout system.  Yes, it works; and yes, one can do 
clever things with it; but it's still a hack, as in a workaround for a 
limitation.  I applaud hacks when there's no other alternative.  I 
deplore setting things up such that hacks are necessary.

Eric A. Meyer - http://meyerweb.com/
Received on Wednesday, 27 January 2016 01:51:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:00 UTC