Skip to content
On this page

Width

Class generator for setting width property for an element.

Quick reference

ClassProperty
w-0width: 0;
w-autowidth: auto;
w-fullwidth: 100%;
w-screenwidth: 100vw;
w-minwidth: min-content;
w-maxwidth: max-content;
w-fitwidth: fit-content;

Usage

Use the w-{index} class for setup ratio aspect.

html
<div class="w-0">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

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

html
<div class="w-0 lg:w-full">
    <!-- ... -->
</div>

Customization

Extend your theme

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

scss
@use "lasco" with (
    $extend: (
        "width": (
            "25": "25%",
            "50": "50%",
            "75": "75%"
        )
    )
);

Disabled

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

scss
@use "lasco" with (
    $extend: (
        "width": true
    )
);

Released under the MIT License.