Skip to content

Grid Auto Columns

Utilities for controlling the size of implicitly-created grid columns.

ClassProperties
auto-cols-autogrid-auto-columns: auto;
auto-cols-mingrid-auto-columns: min-content;
auto-cols-maxgrid-auto-columns: max-content;
auto-cols-frgrid-auto-columns: minmax(0, 1fr);

Usage

Use the auto-cols-{size} utilities to control the size implicitly-created grid columns.

html
<div class="grid grid-flow-col auto-cols-max">
  <!-- ... -->
</div>
<div class="grid grid-flow-col auto-cols-max">
  <!-- ... -->
</div>

Responsive

To control the grid-auto-columns property at a specific breakpoint, add a {screen}: prefix to any existing grid-auto-columns utility. For example, use md:auto-cols-min to apply the auto-cols-min utility at only medium screen sizes and above.

html
<div class="grid grid-flow-col auto-cols-max md:auto-cols-min">
  <!-- ... -->
</div>
<div class="grid grid-flow-col auto-cols-max md:auto-cols-min">
  <!-- ... -->
</div>

For more information about Gridi responsive design features, check out the Responsive Design documentation.

Released under the MIT License.