-
Notifications
You must be signed in to change notification settings - Fork 758
Closed as duplicate of#10089
Labels
css-grid-2Subgrid; Current WorkSubgrid; Current Work
Description
Currently in grid, items can be specified to span a fixed number of tracks. I think it would be very useful to extend this to span an automatic number of columns based on the size of the item and the size of the columns. In the general case, this is not solvable, since their can be inter-dependencies between these, but when considering intrinsic sizes, it would be possible, and not even particularly difficult.
When a grid item would have span auto:
- If it is placed in a track whose initial growth limit is infinite, the item does not span.
- If it is placed in a track whose initial growth limit is definite, but the item's min-content intrinsic size is smaller than that growth limit, the item does not span.
- If it is placed in a track whose growth limit is definite, and the item's min-content intrinsic size is bigger than that growth limit, then the items spans into (at least) the next track.
- To see if it spans into more than the next column, substract the first column's growth limit and the width of the adjacent gap from the item's intrinsic min-content size, and repeat the above logic with the remainder and the grow limit of the next column.
The same logic is also possible based on the item's max-content instead of its min-content, so maybe we'd want two modes: span min and span max (to be bikesheded).
SebastianZ
Metadata
Metadata
Assignees
Labels
css-grid-2Subgrid; Current WorkSubgrid; Current Work