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

RE: [css-grid] Reduced Subgrid Proposal

From: Francois Remy <francois.remy.dev@outlook.com>
Date: Mon, 18 Apr 2016 15:15:21 -0700
Message-ID: <DUB408-EAS3260988BC54D5075B159FDCA56B0@phx.gbl>
To: "'Tab Atkins Jr.'" <jackalmage@gmail.com>
CC: "'fantasai'" <fantasai.lists@inkedblade.net>, "'www-style list'" <www-style@w3.org>, "'Eric A. Meyer'" <eric@meyerweb.com>, "'Jen Simmons'" <jen@jensimmons.com>, "'Rachel Andrew'" <rachelandrewuk@gmail.com>
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> On Mon, Apr 18, 2016 at 10:21 AM, Francois Remy
> <francois.remy.dev@outlook.com> wrote:
> >> fantasai's message is the long and complete proposal, so for the
> >> purpose of easier comprehension, here's the tl;dr:
> >>
> >> display:subgrid is very similar to display:contents - the elements'
> >> children position/size/etc in the *parent* grid instead.  Except:
> >>
> >> * they get positioned "as a group" - they can only fill the grid
> >> cells that the subgrid does (which is predefined - subgrids need an
> >> explicit grid span in both dimensions)
> >> * the subgrid itself does draw (so you can have margin/border/padding
> >> around the group)
> >> * when sizing, the subgrid itself contributes - it acts like an empty
> >> grid item in the parent grid, and its children that touch one of its
> >> edges act like they have extra margin equal to the m/b/p of the
> >> subgrid on that edge, so they'll
> >> *look* like they're visually aligned
> >> *within* the subgrid by default (despite laying out in the parent grid
> instead).
> >
> > With the addition of "repeat this group of tracks as a block" that might
> work out. Still not confident about it, though, because last I know you could
> only auto-repeat things that were fixed-sized. Since this change is not
> specced yet, I would just want to get a few examples of how you would use
> this track-group repeat. Is this a auto-row feature?
> 
> I'm not sure what you're asking about.  Isn't this all addressed by #5 in the
> proposal?  What specifically is confusing you about that?

| repeat(auto-fill, ...) and repeat(auto-fit, ...) gain
|    back a full <track-list> argument.  Per the use-case,
|    only full track-list repetitions are allowed; if tracks
|    are dropped, the entire track-list group must be dropped.

I was wondering whether this meant repeat(...) would take auto-sized tracks, and if that is something implementors could deal with.

My subgrid example definitely does require auto-sized tracks, but it could be achieved with just auto-rows taking multiple tracks, so I am not sure why this proposal speaks about auto-fit/auto-fill groups of tracks. That looks unnecessary for the feature, which is why I asked.




> > I would also want more details about how this proposal handles
> position:absolute items. Since all elements are laid out in the main grid, my
> understanding is that if you parent subgrid has position:relative, this does
> not affect you in any way; is that correct? Is there a way you could get an
> absolutely positioned layer on top of your subgrid (that would be inside the
> subgrid) without giving up on auto layout in the subgrid? That might be a
> broader grid issue though, didn't think this through entirely.
> 
> Abspos children of a subgrid, like grid items of a subgrid, get laid out
> according to the parent grid, but with the scoped lines; they only see the
> numeric lines contained in the subgrid (renumbered within the subgrid to be
> 1-N again), and whatever named lines it creates/receives.  This should be
> implicit in the "exactly like grids, except" part.

Ok, Thanks for the clarification! Because of the reordering+clamping, you can make it work by spanning them from 0 to infinity (or a better upper bound if you have some) which will map to the right space. For some reason I missed the part about the line numbers being shifted appropriately.
Received on Monday, 18 April 2016 22:15:54 UTC

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