Skip to content

Background Repeat

Utilities for controlling background image repeat.

Quick reference

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

Usage

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


<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-repeat-none will be only apply on large screens size and above.


<div class="bg-repeat lg:bg-repeat-none">
    <!-- ... -->
</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.

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

Disabled

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

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

Released under the MIT License.