Skip to content

Flex Basis

Utilities for applying flex-basis to an element.

Quick reference

ClassProperty
flex-basis-noneflex-basis: 0;
flex-basis-autoflex-basis: auto;
flex-basis-fullflex-basis: 100%;

Usage

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


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

Applying conditionally

Breakpoints and media queries

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


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

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "flex-basis": (
            50: 50%
        )
    )
);

Disabled

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

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

Released under the MIT License.