-
Notifications
You must be signed in to change notification settings - Fork 759
Description
Following up on the adoption of item-flow in #11480 Unifying grid-auto-flow and flex-flow (see this WebKit blog post for an overview of item-flow if you want a refresher), one of the key questions was about the interpretation of its row and column values for masonry layout.
The core of this question is about whether the row and column values of item-flow represent the “shape” of the layout or the “flow” of the layout. In Flexbox, these two concepts coincide; and in Grid, the “shape of layout” is ambiguous while the keywords indicate the “flow” of the layout, so there's no conflict. But in masonry layout, they are opposite concepts. See this illustrated explanation of these concepts and how they apply to flex/grid/masonry.
This brings us to some concrete questions about the proposed CSS syntax for item-flow:
Question 1: For defining a masonry layout's orientation, should we:
- Use
item-flow: columnto represent waterfall layouts anditem-flow: rowto represent brick-wall layouts?- This would follow the “shape of layout” interpretation for these keywords, which is likely more obvious to most people at first glance.
- In this case the initial value would differ between grid/flex (
row) and masonry (column). - Switching a grid/flex layout to a similarly-flowing masonry layout or vice versa would mean inverting the
item-flowvalue.
- Use
item-flow: rowto represent waterfall layouts anditem-flow: columnto represent brick-wall layouts?- This would follow the "flow of layout" interpretation for these keywords.
- It creates a consistent "flow of layout" interpretation across grid/flex/masonry layouts, so switching between layout types (grid/flex/masonry) would maintain the overall direction of flow for a given value of
item-flow. - But it breaks the expectation that
rowcreates a visible “row” in the layout.
- Use
item-flow: inlineto represent waterfall layouts anditem-flow: blockto represent brick-wall layouts?- This would keep consistent a "flow of layout" interpretation across all three layout modes, while side-stepping the “shape of layout” expectation.
- But the resulting keywords are inconsistent with the existing
flex-flowandgrid-auto-flowproperties.
- Something else?
Question 2: If we go with the second or third approach, the item-flow longhands are very obviously item-direction and item-wrap, consistent with (and mapping directly to) flex-flow and grid-auto-flow. But if we go with the first approach (“shape of layout”):
- Does
item-direction: row | column | row-reverse | column-reverseanditem-wrap: wrap | wrap-reversestill make sense? - What does
item-direction: row-reverseoritem-wrap: wrap-reversemean in this case, i.e. which one reverses what? - Do we need different names for these properties so that they make sense when shared across grid/flex and masonry? E.g.
item-trackanditem-crosswere proposed as a possibility. If so, is this inconsistency with the existingflex-flowlonghands an acceptable cost?
Note that regardless, the default masonry layout will be a “waterfall” layout, i.e. the declared grid tracks are columns, and items are placed across and then down, so it's really only in the case of “brick-wall” layouts that a keyword would need to be specified.
There's some existing discussion on these questions in the previous issue but I wanted to pull out these questions to get thoughts from people other than me and Tab, particularly from our Invited Experts, others working as CSS authors and educators, and from people outside the CSSWG.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status