Flex Shrink
@include('_partials.class-table', [ 'rows' => [ [ '.flex-shrink', 'flex-shrink: 1;', "Allow a flex item to shrink if needed.", ], [ '.flex-shrink-0', 'flex-shrink: 0;', "Prevent a flex item from shrinking.", ], ] ])
Shrink
Use .flex-shrink
to allow a flex item to shrink if needed:
@component('_partials.code-sample')
Don't shrink
Use .flex-shrink-0
to prevent a flex item from shrinking:
@component('_partials.code-sample')
Responsive
To control how a flex item shrinks at a specific breakpoint, add a {screen}:
prefix to any existing utility class. For example, use md:flex-shrink-0
to apply the flex-shrink-0
utility at only medium screen sizes and above.
For more information about Tailwind's responsive design features, check out the Responsive Design documentation.
@component('_partials.responsive-code-sample') @slot('none')
Customizing
Shrink Values
By default Tailwind provides two flex-shrink
utilities. You change, add, or remove these by editing the theme.flexShrink
section of your Tailwind config.
@component('_partials.customized-config', ['key' => 'theme.flexShrink']) '0': 0,
- default: 1,
- default: 2,
- '1': 1, @endcomponent
@include('_partials.variants-and-disabling', [ 'utility' => [ 'name' => 'flex shrink', 'property' => 'flexShrink', ], 'variants' => [ 'responsive', ], ])