- From: Phil Cupp <pcupp@microsoft.com>
- Date: Wed, 18 May 2011 23:46:00 +0000
- To: Tab Atkins Jr. <jackalmage@gmail.com>
- CC: David Hyatt <hyatt@apple.com>, "www-style@w3.org CSS" <www-style@w3.org>
On May 18, 2011 12:51 PM Tab Atkins Jr. [mailto:jackalmage@gmail.com] wrote: > On Wed, May 18, 2011 at 12:18 PM, Phil Cupp <pcupp@microsoft.com> wrote: > >> On May 18, 2011 9:51 AM, Tab Atkins Jr. [mailto:jackalmage@gmail.com] wrote: >>> That said, I'd be okay with *only* having named grid-cell pseudos generated by 'grid-template', and knocking out the anonymous grid-cells. >> >> Making sure we're using the same dictionary so I don't misread what you're saying: >> >> Grid Cell: a logical space used for laying out Grid Items. >> Explicit Grid Cell: a Grid Cell that has been given a name using the grid-template property or grid-cell pseudo-element function. >> Anonymous Grid Cell: a Grid Cell created to serve as the containing block for a Grid Item which was positioned directly on the Grid using the grid-row and grid-column properties. >> >> Explicit Grid Cell Example 1: >> #grid1 { display:grid; grid-template: "abc" } /* defines three >> Explicit Grid Cells: a, b and c. */ >> #item1 { grid-cell: "a" } /* item1 occupies the Explicit Grid Cell "a" >> */ >> >> Explicit Grid Cell Example 2: >> #grid2 { display:grid } >> #grid2::grid-cell("myCell") { grid-column:1; grid-row:1 } /* defines >> an Explicit Grid Cell named "myCell" */ >> #item2 { grid-cell: "myCell" } /* item2 occupies the Explicit Grid >> Cell "myCell" */ >> >> Anonymous Example: >> #grid3 { display:grid } >> #item3 { grid-column:1; grid-row:1 } /* creates an Anonymous Grid Cell >> to serve as the containing block for item 3 */ >> >> So when you said knocking out the anonymous Grid Cells, are you referring to what I'm calling Explicit Grid Cells that happen to be defined by a grid-cell pseudo-element function, or did you mean doing away with my "Anonymous Example" above? I hope the former as I'm really fond of the Anonymous Example. If you mean the latter, then are you saying the pseudo-element function still exists so that we can set properties like display, but you can't create an Explicit Grid Cell in that way, only refer to ones defined using grid-template, or are you saying that you'd be OK with it not existing at all and the grid-template property is just a way to name a region of space that cannot be further styled? > I meant that I'd be okay with dropping the functionality of Example 2. OK, thanks for clarifying. So only the grid-template property is capable of explicitly defining the Grid Cell, and the grid-cell pseudo-element function then styles explicitly defined Grid Cells. Sounds good. > The grid-template functionality in Example 1 is valuable, and the fully anonymous grid-cell created in Example 3 isn't a problem so long as we define how it's ordered with respect to other grid cells. Sounds good. With only the grid-template property defining the explicit cells, you can say that they occur in "template order," and that anonymous Grid Cells are painted above them. >Essentially, the fact that a grid cell is created in Example 3 is just a theoretical detail to keep the model. Agreed, yes. > The intuitive ordering for grid-cells then would be that grid-template cells are on the bottom by default (their relative ordering is unimportant, as they can't overlap), and anonymous cells are above that, in DOM order of the elements they're created for (this is unambiguous, since we have a guarantee of one cell per element here). I agree with your intuitive ordering, but I may not agree that the order of the explicitly defined Grid Cells is unimportant depending on what styles a Grid Cell can accept. I think we have a simple mechanism to define the order in which they occur though now (see comments above). > Then, presumably, z-index can change the ordering, either directly on ::grid-cell for grid-template cells, or on the element for anonymous cells. Seems reasonable. Another question though, is the Grid the right place to define the mechanism for generating pseudo-elements that add "presentation-specific structure" to a document? Just as display:stack should be factored out as a separate concept, should the notion of generating a container around a set of elements also be factored out? It seems like the model would be applicable elsewhere. If I could pluck out of the document elements a, b and c, and place them in a pseudo-element that I then feed into a Flexbox so that the pseudo-element is considered a Flex Item, isn't that the same notion we're introducing here by aggregating elements into a Grid Cell and then handing it to the Grid for layout? Thanks for your thoughts, Phil
Received on Wednesday, 18 May 2011 23:46:28 UTC