Zazz Design Framework
baseUtilities

Color opacity

Channel-specific alpha utilities that dim text, backgrounds, or borders without fading children.

Color opacity utilities adjust single-channel alpha without fading child elements.

Opacity modes

ModeTargetClasses
Element opacityWhole element and descendantsopacity-0 to opacity-100 (Effects)
Channel alphaNamed color channel onlytext-opacity-*, bg-opacity-*, border-opacity-*

Scale steps: 0, 25, 50, 75, 100.

Channel alpha utilities

Combine with role color classes:

ChannelClassesVariable
Texttext-opacity-0 to text-opacity-100--_text-alpha
Backgroundbg-opacity-0 to bg-opacity-100--_background-alpha
Borderborder-opacity-0 to border-opacity-100--_border-alpha
<span class="bg-primary bg-opacity-50 text-primary-foreground rounded-sm px-sm">
  50% background alpha
</span>
<p class="text-foreground text-opacity-75">75% text alpha.</p>

Implementation

Color utilities compute alpha via calc(alpha * var(--_background-alpha, 1)). Alpha variables use @property with inherits: false, preventing values from bleeding into child elements.

VariableSyntaxInitialManaged by
--_text-alpha<number>1text-opacity-*
--_background-alpha<number>1bg-opacity-*
--_border-alpha<number>1border-opacity-*

On this page