Re: [csswg-drafts] [css-flexbox][css-grid] Unifying grid-auto-flow and flex-flow (#11480)

The CSS Working Group just discussed `[css-flexbox][css-grid] Unifying grid-auto-flow and flex-flow`, and agreed to the following:

* `RESOLVED: Continue to work on the item-* props as a set of switches for all items-in-container layout modes`
* `RESOLVED: Put it in grid-3 for now, with intention to move`

<details><summary>The full IRC log of that discussion</summary>
&lt;bramus> fantasai: one of the key feeedback points from tag was to see better unificiation between grid and flexbox and grid auto flow and flex flow<br>
&lt;bramus> … also grid auto flow aspect of the grid integrated proposal was pointed out by google to be awkard<br>
&lt;bramus> … want to unify in a reasonable way<br>
&lt;bramus> … some ideas in the issues<br>
&lt;bramus> … tab had some variations on that<br>
&lt;bramus> … jen created a presentation to walk us through all of it<br>
&lt;bramus> florian: are you presenting a synthesis or a propsal?<br>
&lt;bramus> jensimons: both<br>
&lt;bramus> … one of the areas that is difffern betwwn both proposal is grid auto flow vs masonry direction and such<br>
&lt;bramus> … tag reviewed that<br>
&lt;bramus> … need more general properties<br>
&lt;bramus> … flexbox: have direction, wrap and flow<br>
&lt;ntim> jensimmons: let's go down this rabbit role<br>
&lt;bramus> … grid; no directoin or wrap, but auto flow<br>
&lt;bramus> … unified: maybe some item-* props?<br>
&lt;bramus> … item-direction, item-wrap, item-pack, item-slack, item-flow, …<br>
&lt;bramus> … leading to new ideas for grid and flex<br>
&lt;bramus> … intersting things<br>
&lt;bramus> … new homes for long standing feature requests<br>
&lt;bramus> … things click together suddenly<br>
&lt;bramus> … grid could gain nowrap<br>
&lt;bramus> … to not define expcliit tracks and have all implicit tracks and have grid autocreate rows or cols<br>
&lt;bramus> … flexbox gains dense packing<br>
&lt;bramus> … it can backfill if items fit on a previous line that was already filled<br>
&lt;bramus> … flexbox could get balance<br>
&lt;bramus> … thanks to item-pack<br>
&lt;bramus> … we could have something to balance the rows out a bit more<br>
&lt;bramus> … few ideas<br>
&lt;astearns> q?<br>
&lt;bramus> … and there is item-pack: collapse<br>
&lt;bramus> … (names TBD BTW)<br>
&lt;bramus> … and item-flow as a shorthand<br>
&lt;bramus> … with collapse we get into masonry<br>
&lt;bramus> … had the "just use grid" idea<br>
&lt;bramus> … or a new display value – masonry<br>
&lt;bramus> … with item-pack we can unify that: item-pack: row collapse<br>
&lt;lea> q?<br>
&lt;lea> q+<br>
&lt;bramus> … high level questions<br>
&lt;TabAtkins> q+<br>
&lt;bramus> … 1. do we want to pursue item flow and longhands, unifying grid-auto-flow?<br>
&lt;bramus> … 2. do we want to use item-pack as the trigger for masonry style?<br>
&lt;bramus> 3. (bikeshedding)<br>
&lt;bramus> … 4. decide what row and column mean for item-direction<br>
&lt;bramus> … does it mean flow of items or shape of layout?<br>
&lt;bramus> … ** shows example with named area columsns **<br>
&lt;bramus> … in grid it flows back in rows with grid-auto=flow: row;<br>
&lt;bramus> … with just use grid consistency is contained, but masonry-flow; coljunn describes the columns<br>
&lt;bramus> … (example with named area rows)<br>
&lt;bramus> … in the unified world … been discussing in context of masonry alone, but should be consistent for grid and flexbox too<br>
&lt;bramus> … flex-flow: row wrap vs item-flow: row wrap;<br>
&lt;bramus> … with grid its a bit different<br>
&lt;bramus> … grid-auto-flow: row wrap;<br>
&lt;bramus> … item-flow: row wrap; is a bit different<br>
&lt;bramus> … (missed)<br>
&lt;lea> `flow-direction` perhaps?<br>
&lt;bramus> … adding one more paper cut adding to the syntax<br>
&lt;bramus> … shape of the layout would be the<br>
&lt;bramus> … in masonry style layout it becomes clearer<br>
&lt;bramus> … is it item-flow: row collapse wrap;<br>
&lt;bramus> … but I know there are people who dont like that<br>
&lt;bramus> … so yeah, we have 4 questions<br>
&lt;bramus> … question about shape vs flow is ??? might help to write out examples<br>
&lt;iank_> q+<br>
&lt;oriol> q+<br>
&lt;astearns> ack lea<br>
&lt;bramus> lea: was one of th epeople on tag. this is great.<br>
&lt;bramus> … really like this<br>
&lt;bramus> … obvs things to bikeshed, but right direction<br>
&lt;bramus> … getting towards a simpler thing eventually<br>
&lt;bramus> … and seems more powerful than what was previously proposed<br>
&lt;ntim> q+<br>
&lt;bramus> … like how it leaves the template open – both rows and cols<br>
&lt;bramus> … can still have masonry layou tand efine a specific row height and that still has an effect<br>
&lt;bramus> … quite like that as well<br>
&lt;bramus> … did suggest flow-direction instead of item-flow<br>
&lt;bramus> … a bit weir dbut no strong opinion<br>
&lt;bramus> … details can always be fleshed out<br>
&lt;astearns> ack TabAtkins<br>
&lt;bramus> … this is fantastic<br>
&lt;bramus> TabAtkins: overall pretty happy with to move this functionality to item-* props<br>
&lt;bramus> … am very happy with it<br>
&lt;bramus> … one bit of objection which is item-pack property (after talking with ian)<br>
&lt;bramus> … conflict between new behaviors needing to be defined for all things<br>
&lt;bramus> … comes up here too<br>
&lt;astearns> qq+<br>
&lt;bramus> … side bits of behavior needed<br>
&lt;bramus> … item pack is more of a grab back of functinality<br>
&lt;bramus> … triggers betwen normal and dens in grid<br>
&lt;bramus> … swtich between grid and masonry<br>
&lt;ntim> s/grab back/grabbag<br>
&lt;bramus> ¬… and possibly turn flex in a ???<br>
&lt;bramus> … new piece of fn that needs to predefine things for deverything<br>
&lt;bramus> … inclined to not do item-pack<br>
&lt;bramus> … but accept all the rest<br>
&lt;florian> q+<br>
&lt;bramus> astearns: i like the discipline of needing to consider all layouts that a new thing might need to adapt to<br>
&lt;astearns> ack astearns<br>
&lt;Zakim> astearns, you wanted to react to TabAtkins<br>
&lt;bramus> … would still need to have an escape hatch where we could define values like flex-balance for item-pack that only work on flex until we figure out how to make balance work with the rest<br>
&lt;bramus> TabAtkins: definitily possible<br>
&lt;bramus> iank_: what tab said<br>
&lt;bramus> … item pack is problematic for reasons that tab outlined<br>
&lt;fantasai> +1 astearns<br>
&lt;bramus> … historically done a poor job as implementers<br>
&lt;bramus> … impltd these in block step (>)<br>
&lt;bramus> … this hurts devs bc they cant feature detect<br>
&lt;bramus> … stuff in alignment that was hard to ship<br>
&lt;astearns> s/would still need to have/would still have/<br>
&lt;bramus> … and things like align-content: baseline<br>
&lt;bramus> … historically done a bad job at these sort of complex things<br>
&lt;bramus> … would be a bit happy with this (i am working on balance in flex). for grid its very complex<br>
&lt;bramus> … dont want to see that we cant ship balancing for flexbox bc we have to figure out what it does for grid<br>
&lt;bramus> … layout specific keywords<br>
&lt;astearns> ack iank_<br>
&lt;bramus> … implementation cost would be huge otherwise<br>
&lt;astearns> ack oriol<br>
&lt;bramus> oriol: concern this seems to add fn that may add duplication or sth that may not really make sense in some layouts<br>
&lt;bramus> … in grid you can assign expl positions for the items and nowrap does not make sense in that case<br>
&lt;jensimmons_phone> q?<br>
&lt;bramus> … idea about nowrap adding new cols<br>
&lt;bramus> … with grid auto flow col you get that<br>
&lt;jensimmons_phone> q+<br>
&lt;bramus> … is duplication<br>
&lt;bramus> … will create more confusion<br>
&lt;bramus> … for authors<br>
&lt;bramus> … thing of item-pack to refer to the direction or shape of layout<br>
&lt;iank_> q+<br>
&lt;bramus> … not using shape of layout would be confusing<br>
&lt;bramus> … in grid auto flow that would a conflict was presented<br>
&lt;bramus> … though inc ase of non masonry grid you get both rows and cols<br>
&lt;bramus> … it does not apply well<br>
&lt;bramus> … some of these may make sense, but would prefer to add them explcity for each layout<br>
&lt;bramus> … not fond of defining everything in gereral because of duplication or conflicts<br>
&lt;astearns> ack ntim<br>
&lt;bramus> ntim: comment on item-flow<br>
&lt;bramus> … flow representes how things are ordered, not shape<br>
&lt;bramus> … so using shape would be confusing<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to comment on flow-direction, maybe<br>
&lt;bramus> fantasai: agree 100% with what alan said<br>
&lt;bramus> … i thinkk that idea of prefixing as we introduce new fn is an nice compromise to getting full allignment across layouts<br>
&lt;bramus> … idea iof flow-direction<br>
&lt;bramus> … (missed)<br>
&lt;bramus> … use flow in 2 places now<br>
&lt;bramus> … 1 is in various flow-???. its a suffix<br>
&lt;bramus> … 2 is why this could not be a shorthand<br>
&lt;bramus> …æ still have display: flow<br>
&lt;bramus> … these props dont apply to that type of layout<br>
&lt;bramus> … have 2 types of layout in CSS: flow layout &lt;details missed> and a different kind of layout where you go down from parent to childrena and child is a chunk and gets manipulated as an item<br>
&lt;bramus> … flex and grid are in one type of those<br>
&lt;astearns> flow layout versus item layout<br>
&lt;bramus> … dont want to get too deep into wraping this set of props with the flow word<br>
&lt;bramus> … other that we use it as a shorthand to ???<br>
&lt;bramus> ; thought about prefixed<br>
&lt;bramus> … item was 1<br>
&lt;astearns> (or item-in-a-container layout)<br>
&lt;bramus> … thought about placement too<br>
&lt;bramus> … went with item bc we use item in align-items<br>
&lt;bramus> ; already have the concept of items<br>
&lt;bramus> … and syntax for it<br>
&lt;bramus> … open to naming of course<br>
&lt;astearns> ack florian<br>
&lt;bramus> florian: i like this<br>
&lt;bramus> … and generally agree with alans comment<br>
&lt;bramus> … re: ian<br>
&lt;bramus> … not everyting is the same<br>
&lt;bramus> … a bunhc o fthings need to work across layout modes<br>
&lt;bramus> … like margin and gap and rows and align and ;<br>
&lt;bramus> … if we dont do that its bad<br>
&lt;bramus> … not sure its all of it though<br>
&lt;bramus> … possibly around item-pack<br>
&lt;bramus> … squeeze mode of flex<br>
&lt;bramus> ; 2 proposals for what dense might mean for flex<br>
&lt;bramus> … looks like grid, but there are some flexbox-specific traits to it<br>
&lt;bramus> … when some of them are not diff appls of the same thing but related but diff concepts, then we get into the “you have to define all across all 3 modes”<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to react to florian<br>
&lt;bramus> … theres at least a part tha tmakes sense across all layou tmodes but not all<br>
&lt;bramus> fantasai: there was a proposal for dens epacking in flexbox (unrelated to this proposal)<br>
&lt;bramus> … idea was to instead of fill line and wrap when it overflows, cram in last items and shrink it<br>
&lt;bramus> … first edition of that tagged that behavior to the dense keyword<br>
&lt;bramus> florian: that is the dens keyword?<br>
&lt;bramus> fantasai: no<br>
&lt;bramus> … the thing on the slide is different<br>
&lt;bramus> TabAtkins: oh, the slide is not up to date I see<br>
&lt;bramus> fantasai: so, dense packing for flex should be same concept as grid to fill in the gaps<br>
&lt;bramus> … slack is cram things in<br>
&lt;astearns> q+<br>
&lt;bramus> … for masonry its which col is the shortest<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to clarify this<br>
&lt;dholbert> +1 to florian's concern, particularly for cases where the relative utility and/or implementation-complexity of the the same keyword is substantially different between different layout modes (which risks implementors shipping the feature for one layout mode but not others, as Ian noted)<br>
&lt;bramus> …for flex its close enough to fitting and ifts close to 10px cram it in<br>
&lt;bramus> … fudge distance<br>
&lt;bramus> … say how much you want to cram in<br>
&lt;bramus> florian: and in grid?<br>
&lt;bramus> TabAtkins: nothing, not possible there<br>
&lt;bramus> fantasai: the only keywords tied to 1 layout in this set are collapse for grid and balance only for flexbox<br>
&lt;bramus> florian: makes sense<br>
&lt;bramus> … lets try not to overfit this<br>
&lt;bramus> … would be a mistake<br>
&lt;bramus> … forcing that would be bad<br>
&lt;bramus> TabAtkins: strong agree<br>
&lt;bramus> … that is why i am happy with the current form<br>
&lt;astearns> ack jeroen<br>
&lt;astearns> ack jensimmons_phone<br>
&lt;bramus> jensimmons: an early reaction was to not do pack<br>
&lt;bramus> … and folks were sort of bummed out about doing balance<br>
&lt;bramus> … think that creating balance – doing balance keyword at all … can be a later version<br>
&lt;bramus> … exciting to present the propposed thing where it paints the future<br>
&lt;bramus> … dense already have for grid, can figure out what it does for flex<br>
&lt;bramus> … dont have to ship right away<br>
&lt;bramus> … ipml detail<br>
&lt;florian> s/lets try not to overfit this/lets try not to overfit this, by forcing the creation of different-but-analogus options in other layout modes just because we now have a keyword that could trigger them<br>
&lt;bramus> … collapse though is the toggle for masonry<br>
&lt;fantasai> s/detail; let's think about what's good for the Web/<br>
&lt;bramus> … skipping all of item pack<br>
&lt;bramus> TabAtkins: there’d be a diff switch<br>
&lt;florian> s/would be a mistake/would be a mistake, because it would force synchronous shipping of essentially unrelated (even if similar) functionality<br>
&lt;bramus> jensimmons: exciting things to add pack and slack here<br>
&lt;bramus> … (missed)<br>
&lt;astearns> ack iank_<br>
&lt;bramus> iank_: one thing, handling balance<br>
&lt;ntim> jensimmons: what's exciting is the unified way to control the flow for authors<br>
&lt;bramus> … imminently would be good<br>
&lt;bramus> … in the next month or so i’ll prolly do some research<br>
&lt;bramus> … would like to solve soon<br>
&lt;TabAtkins> concretely, instead of item-pack, we could keep the existing `grid-auto-flow`, add `flex-pack: normal | dense`, add balance to `flex-pack`, and trigger masonry layout via `display: masonry` or another new property.<br>
&lt;bramus> jensimmons: it is cool<br>
&lt;bramus> iank_: yep!<br>
&lt;astearns> ack astearns<br>
&lt;bramus> astearns: response to florian but i think jen covered it already<br>
&lt;bramus> … this new stuff is not the new item in containers property set to rule them all<br>
&lt;fantasai> I think having the unified properties is cooler than introducing more one-offs<br>
&lt;bramus> … this is a support mechanism that we use when appropriate to put them together where it makes sense<br>
&lt;bramus> … still lmost likely to have values with layout prefixes<br>
&lt;bramus> … spefific to those modes<br>
&lt;bramus> … that dont make sense into this other thing<br>
&lt;fantasai> s/values/values and properties/<br>
&lt;bramus> … but q is how do the existing or future layout props with these new item things?<br>
&lt;bramus> fantasai: this propopsal is meant to be replacing the existing grid-auto-flow and flex-flow props<br>
&lt;bramus> … is it an alias or how does it interact? thinking about making it a shorthand<br>
&lt;bramus> … 3 diff directions<br>
&lt;bramus> … alias, keyword magic, or shorthand<br>
&lt;bramus> … its not gonna rule all of layout controls, its this set of  stuff to represent common concepts for all layout modes<br>
&lt;bramus> … gives them a unified home to live in<br>
&lt;bramus> … like flex property is not gonna be ported to grid or stuff<br>
&lt;bramus> jensimmons: think of things like alignment<br>
&lt;bramus> … does 1 thing<br>
&lt;bramus> … do they wrap or pack<br>
&lt;bramus> … its not about the layout at all, its about the item behavior<br>
&lt;astearns> s/likely to have values/likely to have values and properties/<br>
&lt;bramus> … when brendan and I came up with this, these props could alias other props<br>
&lt;TabAtkins> q+<br>
&lt;bramus> … but proplem with that we could end up with strange behavior where a strey prop starts to have effect<br>
&lt;bramus> … would expect that the flex props dont escape that<br>
&lt;bramus> … (missed)<br>
&lt;bramus> … authors can still grab to the flex and grid props<br>
&lt;astearns> +1 to not aliasing, that seems too constraining (and dangerous)<br>
&lt;bramus> … if we wnated in the future to define balance only for flex, then we can stick to that<br>
&lt;astearns> ack TabAtkins<br>
&lt;bramus> TabAtkins: this set of fn (with or without item pack) is sufficiently generic or useful dfns that they will be usable for prolly all future layout modes<br>
&lt;bramus> … knowing where it flows is always gonna be present<br>
&lt;bramus> … this is a good design set of pieces that will work for future layout modes<br>
&lt;bramus> … there should be direct analoging behavior between everything<br>
&lt;bramus> iank_: item-pack is arguably the one that violates that the most<br>
&lt;bramus> … bheaviors are diff between the modes<br>
&lt;bramus> … thats the one<br>
&lt;bramus> fantasai: dont think this is the case<br>
&lt;bramus> … normal is normal<br>
&lt;bramus> … dense is analogus between flex and grid<br>
&lt;bramus> TabAtkins: but not masonry<br>
&lt;bramus> fantasai: but it also has dense<br>
&lt;TabAtkins> nm, masonry does have dense<br>
&lt;bramus> … collapse gonna set out next separtely<br>
&lt;dholbert> q+<br>
&lt;bramus> … leftover one is balance. masonry is inhernetly that<br>
&lt;bramus> … only 1 keyword<br>
&lt;bramus> iank_: there is also nowrap<br>
&lt;bramus> fantasai: there is a dfn for nowrap that makes sens for grid<br>
&lt;bramus> … (grid)<br>
&lt;TabAtkins> The set of property names/values from mine and fantasai's compromise, btw, are:<br>
&lt;TabAtkins> item-track: auto | row | column | row-reverse | column-reverse<br>
&lt;TabAtkins> item-cross: [ [ nowrap | wrap ] || [ normal | reverse ] ] | wrap-reverse<br>
&lt;TabAtkins>     /* wrap-reverse is a combination of wrap and reverse, for convenience */<br>
&lt;TabAtkins> item-pack: normal | dense || [ collapse | balance ]<br>
&lt;TabAtkins> item-slack: normal | &lt;length-percentage> | infinite<br>
&lt;TabAtkins> item-flow: &lt;'item-track'> || &lt;'item-cross'> || &lt;'item-pack'> || &lt;'item-slack'><br>
&lt;bramus> … this lets you set it at a higher level on the container<br>
&lt;bramus> … and that gets you similar to a nonwrapped flex box where you cerate tracks and apply certain track sizing mutations on it<br>
&lt;bramus> … and its a very obvs straigth way to get that<br>
&lt;bramus> … in grid you use grid-row: 1<br>
&lt;bramus> … but now you can add it at a higher level<br>
&lt;bramus> … not critical to add now, but i think it makes sens<br>
&lt;astearns> ack dholbert<br>
&lt;bramus> … not higghly reqd feature but straightforward to describe and implement<br>
&lt;bramus> dholbert: share ian’s concerns<br>
&lt;bramus> … in particular feels dense is well defined for grid but not sure i like the behavior for flex<br>
&lt;bramus> … seems like that behavior would be unpredicatable as space grows or shrinks<br>
&lt;bramus> … with rows and small items snapping down to a later row<br>
&lt;bramus> … you would get sth that looks like masonry with a lot of tiny items attached to the end of each line<br>
&lt;iank_> i also wonder a subset of requests for `flex-wrap: dense` was people really wanting `flex-wrap: balance`<br>
&lt;bramus> … would do the job to fill a line densely, bu tskeptiacal if that is what authors want<br>
&lt;bramus> … feels like dense is agrid thing that gets backfilled into flexbox<br>
&lt;bramus> … on the flip side it seems like balance might needed to be backfilled to grid<br>
&lt;bramus> … worried about being forced to implement both in order to ship 1<br>
&lt;TabAtkins> note: we can defer the item-pack property for discussion in another issue or later meeting. it would just remove one possible "masonry" switch<br>
&lt;bramus> astearns: see tab’s note in irc: can defer dense<br>
&lt;bramus> TabAtkins: if we end up to not put dense into item-pack and only had collapse then it would not be a good name for it<br>
&lt;bramus> … but does not prevent us from doing a diff switch from now and later have item pack take on those duties<br>
&lt;bramus> astearns: aside from some details, i hear general enthusiasm?<br>
&lt;bramus> … shall we resolve to continue to work on this general item-* prefix proposal?<br>
&lt;bramus> … seeing thumbs up<br>
&lt;bramus> … concerns?<br>
&lt;bramus> TabAtkins: and ideally resolve in upcoming telecons soon<br>
&lt;TabAtkins> items-in-container layout modes<br>
&lt;bramus> astearns: not hearing stuff, prop resolution is to continue to work on the item-* props as a set of switches for all items-in-container layout modes<br>
&lt;florian> +1<br>
&lt;kbabbitt> 👍<br>
&lt;bramus> RESOLVED: Continue to work on the item-* props as a set of switches for all items-in-container layout modes<br>
&lt;bramus> fantasai: curerntly to be shoved in the grid-3 spec<br>
&lt;bramus> jensimmons: could end up using its own<br>
&lt;bramus> florian: can move eventually<br>
&lt;ntim> ntim: could use css-display<br>
&lt;bramus> PROPOSED RESOLUTION: Put it in grid-3 for now, with intention to move<br>
&lt;bramus> RESOLVED: Put it in grid-3 for now, with intention to move<br>
&lt;ntim> &lt;3<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11480#issuecomment-2628118101 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 31 January 2025 19:16:48 UTC