Skip to content

Opacity

Class generator for setting opacity property for an element.

Quick reference

ClassProperty
opacity-0opacity: 0;
opacity-100opacity: 1;

Usage

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


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

Applying conditionally

Breakpoints and media queries

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


<div class="opacity-0 lg:opacity-100">
    <!-- ... -->
</div>

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "opacity": (
            50: 0.5
        )
    )
);

Disabled

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

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

Released under the MIT License.