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

> Only for line 1 though, since all other item positions in the masonry axis are treated as `auto`.

This is what seemed counter-intuitive to me when I played around with @rachelandrew's [codepen](https://codepen.io/rachelandrew/pen/qBOpjPx) in the current Firefox implementation. Effectively any numeric `grid-row` values other than 1 seem to work as `grid-row: 2`. The intent of my proposal was to make that behavior less surprising.

> you need to determine the item's position before starting to layout the item, so you don't know the item's size yet when you position it

I agree, I underestimated the complexity of this step in case of differently-sized grid tracks. It definitely would take multiple attempts to layout the item until finding the place where it fits.

> what should happen if the item was too big to fit between the last masonry item and a grid item

I assumed that the algorithm will make another attempt to fit it into the next free space after the grid item. But again, I agree, such multi-pass approach would be not great for performance.

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


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

Received on Wednesday, 21 October 2020 01:35:10 UTC