Skip to content

Flex Basis

Utilities for applying flex-basis to an element.

Quick reference

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

Usage

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

html

<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-0 will be only apply on large screens size and above.

html

<div class="flex-basis-auto lg:flex-basis-0">
    <!-- ... -->
</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.

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

Released under the MIT License.