Closed ror-y closed 7 years ago
A good question! It looks like this is expected behaviour, but it wasn't obvious to me either. I raised the issue over on the CSS WG repo, which has some further discussion. https://github.com/w3c/csswg-drafts/issues/966
Essentially this is a error state, when you use named areas you also create named grid lines. If you reference a non-existent grid line (which you are doing by creating this area named other-thing) then an additional track will be added to represent those lines and the item placed into that.
It takes a fair bit of sleuthing in the current spec to get from seeing this behaviour, to remembering that grid areas create lines, to the fact that this is what will happen when you use a non-existent line. It wasn't obvious to me despite knowing all the parts of this exist so I think it might be helpful to add an example in the spec to clarify what happens.
I am confused by the way Grid deals with items not accounted for in the
grid-template-areas
property.In the following image, the blue
More!
grid item has not been referenced in thegrid-template-areas
property, and it has nogrid-*-start
orgrid-*-end
properties (which I have specified in shorthand withgrid-area
on the other grid items):However, in the next image, the same has been applied, except this time a
grid-area
has been applied to theMore!
grid item:I can't work out what is happening here. Has grid begun a new column track and a new row track for this item? Why would this be default behaviour?
demo: http://codepen.io/alanbuchanan/pen/qRmZyw