- From: Tab Atkins Jr. via GitHub <noreply@w3.org>
- Date: Thu, 13 Nov 2025 07:10:40 +0000
- To: public-css-archive@w3.org
Okay, so here are the two dueling use-cases:
* From Miriam, in Grid, you can use `repeat(auto-fill, minmax(100px, auto))` to get repetition based on `100px`, while having the eventual sizing clamped by `auto`. That's a useful behavior that would be kinda sad to lose in Masonry.
* From me, in Masonry, you can use `repeat(auto-fill, auto)` to get repetition based on auto sizes. If I want to ensure that the columns don't get too small, I'd like to impose a minimum, like `repeat(auto-fill, minmax(100px, auto))`, and it would be confusing if that suddenly made the columns *smaller* for repeat purposes.
I sympathize! The Grid behavior does seem useful. It's also inconsistent with `minmax(100px, 200px)`, tho - we use the `200px` for repetition. The inconsistency wasn't a big deal since `minmax(min-content, auto)` was illegal in Grid, so we didn't have anything *else* to be consistent with wrt intrinsic keywords.
It's unfortunate that we now have a clash. `minmax(100px, 200px)` and `minmax(min-content, auto)` *are* consistent in Masonry (using `200px` to determine repeats for the first, and whichever of `min-content` and `auto` are larger for the second). It's bizarre to have `minmax(100px, auto)` act in a completely different manner, always using `100px` regardless of the size of `auto`. (In particular, for example, if the largest min-content size is 100px and the largest auto size is 200px, it's bizarre that writing the 100px explicitly would create a totally different behavior and cause twice as many repeats.)
--------
@mirisuzanne, could you elaborate a bit more on your use-case, actually?
Using `min-max(100px, auto)` in a *non-repeat* case makes perfect sense - your column starts at 100px, then grows to a max of `auto` based on what goes into it and how much free space you have. Totally useful, that's exactly why we designed it that way.
But `repeat(auto-fill, minmax(100px, auto))` doesn't strike me as useful in the same way. Grid assumes all the repeated tracks are 100px and fills the space with them, so you'll have, by definition, less than 100px left over to distribute between the columns. I'm wondering how much you actually get, then, out of filling out that extra space a bit. At least, I don't quite see how the exact keyword used can make a meaningful difference during layout. ("Make them a bit bigger to eat up the little bit of leftover space" makes sense to me, just not "make them a bit bigger *but no bigger than their max-content* (or whatever)", for the repeat case.)
So I wonder if we could handle your desired behavior just by encouraging the use of `repeat(auto-fill, minmax(100px, 1fr))` instead? The `fr` value is ignored for repetition purposes in *both* Grid and Masonry, and causes the repeat tracks to eat up the leftover space, just with no maximum limit based on the exact items. Is that sufficient?
--
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12573#issuecomment-3525933926 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 13 November 2025 07:10:41 UTC