7.9 KiB
| extends | title |
|---|---|
| _layouts.markdown | Flexbox |
Flex, Grow, & Shrink
Tailwind provides a comprehensive set of Flexbox utilities out of the box to make it easy for you to implement complex layouts without having to write any new CSS.
Initial Default
Use .flex-initial to allow a flex item to shrink but not grow, taking into account it's initial size:
@component('_partials.code-sample')
Items don't grow when there's extra space
Items shrink if possible when needed
@slot('code')
Flex 1
Use .flex-1 to allow a flex item to grow and shrink as needed, ignoring it's initial size:
@component('_partials.code-sample')
Default behavior
With .flex-1
@slot('code')
Auto
Use .flex-auto to allow a flex item to grow and shrink, taking into account it's initial size:
@component('_partials.code-sample')
Default behavior
With .flex-auto
@slot('code')
None
Use .flex-none to prevent a flex item from growing or shrinking:
@component('_partials.code-sample')
Grow
Use .flex-grow to allow a flex item to grow to fill any available space:
@component('_partials.code-sample')
Don't grow
Use .flex-no-grow to prevent a flex item from growing:
@component('_partials.code-sample')
Shrink
Use .flex-shrink to allow a flex item to shrink if needed:
@component('_partials.code-sample')
Don't shrink
Use .flex-no-shrink to prevent a flex item from shrinking:
@component('_partials.code-sample')