Skip to content
Support Yumma CSS by starring us on GitHub!

Grid Auto Flow

Controls the automatic placement of grid elements.

Class Properties

gaf-c

grid-auto-flow: column;

gaf-d

grid-auto-flow: dense;

gaf-dr

grid-auto-flow: dense row;

gaf-r

grid-auto-flow: row;

gaf-rd

grid-auto-flow: row dense;

Column

This example sets the grid auto flow to column. The items will be placed in the grid by filling each column before moving to the next one.

A
B
C
D
E
<div class="p-r tc-white">
<div class="d-g g-4 gaf-c stripes gtc-3 gtr-3 ta-c">
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">A</div>
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">B</div>
<div class="bg-indigo p-4 rad-1 ta-c">C</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">D</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">E</div>
</div>
</div>

Dense

This example sets the grid auto flow to dense. The items will be placed in the grid in a way that fills in gaps as efficiently as possible.

A
B
C
D
E
<div class="p-r tc-white">
<div class="d-g g-4 gaf-d stripes gtc-3 gtr-3 ta-c">
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">A</div>
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">B</div>
<div class="bg-indigo p-4 rad-1 ta-c">C</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">D</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">E</div>
</div>
</div>

Row

This example sets the grid auto flow to row. The items will be placed in the grid by filling each row before moving to the next one.

A
B
C
D
E
<div class="p-r tc-white">
<div class="d-g g-4 gaf-r stripes gtc-3 gtr-3 ta-c">
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">A</div>
<div class="bg-d-indigo-4 gc-s-2 p-4 rad-1 ta-c">B</div>
<div class="bg-indigo p-4 rad-1 ta-c">C</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">D</div>
<div class="bg-d-indigo-4 p-4 rad-1 ta-c">E</div>
</div>
</div>

Row Dense

This example sets the grid auto flow to row dense. The items will be placed in the grid by filling each row first, while also attempting to fill any gaps efficiently.

A
B
C
D
<div class="d-g gaf-rd g-4 stripes tc-white">
<div class="bg-indigo p-4 rad-1 ta-c">A</div>
<div class="bg-indigo p-4 rad-1 ta-c">B</div>
<div class="bg-indigo p-4 rad-1 ta-c">C</div>
<div class="bg-indigo p-4 rad-1 ta-c">D</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:gaf-*,md:gaf-*, lg:gaf-*, and xxl:gaf-* allows targeting specific utilities in different viewports.

<div class="gaf-c md:gaf-r ..."></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:gaf-* utility to override elements and change their values when hovering over them.

<div class="gaf-c h:gaf-r ..."></div>