Skip to content

Flex

Utilities for applying flex to an element.

Quick reference

ClassProperty
flex-autoflex: 1 1 auto;
flex-initialflex: 0 1 auto;
flex-noneflex: none;

Usage

Use the flex-{key} class for setup ratio aspect.


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

Applying conditionally

Breakpoints and media queries

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


<div class="flex-auto lg:flex-none">
    <!-- ... -->
</div>

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "flex": (
            "1": "1 1 0%"
        )
    )
);

Disabled

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

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

Released under the MIT License.