|

Opacity

Elemental opacity can be adjusted.

The opacity level of an element is controlled by its opacity parameter. The opacity level, where 1 is completely opaque, describes the transparency level.0 is fully translucent, whereas 5 is 50% transparent.

Utilizing the.opacity-value utility, you can change an element's opacity.

<div class="opacity-100">...</div>
<div class="opacity-75">...</div>
<div class="opacity-50">...</div>
<div class="opacity-25">...</div>
RESULT
100%
75%
50%
25%

Utilities API #

Opacity utilities are declared in our utilities API in scss/_utilities.scss. Learn how to use the utilities API.

"opacity": (
      property: opacity,
      values: (
        0: 0,
        25: .25,
        50: .5,
        75: .75,
        100: 1,
      )
    ),