Bolt Flex
Utility Description
Add the following utility classes to apply the desired flex properties (individual flex items):
.u-bolt-flex-grow
- Sets each item with this class to take up equal space. Flex grow overrides any width set..u-bolt-flex-shrink
- Provides the opposite effect of flex-grow. It specifies which items can shrink as the wrapper element shrinks. This is useful in Bolt only when theflex-shrink
property has already been set (since the default value is already1
)..u-bolt-flex-basis-auto
- Distributes the extra space based on theflex-grow
value.
All demos below are resizable!
Demo
Flex items: Default
DEFAULT
DEFAULT
DEFAULT
DEFAULT
DEFAULT
Flex items: .u-bolt-flex-grow
GROW (1)
GROW (1)
GROW (1)
GROW (1)
GROW (1)
DEFAULT
GROW (1)
DEFAULT
GROW (1)
DEFAULT
Flex items: .u-bolt-flex-shrink
Note: The below example uses a non-utility style (shrink and grow) for the sake of the demo. You can see that each element given then shrink utility class is able to shrink in size, while the items with flex-shrink
set to 0
and flex-grow
set - won't.
SHRINK (0)
GROW (1)
GROW (1)
SHRINK (1)
SHRINK (0)
GROW (1)
GROW (1)
SHRINK (1)
SHRINK (0)
GROW (1)
GROW (1)
Flex items: .u-bolt-flex-basis-auto
Note: The below example uses a non-utility style (basis 100px) for the sake of the demo. You can see that items with flex-basis
set to auto
will only expand to the needed width, while items with flex-basis
set to 100px
are set to that specific maximum width (but can still get smaller).
BASIS (AUTO)
BASIS (100px)
BASIS (AUTO)
BASIS (100px)
BASIS (AUTO)