CSS Grid: Is there a option for repeat /auto-fit?

Hey there,

its great to work with the new CSS-Grid Features.
Is there a option to use the repeat (auto-fit)-feature from CSS-Grid? (columns: repeat(auto-fit,…)

So that the number of columns is based on the available Space, for responsive flexbox-like wrapping.

Example: https://css-tricks.com/auto-sizing-columns-css-grid-auto-fill-vs-auto-fit/

Or is it at the moment only possible to use Flexbox instead, or build separate CSS-Grid Layouts for Desktop & Mobile, if i want a different number of columns on Desktop / Mobile and wrap containers from maybe 4 to 2 columns?


1 Like