Opacity & Translucency
A complete opacity scale (0–100) and semantic translucency utilities, including a frosted-glass variant.

Opacity Scale

13 utility classes covering the full opacity range in steps of 10, plus .opacity-25 and .opacity-75 for fine-grained control.

.opacity-100
.opacity-90
.opacity-80
.opacity-75
.opacity-70
.opacity-60
.opacity-50
.opacity-40
.opacity-30
.opacity-25
.opacity-20
.opacity-10
.opacity-0
Usage
<div class="opacity-50">Half opacity</div>
<div class="opacity-75">Three-quarter opacity</div>
<img class="opacity-30" src="bg.jpg" alt="">

Interactive Demo

Drag the slider to see opacity values in real time.

Aa
opacity: 1 → class="opacity-100"

Translucent Utilities

Named classes for common translucency patterns. Each class includes a smooth transition: opacity so state changes animate automatically.

Full opacity no class (1.0)
Light .translucent-light (0.85)
Standard .translucent (0.70)
Heavy .translucent-heavy (0.50)
Usage
<nav class="translucent-light">Subtle overlay navigation</nav>
<div class="translucent">Standard transparency for modals or overlays</div>
<img class="translucent-heavy" src="watermark.png" alt="watermark">

Hover Variants

Apply translucency only on hover — useful for image grids, card overlays, and icon buttons. The transition is built in.

Hover me .translucent-light-hover
Hover me .translucent-hover
Hover me .translucent-heavy-hover
Usage
<!-- Subtle image dimming on hover -->
<img class="translucent-light-hover" src="photo.jpg" alt="">

<!-- Fade-back effect on icon buttons -->
<button class="translucent-hover">...</button>

Frosted Glass

.translucent-glass combines a semi-transparent white background with backdrop-filter: blur() for a frosted glass effect. Requires content behind the element to be visible.

Glass Panel .translucent-glass
Frosted Card backdrop-filter: blur(8px)
Overlay UI rgba(255,255,255, 0.75)
Usage
<!-- Position over a gradient or image background -->
<div class="hero-cover" style="background-image: url(bg.jpg)">
    <nav class="translucent-glass p-4">Frosted navbar</nav>
</div>
Browser support: backdrop-filter is supported in all modern browsers. In browsers that don't support it, the panel falls back gracefully to just the semi-transparent background.

CSS Custom Properties

All translucency values are driven by CSS variables, making them easy to override per-theme.

:root {
    --dm-translucent-light:         0.85;   /* .translucent-light */
    --dm-translucent:               0.7;    /* .translucent */
    --dm-translucent-heavy:         0.5;    /* .translucent-heavy */
    --dm-translucent-glass-blur:    8px;    /* .translucent-glass blur amount */
    --dm-translucent-glass-opacity: 0.75;   /* .translucent-glass background alpha */
}

/* Override in a dark theme to use a dark glass panel */
[data-theme-variant="dark"] .translucent-glass {
    background-color: rgba(0, 0, 0, var(--dm-translucent-glass-opacity));
}

Reference

All opacity and translucency utility classes at a glance.