Are you excited for masonry layouts in CSS? Wondering what’s happening?

Well, a third option is emerging. One that unifies the `flex-flow` and `grid-auto-flow` properties into a whole new mechanism — Item Flow.

Learn what it is, and what it means for Flexbox and Grid in https://webkit.org/blog/16587/item-flow-part-1-a-new-unified-concept-for-layout/

Item Flow, Part 1: A new unified concept for layout

CSS Grid and Flexbox brought incredible layout tools to the web, but they don’t yet do everything a designer might want.

WebKit
@jensimmons I like this idea and implementation a lot!

@jensimmons I read the first proposal and got convinced this is it.
Then I read the second one and got convinced that is it.
Now I read the new proposal and my god I don’t know if I can handle being convinced again 😅

Very very interesting ideas. I like that it solves a bunch of problems while unifying CSS, very elegant!

@flerox @jensimmons I agree. I read through being convinced. The only thing that bothers me, but couldn’t find anything else while brainstorming for an hour yesterday, is "item-slack". The word "slack" bothers me but can’t find anything else so far.

@davidweb @flerox Yeah, there are some good suggestions for a replacement for the “slack” in the issue debating it. We’ll probably rename it this week at the CSS Working Group meeting in New York City.

https://github.com/w3c/csswg-drafts/issues/10884

[css-grid] Decide on a name for `item-slack` · Issue #10884 · w3c/csswg-drafts

#9328 (comment) didn't resolve on the name for this property. In the spec it has been tentatively added as masonry-slack: https://drafts.csswg.org/css-grid-3/#masonry-slack Other ideas from #9328 a...

GitHub

@jensimmons Overall impressions: I like it a lot!

I started typing a reply here but it got out of hand fast. 🙈 Here's a quick blog post with some thoughts, hot off the press: https://chriskirknielsen.com/blog/thoughts-on-item-flow-proposal/

Some thoughts on the item-flow proposal | chriskirknielsen

Solving for masonry could have beneficial side effects for other layout methods.

chriskirknielsen

@jensimmons For the question about what a "dense" flex layout would look like:

I have often been confused or annoyed that a wrapping flex layout won't ever shrink content.

I have never wanted a flex layout to mess with the source order.

And I definitely like the idea of a balanced flex wrap layout!

@jensimmons In all this discussion of expanding / generalizing the layout properties, has anyone discussed integrating a block flow layout (in the sense of display: flow-root, ordinary paragraph flow) in one direction with a more controlled layout in the other?

That's another thing I've often wanted: to be able to make an item that's positioned vertically in the paragraph flow span or float into sidebars / margins.

With some of the masonry proposals, that seemed a reasonable future extension.