Grid Auto Columns
Controls the size of grid columns created implicitly.
Class | Properties |
---|---|
gac-min | grid-auto-columns: min-content; |
gac-max | grid-auto-columns: max-content; |
gac-auto | grid-auto-columns: auto; |
Min Content
This example sets the grid auto columns to 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 rad-1 tc-white">The quick brown fox jumps over the lazy dog.</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">C</div></div>
Max Content
This example sets the grid auto columns to 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 rad-1 tc-white">The quick brown fox jumps over the lazy dog.</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">C</div></div>
Auto
This example sets the grid auto columns to auto. 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 rad-1 tc-white">The quick brown fox jumps over the lazy dog.</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">B</div> <div class="ai-c bg-d-indigo-4 d-f jc-c p-4 rad-1 tc-white">C</div></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Responsive breakpoints
You can combine responsive breakpoints like sm:gac-*
,md:gac-*
, lg:gac-*
, and xxl:gac-*
allows targeting specific utilities in
different viewports.
<div class="gac-min md:gac-auto ..."></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Hover states
Alternatively, you can apply :hover
by using h:gac-*
utility to override elements
and change their values when hovering over them.
<div class="gac-min h:gac-auto ..."></div>