Adaptive grids (repeat, minmax, auto-fit)

An adaptive grid is built without media queries using repeat(auto-fit, minmax(min, 1fr)): the browser places as many columns of at least the minimum size as possible and stretches them to fill the row. auto-fit collapses empty tracks, auto-fill keeps them.

Example

grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));

Related concepts

The whole glossary