sdxc

Type to search, or start from one of these:

layout

grid-template-columns

Builds a repeat(...) track-list value string for u.gridTemplate()'s columns/rows options, or any grid-template-columns/-rows use, since track sizing varies too continuously for a named scale to usefully cover.

import { repeat } from "@sdxc/u/layout";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.gridTemplate({ columns: u.repeat(3, 1) })css({ gridTemplateColumns: "repeat(3, 1fr)" })
u.gridTemplate({ columns: u.repeat("auto-fit", "minmax(140px, 1fr)") })css({ gridTemplateColumns: "repeat(auto-fit, minmax(140px, 1fr))" })

Using a custom value

Every scale argument also takes a raw CSS value, which passes through untouched.

u.gridTemplate({ columns: u.repeat(3, 1) })

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.gridTemplate({ columns: u.repeat(3, 1) }))

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.gridTemplate({ columns: u.repeat(3, 1) }))

Signature

u.repeat(count: RepeatCount, track: RepeatTrack)