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

Flex

Controls how flex elements grow and shrink.

Class Properties

f-1

flex: 1 1 0%;

f-2

flex: 2 2 0%;

f-3

flex: 3 3 0%;

f-4

flex: 4 4 0%;

f-5

flex: 5 5 0%;

f-6

flex: 6 6 0%;

f-7

flex: 7 7 0%;

f-8

flex: 8 8 0%;

f-auto

flex: 1 1 auto;

f-none

flex: none;

This example showcases various flex values: none, 1 1 0%, and 1 1 auto.

  • The f-none class sets the flex property to none, preventing the item from growing or shrinking.
  • The f-1 class sets the flex property to 1 1 0%, allowing the item to grow and shrink equally with a base size of 0.
  • Finally, f-auto class sets the flex property to 1 1 auto, allowing the item to grow and shrink with a base size determined by its content.
A
B
C
<div class="stripes tc-white">
<div class="d-f g-4 h-24 w-full">
<div class="ai-c bg-indigo d-f f-none jc-c p-4 rad-1">A</div>
<div class="ai-c bg-indigo d-f f-1 jc-c p-4 rad-1">B</div>
<div class="ai-c bg-indigo d-f f-auto jc-c p-4 rad-1">C</div>
</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:f-*,md:f-*, lg:f-*, and xxl:f-* allows targeting specific utilities in different viewports.

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

<div class="f-1 h:f-2 ..."></div>