Re: [csswg-drafts] [css-grid-2] Ability for grid items to automatically span rows and columns based on content size (#1373)

(When i say column/row in this comment I mean column or row, as in you decide one or the other, you wouldn't apply to both at the same time)

Couldn't the circularity issue be solved by ignoring the specific grid cells that are set to auto-span?

For example in this use case the height has been set explicitly:
https://github.com/w3c/csswg-drafts/issues/1373#issuecomment-366522775
However in my experience, any time you have something with text in it, it is an absolutly terrible idea to set an explicit height on it.

So we want the grid in general to still be able to auto-size rows in that example.

If we want a grid-cell to auto-span then we typically do not want it to auto-size the rest of that row/column. So if the grid cell set to auto-span it's size should be ignored when determining the size of the column/row.

There is one major exception, if **all** of the grid cells in a row/column are set to auto-span, and thus none are contributing to column/row size, then we end up with grid columns/rows that are 0px in size which breaks the layout.

To avoid this problem, auto-span should only contribute to the row/column height if it is the smallest item in that row/column. Otherwise it spans across to the next column/row instead of increasing the size of that column/row.

I'm pretty sure this solves the circularity problem of having `auto` size grid cells that also auto-span.

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

Received on Monday, 6 January 2020 21:13:07 UTC