Skip to content

White Space

Utilities for applying white-space type of element.

Quick reference

ClassPropertyToken
white-space-normalwhite-space: normal;normal
white-space-nowrapwhite-space: nowrap;nowrap
white-space-prewhite-space: pre;pre
white-space-pre-linewhite-space: pre-line;pre-line
white-space-pre-wrapwhite-space: pre-wrap;pre-wrap
white-space-break-spaceswhite-space: break-spaces;break-spaces

Usage

Use the {key} class for set up the white-space type.

html

<div class="white-space-normal">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

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

html

<div class="white-space-normal lg:white-space-nowrap">
    <!-- ... -->
</div>

Customization

Extend your theme

By default, the configuration provides a handful of general purpose white-space type utilities. You can easily filter the default scales using the Sass configuration.

scss
@use "lasco" with (
    $extend: (
        "white-space": (
            "normal"
        )
    )
);

Released under the MIT License.