Flex
These utilities provide a way to manage flex layout using classes. A good understanding of CSS flex layout is needed to use them properly. Get an overview of the CSS flex rules with The Flexbox cheatsheet.
Align self
Override the default alignment (specified by align-items in flex layout) of a single item.
Start
Usage
u-flex-align-self-start(@[breakpoint])
Examples
u-flex-align-self-start
Center
Usage
u-flex-align-self-center(@[breakpoint])
Examples
u-flex-align-self-center
End
Usage
u-flex-align-self-end(@[breakpoint])
Examples
u-flex-align-self-end
Stretch
Usage
u-flex-align-self-stretch(@[breakpoint])
Examples
u-flex-align-self-stretch
Baseline
Usage
u-flex-align-self-baseline(@[breakpoint])
Examples
u-flex-align-self-baseline
Order
Change order without changing underlying HTML.
First
Usage
u-flex-order-first(@[breakpoint])
Examples
u-flex-order-first
Last
Usage
u-flex-order-last(@[breakpoint])
Examples
u-flex-order-last
None
Useful to cancel first or last order on a specific breakpoint.
Usage
u-flex-order-none(@[breakpoint])
Examples
u-flex-order-last u-flex-order-none@medium
Proportions
Grow
Specify the flex grow factor, which determines how much the flex item will grow relative to the rest of the flex items in the flex container.
Usage
u-flex-grow[amount](@[breakpoint])
-
amount
A number between 1-5
Examples
u-flex-grow12:
u-flex-grow23:
u-flex-grow3Shrink
Specify the flex shrink factor, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container.
Usage
u-flex-shrink[amount](@[breakpoint])
-
amount
A number between 0-5.
Default behavior is 1.
Using 0 prevents shrinking.
Examples
u-flex-shrink12:
u-flex-shrink23:
u-flex-shrink3Shorthands
The following shorthands utilities define the size flexibility. When based on width/height properties, it means width for flex with row direction, while height is for flex with column direction.
Initial
Sizes the item based on the width/height properties. It can shrink when there is overflow. Corresponds to CSS property flex: 0 1 auto.
Usage
u-flex-initial(@[breakpoint])
Auto
Sizes the item based on the width/height properties, but makes them fully flexible, so that they absorb any free space along the main axis. Corresponds to CSS property flex: 1 1 auto.
Usage
u-flex-auto(@[breakpoint])
None
Sizes the item according to the width/height properties, but makes the flex item fully inflexible. Similar to initial, except that flex items are not allowed to shrink, even in overflow situations. Corresponds to CSS property flex: 0 0 auto.
Usage
u-flex-none(@[breakpoint])