Grid Auto Columns
Controls the size of grid columns created implicitly.
Widely available
This feature is well established and works across many devices and browser versions.
| Class | Style |
|---|---|
gac-auto | grid-auto-columns: auto; |
gac-max | grid-auto-columns: max-content; |
gac-min | grid-auto-columns: min-content; |
Auto
Initial value
The columns will size themselves based on the content and available space in the grid container.
<div class="d-g gac-auto g-4 gtr-auto"> <div class="ai-c bg-indigo d-f jc-c p-4 tc-white">Sphinx of black quartz, judge my vow.</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">B</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">C</div></div>Min Content
The columns will size themselves to the smallest possible width that does not cause overflow.
<div class="d-g gac-min g-4 gtr-auto"> <div class="ai-c bg-indigo d-f jc-c p-4 tc-white">Sphinx of black quartz, judge my vow.</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">B</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">C</div></div>Max Content
The columns will size themselves to the largest possible width based on their content.
<div class="d-g gac-max g-4 gtr-auto"> <div class="ai-c bg-indigo d-f jc-c p-4 tc-white">Sphinx of black quartz, judge my vow.</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">B</div> <div class="ai-c bg-indigo-8 d-f jc-c p-4 tc-indigo-5">C</div></div>Using utility variants
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
Targeting different viewports
You can combine responsive breakpoints like sm:gac-*, md:gac-*, lg:gac-*, and xxl:gac-* to allow targeting specific utilities in different viewports.
Targeting hover states
Alternatively, you can apply :hover by using h:gac-* utility to override elements and change their values when hovering over them.