Skip to content

Gap

Class generator for setting gap property for an element.

Quick reference

ClassProperty
gap-0gap: 0;
gap-x-0column-gap: 0;
gap-y-0row-gap: 0;

Usage

Setting the gap on element

Use the gap-{key} to change gap between element.


<div class="gap-0">
    <!-- ... -->
</div>

Setting row and column gaps independently

Use the gap-x-{key} or gap-y-{key} to change gap between element.


<div class="gap-x-6 gap-y-12">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

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


<div class="gap-0 lg:gap-24">
    <!-- ... -->
</div>

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "gap": (
            12: 12px,
            24: 24px
        )
    )
);

Disabled

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

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

Released under the MIT License.