Combine any color with any opacity using Tailwind's slash modifier (bg-blue-500/50) — previewed over a checkerboard, with the plain-CSS equivalent and the deprecated legacy pattern explained.
Generated locally in your browser — your colors, settings and code never leave this page.
The slash modifier, demystified
Modern Tailwind attaches opacity directly to a color utility: bg-blue-500/50 is a 50%-opaque blue background. This small tool exists because the OLD way — separate bg-opacity-50 utilities — still litters tutorials and legacy codebases, and it was removed in v4. Pick utility, color and opacity; the checkerboard preview shows the real translucency, and the legacy tab documents exactly what to migrate away from.
Worked example
<div class="bg-black/60">…</div>
/* CSS equivalent */
background-color: rgb(0 0 0 / 0.6);When to use it
- Image overlays: bg-black/60 behind hero text is the classic readability scrim.
- Subtle brand tints: bg-blue-500/10 for highlighted sections.
- Muted text without a second color: text-gray-900/70.
Limitations
- The slash modifier fades one property’s color; fading a WHOLE element (children included) is the separate opacity-* utility — different tool, different effect.
- Translucent text over unknown backgrounds needs a contrast check — the WCAG checker takes the flattened color.
How to use the Tailwind Opacity Generator
- Choose the utility (background, text or border) and pick a color.
- Drag the opacity slider — the checkerboard preview shows real translucency.
- Copy the slash-modifier class (bg-blue-500/50), or the plain-CSS equivalent.
Frequently asked questions
What happened to bg-opacity-50?
Deprecated: the separate *-opacity-* utilities were replaced by the slash modifier (bg-black/50) in v3.1 and removed in v4. The legacy output tab documents the old pattern precisely so you can migrate it on sight.
How is this different from the opacity-* utility?
opacity-50 fades the WHOLE element — text, children, borders, everything. The slash modifier fades only one property's color. Overlays and tints almost always want the slash form.
What does the CSS output look like?
Modern space-separated alpha syntax: rgb(59 130 246 / 0.5) — what Tailwind itself generates, supported everywhere the framework runs.