2

I'm using the declaration grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); and it works like it's supposed to, but I'd like to have a max-width for 1fr - is there a way to limit the width resulting from 1fr to, say, 450px?

I know there's min(), max() and clamp(), but the support for those doesn't seem to be that good yet.

EricBln
  • 101
  • 1
  • 6

1 Answers1

2

Unfortunately min(), max() and clamp() are not allowed inside the repeat() function (right now), the only option is to set the max-width to the direct children, using a global selector like .Grid > *. But note that you will have to handle the alignment of the cells.

Mattia Astorino
  • 1,396
  • 14
  • 18