-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-grid] Does grid-template-areas really expand the explicit grid? #4914
Comments
My 2 cents: I suspect it's too late to make changes that affects layout, for web-compat reasons. I think we should update the spec to reflect what UAs are currently doing. IOW, I want all four bullet points above remain true; except perhaps the last one given that we recently changed that and that it only affects CSSOM, not layout. |
The point of distinguishing between "explicit grid" and "implicit grid" is that the explicit grid was, well, explicitly defined: it's the rows and columns that the author explicitly indicated they're planning for. Under this understading, g-t-a definitely should be considered as defining the explicit grid. Explicitly sizing the tracks isn't required under this definition, however. So the current situation, while not quite planned for, is totally fine in my book, even if we weren't likely already constrained by web compat as Mats says. So, yeah, we should just fix up the prose around grid-auto-rows/columns to apply to any track that isn't explicitly sized by grid-template-rows/columns. |
OK, so then a grid can have:
|
… created by grid-template-areas but not sized by grid-template-rows/columns. #4914
Fix checked in. Agenda+ to confirm. |
Quick testcase to show the case under discussion
|
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-grid] Does grid-template-areas really expand the explicit grid?<dael> github: https://github.com//issues/4914 <fantasai> https://github.com//issues/4914#issuecomment-609914410 <dael> TabAtkins: Issue here is grid-template-rows/columns/areas don't haev to agree number of rows or columns expressing. You can have a template with 5 rows and only put 1. <dael> TabAtkins: Question is what defines explicit grid. Explicit rows and columns? <dael> TabAtkins: Browsers agree on behavior but it's not well spec. They are part of explicit grid, can detect by span to -1 line. Will fill space of grid-template-area. Sized as if implicit tracks from grid-auto-rows properites. <dael> TabAtkins: Reasonable, want to canonicalize in spec. <dael> TabAtkins: We checked in edits and added tests. If there's objections we can revert. Otherwise current spec has intentions. explicit grid is the larger option and if it's more than rows and columns it's sized by grid-auto <dael> Rossen_: Thoughts or objections? <dael> RESOLVED: Accept edits to spec for explicit grid |
From https://drafts.csswg.org/css-grid/#implicit-grids
I'm not convinced about the latter. For example, consider
If the explicit grid has 2 columns due to
grid-template-areas
, which is the track sizing function of the 2nd one? The spec says thatgrid-auto-columns
is only for implicit tracks!Then https://drafts.csswg.org/css-grid/#propdef-grid-auto-columns seems to redefine implicit tracks in a way that ignores
grid-template-areas
:I have tested it a bit and it seems that Chromium and Firefox are consistent in this regard:
grid-template-areas
are explicit:grid-template-areas
are implicit:grid-auto-columns/rows
.They are not included in the resolved value of[This was reverted due to web compat, now all tracks are included. And not including tracks created withgrid-template-rows
/grid-template-columns
.grid-template-areas
could have been an overlook.]So maybe we need a middle concept between explicit and implicit, and define things correctly.
The text was updated successfully, but these errors were encountered: