Re: [csswg-drafts] [css-grid-2] Masonry layout (#4650)

The CSS Working Group just discussed `Masonry Layout`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Masonry Layout<br>
&lt;fantasai> ScribeNick: fantasai<br>
&lt;bkardell_> I can try to step in - do I need to do anything to switch it<br>
&lt;fantasai> heycam: Small update since we last talked about this in A Coruña where jensimmons gave a great introduction<br>
&lt;fantasai> heycam: Since that time, Mats has done some refining of the idea in the issue<br>
&lt;fantasai> heycam: and has landed a prototype in Gecko<br>
&lt;jensimmons> here's an example: https://codepen.io/jensimmons/full/QWjqbJj<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/4650<br>
&lt;fantasai> heycam: Want to get feedback<br>
&lt;fantasai> heycam: Also written up an explainer doc<br>
&lt;fantasai> heycam: Thought it might be helpful to have a more high-level description<br>
&lt;fantasai> heycam: so not wading through GH issue<br>
&lt;fantasai> heycam: Don't know whether ppl are wanting to dive into discussions about particular aspects of the proposal or not<br>
&lt;fantasai> heycam: Now that we have a prototype and an explainer, might be worth ppl filing individual issues against the proposal<br>
&lt;fantasai> astearns: definite +1 to individual issue<br>
&lt;astearns> ack fantasai<br>
&lt;dbaron> ScribeNick: dbaron<br>
&lt;dbaron> fantasai: great to have individual issues.  Why not have a FPWD?  We have agreed to work on it.<br>
&lt;fantasai> heycam: Seemed like ppl were not sure about whether this should be a grid feature or not<br>
&lt;dbaron> fantasai: when we come up with early stage work; we're often unsure about many things.  Doesn't mean we don't draft it up and publish it.<br>
&lt;dbaron> AmeliaBR: can we agree to adopt this concept as described in this explainer as something we want written up in css-grid-2 spec or grid-3?<br>
&lt;fantasai> AmeliaBR: So question is can we agree to adopt what's writtenup?<br>
&lt;fantasai> fantasai: Thought we already agreed to adopt<br>
&lt;fantasai> heycam: Thought we only agreed on the idea<br>
&lt;fantasai> heycam: if ppl willing to resolve on, for now, keep this as something to the grid model<br>
&lt;fantasai> heycam: add to grid-3<br>
&lt;fantasai> astearns: We officially agreed to adopt and assigned editors<br>
&lt;fantasai> jensimmons: There seemed to be a lot of debate in the group about whether built on grid<br>
&lt;heycam> https://github.com/w3c/csswg-drafts/blob/master/css-grid-2/MASONRY-EXPLAINER.md<br>
&lt;fantasai> jensimmons: example, fallback is grid, very nice<br>
&lt;fantasai> jensimmons: idea that Mats had to use masonry as part of Grid spec means you get Masonry in one dimension while all power of grid in the other dimension<br>
&lt;heycam> jen's example: https://codepen.io/jensimmons/full/QWjqbJj<br>
&lt;fantasai> jensimmons: so rows can be masonry and columns are full power of grid<br>
&lt;fantasai> jensimmons: but other ideas, certain ppl very strongly held opinions<br>
&lt;fantasai> jensimmons: didn't like using Grid as the place to do masonry, wanted display: masonry<br>
&lt;fantasai> jensimmons: I've seen some reactions from folks on Twitter etc.<br>
&lt;fantasai> jensimmons: "you can already do this, why new thing", Well no you can't<br>
&lt;fantasai> jensimmons: they think of it as multicol or flexbox<br>
&lt;fantasai> jensimmons: Open question, should this be part of Grid<br>
&lt;fantasai> jensimmons: But enough of a disagreement that we weren't sure<br>
&lt;fantasai> florian: Remains an open question, will have to dive in at some late rpoint<br>
&lt;fantasai> florian: but even if it's an open question, can still decide if it starts in Grid 3 and split later or start later and merge later, but should put it somewhere<br>
&lt;fantasai> dbaron: Also one other distinction here, worth thinking about<br>
&lt;astearns> q?<br>
&lt;fantasai> dbaron: To what extent we want to put prototyping into formal spec language<br>
&lt;fantasai> dbaron: vs having documents about those things that are more example-driven<br>
&lt;fantasai> dbaron: some amount of formal spec language<br>
&lt;fantasai> dbaron: but serve a different audience as part of trying to solicit feedback from ppl who might use the thing<br>
&lt;dbaron> fantasai: I don't see why that needs to be a separate doc that's not adopted by the WG.<br>
&lt;dbaron> fantasai: I think publishing a side explainer that's not official work of the working group.... seems like not part of official work of WG.<br>
&lt;fantasai> iank_: Gives impression to Web devs that they can give feedback<br>
&lt;fantasai> dbaron: Just because it's an explainer doesn't mean it's not official working group work. It's in teh repo<br>
&lt;fantasai> fantasai: [said stuff]<br>
&lt;fantasai> dbaron: Idea of explainers was to address that problem<br>
&lt;fantasai> Rossen_: Seem to be getting off topic<br>
&lt;jensimmons> demo: https://codepen.io/jensimmons/pen/QWjqbJj?editors=1100<br>
&lt;fantasai> astearns: Let's put aside how we work and where work happens, look at demo<br>
&lt;fantasai> [technical difficulties]<br>
&lt;jensimmons>   display: grid;<br>
&lt;jensimmons>   grid-template-rows: masonry;<br>
&lt;jensimmons>   grid-template-columns: repeat(auto-fill, 20rem);<br>
&lt;fantasai> jensimmons: Mats's design is elegant<br>
&lt;fantasai> jensimmons: Shape of this layout can be accomplished in multicol, but the ordering cannot<br>
&lt;fantasai> Rossen_: this is awesome<br>
&lt;fantasai> jensimmons: Responsive design style<br>
&lt;fantasai> jensimmons: narrower it's 2 col, wider is 4 or 5 columns<br>
&lt;fantasai> jensimmons: Content gets rearranged<br>
&lt;fantasai> jensimmons: but always in masonry style layout<br>
&lt;fantasai> jensimmons: One of the main reasons ppl keep doing this layout in JS is because of lazy-loading<br>
&lt;fantasai> jensimmons: They want to load new content into the bottom<br>
&lt;fantasai> jensimmons: using a proper masonry layout, first levels of content stay at the top, add to the bottom<br>
&lt;fantasai> jensimmons: with multicol, everything gets rearranged each time you add content<br>
&lt;fantasai> jensimmons: [shows code]<br>
&lt;fantasai> jensimmons: This one is auto-fill columns of even size, but could make different-sized columns... anything you can do in Grid, can do in Masonry layout<br>
&lt;fantasai> jensimmons: Fallback, if you open in current FF, has grid-template-rows: auto (default value), so everything lines up and just have extra space in the rows<br>
&lt;astearns> q?<br>
&lt;fantasai> Rossen_: Someone asked if only available for rows, suspect not<br>
&lt;fantasai> jensimmons: Could define columns as masonry<br>
&lt;fantasai> dholbert: works in either axis<br>
&lt;fantasai> jensimmons: what happens if you put in both axes<br>
&lt;fantasai> dholbert: you can't, fails in one<br>
&lt;fantasai> dholbert: probably behaves as none<br>
&lt;fantasai> AmeliaBR: Looking through explainer, thing that was new since last time I saw this is how this interacts with intrinsic sizing<br>
&lt;fantasai> AmeliaBR: and way it suggests is to just use the 1st item that goes in each column as the one that decides the size of that column<br>
&lt;fantasai> AmeliaBR: which I guess is similar to fixed mode for table column sizing<br>
&lt;fantasai> AmeliaBR: but it's a little weird, unsure if there are other solutions for it<br>
&lt;fantasai> heycam: You're right, hadn't thought about the analogy to fixed table layout<br>
&lt;fantasai> heycam: The grid items you know for sure will be in particular column, they're the only ones you can rely on to size the columns<br>
&lt;fantasai> heycam: can choose those that are placed in a particular column<br>
&lt;fantasai> heycam: or ones which by automatic placement<br>
&lt;fantasai> heycam: would go into a particular column<br>
&lt;fantasai> heycam: which is true of the items in the first row<br>
&lt;fantasai> heycam: Do agree it feels a bit odd, other items can't influence sizing<br>
&lt;fantasai> heycam: I think you can by forcing them to be in the top row with grid-placement properties maybe??<br>
&lt;fantasai> heycam: not sure what else you could do apart from not allowing grid items to influence sizes<br>
&lt;fantasai> AmeliaBR: question for those who know grid layout better than I do, when we have regular auto layout with intrinsic rows<br>
&lt;fantasai> AmeliaBR: How does that handle cycles<br>
&lt;heycam> fantasai: in grid layout, you have to do placement before you can do the sizing of the columns<br>
&lt;heycam> ... because the sizing can depend on what's in it<br>
&lt;heycam> ... grid placement doesn't depend on the size of anything<br>
&lt;heycam> ... you start putting things into slots, doesn't matter what the size of the item is<br>
&lt;heycam> ... that's not true of masonry layout, which is where this rule is coming in<br>
&lt;heycam> ... oyu need to know which column it's in to size it, but in order to size the column, you need to know what's in it<br>
&lt;heycam> ... so the proposal is using the items that we know will be in a particular column<br>
&lt;heycam> ... what we could do to do an initial sizing pass based on the items we know, with an explicit column or in top row<br>
&lt;heycam> ... then place all the items into appropriate columns, then run the grid sizing alg on all of the items<br>
&lt;heycam> ... so later items would also influence the size of the columns<br>
&lt;heycam> ... this could cause, depending on width -> height influences, could cause them to shift higher/lower in their columsn<br>
&lt;fantasai> AmeliaBR: Way they approached it, seems simple as anything<br>
&lt;dbaron> ScribeNick: fantasai<br>
&lt;fantasai> AmeliaBR: most of the time this layout seems to be used with fixed-width cols<br>
&lt;astearns> q?<br>
&lt;fantasai> florian: Also if we take fantasai's approach, probably want a switch it off, so that column heights can remain stable over time as you load comments<br>
&lt;astearns> ack fantasai<br>
&lt;fantasai> astearns: Comments on the proposal / demo?<br>
&lt;fantasai> astearns: I agree with fantasai that this should be in an official document. We did resolve on doing that<br>
&lt;fantasai> astearns: Let's open a separate issue for that quesiton<br>
&lt;fantasai> astearns: Let's assume it goes into css-grid-3<br>
&lt;fantasai> astearns: and have the issue have discussion for why that might not be the case<br>
&lt;fantasai> astearns: and come back to this next week<br>
&lt;fantasai> astearns: and decide if it goes into grid-3 or a separate module<br>
&lt;fantasai> astearns: put your arguments into the issue soon<br>
&lt;fantasai> astearns: Thanks for explainer, do like having a more generally-accessible version of our documents<br>
&lt;fantasai> astearns: I'm glad it's in our repo<br>
&lt;fantasai> astearns: and thanks for demo, cool to see<br>
&lt;fantasai> heycam: file specific issues on e.g. sizing<br>
&lt;fantasai> astearns: break up into subtopics will help, yes<br>
&lt;heycam> fantasai: I think we should be publishing our work, so we should also consider explaining the explainer either as a FPWD, or as a note at some point<br>
&lt;chris_> +1 for some more 4-hour meetings!<br>
&lt;dbaron> I think if we do ruby it should be at a later time than this, but some of the other issues should perhaps be at the early time.<br>
</details>


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

Received on Thursday, 30 April 2020 23:02:43 UTC