Skip to content

Flex Shrink

Utilities for applying flex-shrink type of element.

Quick reference

ClassProperty
flex-shrinkflex-shrink: 1;
flex-shrink-0flex-shrink: 0;

Usage

Use the flex--shrink-{amount} class for set up the flex-shrink type.


<div class="flex-shrink">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

You can also control the responsive breakpoint with variant class modifiers. For example lg:flex-shrink-0 will be only apply on large screens size and above.


<div class="flex-shrink lg:flex-shrink-0">
    <!-- ... -->
</div>

Customization

Extend your theme

By default, the configuration provides a handful of general purpose flex-shrink type utilities. You can easily filter the default scales using the Sass configuration.

@use "lasco" with (
    $extend: (
        "flex-shrink": (
            "2": 2
        )
    )
);

Disabled

You can easily disable the properties you don't need to use.

@use "lasco" with (
    $extend: (
        "flex-shrink": false
    )
);

Released under the MIT License.