Flex
Utilities for controlling how flex items both grow and shrink.
Class | Properties |
---|---|
.flex-initial | flex: 0 1 auto; |
.flex-1 | flex: 1 1 0%; |
.flex-auto | flex: 1 1 auto; |
.flex-none | flex: none; |
Initial
Use .flex-initial
to allow a flex item to shrink but not grow, taking into account its initial size.
Items don't grow when there's extra space
Items shrink if possible when needed
Flex 1
Use .flex-1
to allow a flex item to grow and shrink as needed, ignoring its initial size.
Default behaviour
With .flex-1
Auto
Use .flex-auto
to allow a flex item to grow and shrink, taking into account its initial size.
Default behaviour
With .flex-auto
None
Use .flex-none
to prevent a flex item from growing or shrinking.
Responsive
To control how a flex item both grows and shrinks at a specific breakpoint, add @{breakpoint}
add the end of the utility class.
Variants
By default, only responsive variants are generated for this utility. You can control which variants are generated by modifying the $utility-configuration
in _settings.scss.