Skip to content
On this page

Contrast

Utilities for applying contrast to an element.

Quick reference

ClassProperty
contrast-0filter: contrast(0);
contrast-100filter: contrast(1);

Usage

Use the contrast-{amount} class for setup ratio aspect.

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

Applying conditionally

Breakpoints and media queries

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

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

Customization

Extend your theme

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

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

Note: the amount can be a number (0 to 1) or a percentage value. ( Source MDN)

Disabled

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

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

Released under the MIT License.