Skip to content

Font Weight

Utilities for applying font-weight to an element.

Quick reference

ClassProperty
font-100font-weight: 100;
font-200font-weight: 200;
font-300font-weight: 300;
font-400font-weight: 400;
font-500font-weight: 500;
font-600font-weight: 600;
font-700font-weight: 700;
font-800font-weight: 800;
font-900font-weight: 900;

Usage

Use the font-{number} class for set up the font-weight.


<div class="font-400">
    <!-- ... -->
</div>

Applying conditionally

Breakpoints and media queries

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


<div class="font-400 lg:font-700">
    <!-- ... -->
</div>

Customization

Extend your theme

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

@use "lasco" with (
    $extend: (
        "font-weight": (
            400
        )
    )
);

Disabled

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

@use "lasco" with (
    $extend: (
        "font-weight": false
    )
);

Released under the MIT License.