Open fantasai opened 1 year ago
Proposed syntax:
repeat( [ auto-fill | auto-fit ] && <number>{1,2} , ... )
columns
works.)auto-fill
.The CSS Working Group just discussed [css-grid-3] Repeat range
, and agreed to the following:
RESOLVED: Add two numbers to the repeat function that when used with one of the keywords define a range
I was about to create an issue for a similar problem until I discovered this.
I'd like to suggest the support for min
max
and clamp
with auto-fill
and auto-fit
:
/** Create a maximum of 5 columns */
grid-template-columns: repeat(min(auto-fill, 5), 500px);
/** Create a minimum of 2 columns */
grid-template-columns: repeat(max(auto-fill, 2), 500px);
/** Create between 2 and 5 columns */
grid-template-columns: repeat(clamp(2, auto-fill, 5), 500px);
From @bfgeek's https://github.com/w3c/csswg-drafts/issues/9041