Skip to content

Background Clip

Utilities for controlling background box.

Quick reference

ClassProperty
bg-clip-borderbackground-clip: border-box;
bg-clip-contentbackground-clip: content-box;
bg-clip-paddingbackground-clip: padding-box;
bg-clip-textbackground-clip: text;

Usage

Use the bg-clip-{value} class for setup background box.


<div class="bg-clip-border">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

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


<div class="bg-clip-border lg:bg-clip-padding">
    <!-- ... -->
</div>

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "bg-clip": (
            content
        )
    )
);

Disabled

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

@use "lasco" with (
    $extend: (
        "bg-clip": false
    )
);

Released under the MIT License.