Skip to content
On this page

Background Color

Utilities for applying background-color to an element.

Quick reference

ClassProperty
bg-color-inheritbackground-color: inherit;
bg-color-currentbackground-color: currentColor;
bg-color-transparentbackground-color: transparent;

Usage

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

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

Applying conditionally

Breakpoints and media queries

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

html
<div class="bg-color-current lg:bg-color-transparent">
    <!-- ... -->
</div>

Customization

Extend your theme

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

scss
@use "lasco" with (
    $extend: (
        "bg-color": (
            "black": "#000"
        )
    )
);

Disabled

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

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

Released under the MIT License.