On this page
repeat()
Prev: `minmax()` | Up: math | Next: color
Rel: math, Math & Sizing Functions Guide
Ref: MDN Web Docs — repeat()
Tags: #public #web #css #functions #math #tier/core
Syntax & Overview
repeat(auto-fit, minmax(16rem, 1fr))
Repeats Grid track patterns a fixed count or automatically (auto-fit / auto-fill).
Notes & Best Practices
auto-fitvsauto-fill:auto-fitcollapses empty trailing tracks so items stretch to fill the row;auto-fillpreserves empty track slots.
Example
.gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 1rem;
}
Linked from
Related notes
- tuts/css/functions/math/minmax Linked here; links to this page; shared tags: #css, #functions, #math, #tier, #web
- tuts/css/functions/math Linked here; links to this page; shared tags: #css, #functions, #math, #web
- tuts/css/functions/color Linked here; shared tags: #css, #functions, #web
- tuts/css/functions/math_and_sizing_functions Linked here; shared tags: #css, #functions, #web
- tuts/css/functions/math/calc shared tags: #css, #functions, #math, #tier, #web
- tuts/css/functions/math/clamp shared tags: #css, #functions, #math, #tier, #web
- tuts/css/functions/math/min shared tags: #css, #functions, #math, #tier, #web
- tuts/css/functions/color/color-mix shared tags: #css, #functions, #tier, #web
- tuts/css/functions/color/light-dark shared tags: #css, #functions, #tier, #web
- tuts/css/functions/color/linear-gradient shared tags: #css, #functions, #tier, #web