Re: [csswg-drafts] [css-grid-2] Subsetting grid-template-areas in subgrids (#4411)

@fantasai 
> A, B, and C will all have that effect.

They behave slightly differently though. For example:
```css
.grid { grid-template-areas: "a a a a a a a a a a"; }
.subgrid { grid-template-columns: subgrid [a-start];  grid-column: 3 / span 5; }
.item { grid-column: a-start 2; }
```
With A, the subgrid's explicit `a-start` is the same line as its implicit `a-start` from the `a` area, so `a-start 2` doesn't match an explicit line and the item ends up in the last track of the subgrid. With B, no explicit line match either but now we match the implicit line before the subgrid, which we'll clamp to line 1 in the subgrid.

B has the effect that for example `x 3` can be before `x 2`, which seems confusing:
```css
grid-template-columns: [x] 0 [x];
```

C needs to define what a missing `-start/-end` lines resolves to.  The way it works now is that all implicit lines matches all names so there are never any matching errors really (which is an easy and consistent model to understand IMO).  What does `a-start 30` resolve to in the first example above if lines after the subgrid's last line don't match `-start` names?

D will also have some surprising effects due to collapsing all names to the edge line. e.g.
```css
.grid { grid-template-columns: [a] 0 [a] 0 [a] 0 [a]; }
.subgrid { grid-template-columns: subgrid;  grid-column: 10 / span 5; }
```
which is the subgrid is equivalent to `subgrid [a]` which means `a 2` etc will behave strangely. I also don't like that _explicit_ line names outside the subgrid can affect the matching inside the subgrid. Insulating the subgrid from unrelated line name changes seems like a good property to have.

E: I like this option more the more I think about it. It's a very simple model.

(Was D supposed to be what @mirisuzanne suggested? If so, I understood her suggestion differently. She only said that "A-variation that is still based on line-names rather than tracking areas" so I don't think she meant to include **all** line names (as in D), but only implicit ones associated with the `grid-template-areas`. I might have misunderstood though.)

-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4411#issuecomment-542288855 using your GitHub account

Received on Tuesday, 15 October 2019 16:08:26 UTC