← Back to functions

CSS Function

minmax()

Grid

Sets a minimum and maximum size for a grid track.

Syntax

minmax(min, max)

Example

grid-template-columns: minmax(200px, 1fr) auto;

Common use cases

  • Responsive columns that grow but never shrink below a min
  • Sidebars that never collapse too small
  • Content-first layouts

Practical developer insight

minmax() is most powerful inside repeat() — e.g., repeat(auto-fit, minmax(250px, 1fr)) builds fully responsive grids without any breakpoints.

Related