Skip to content
On this page

Background Repeat

Utilities for controlling background image repeat.

Quick reference

ClassPropertyToken
bg-repeatbackground-repeat: repeat;repeat
bg-no-repeatbackground-repeat: no-repeat;bg-no-repeat
bg-repeat-xbackground-repeat: repeat-x;repeat-x
bg-repeat-ybackground-repeat: repeat-y;repeat-y
bg-repeat-roundbackground-repeat: round;repeat-round
bg-repeat-spacebackground-repeat: space;repeat-space

Usage

Use the bg-repeat-{style} class for setup background image repeat.

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

Applying conditionally

Breakpoints and media queries

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

html
<div class="bg-repeat lg:bg-no-repeat">
    <!-- ... -->
</div>

Customization

Extend your theme

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

scss
@use "lasco" with (
    $extend: (
        "background--repeat": (
            "no-repeat"
        )
    )
);

Disabled

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

scss
@use "lasco" with (
    $extend: (
        "background--repeat": false
    )
);

Released under the MIT License.