Re: [csswg-drafts] [css-grid] grid-gap is still taking up space when an element defined in grid-template-area is not on the page. (#5813)

@SebastianZ Note I'm not proposing that algorithm, it's just my guess of what fantasai might have in mind.

> Tracks 2, 4, 6, and 8 should collapse.

I think fantasai's idea wouldn't collapse 4 as per "we keep the track(s) with the most items in it (i.e. keep both if there's a tie)".

> Tracks 1, 3, 5, and 7 should collapse.

Ditto for 3,5.

> Tracks 2 and 3 should collapse.

A priori we don't know if the 1fr will have any free space to grow, so this would need multiple passes of the track sizing algorithm, which I don't like.

> If so, I wonder if this has any use cases and if this shouldn't be discussed separately, as the use cases outlined so far refer to zero-width tracks.

The original use case at the top of this issue is about having tracks for optional elements that may or might not exist. Thus `hide` is a much more straightforward way to achieve this. On the opposite, I'm still not super convinced that the complexity of `auto` is actually worth it. The only use case that I have seen is your spanning case, which it seems that could be addressed with a nested grid.

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


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

Received on Monday, 26 August 2024 09:58:38 UTC