Problem: Columns that count themselves.
Solution#
<div class="grid gap-6 grid-cols-[repeat(auto-fit,minmax(260px,1fr))]">
<div class="rounded-xl border p-6">card</div>
</div>Why this works#
Arbitrary grid template = auto-fit without breakpoints.
Variants#
- Responsive: add screen prefixes to the core classes
- Dark: pair each color utility with its dark: twin
- Animated: add
transition+ a state variant for motion
Related recipes#
cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns
