Colors & Opacity
Explore the OKLCH color palette scale and learn how to modify transparency instantly with alpha modifier syntax.
What the Tailwind Color System is
Tailwind CSS v4 features an expansive, expertly crafted color system built natively in the **OKLCH color space**.
Unlike traditional HSL or sRGB color models, OKLCH is perceptually uniform. This means two colors with the same lightness rating (such as sky-500 and emerald-500) are perceived by human eyes as having identical visual brightness.
Each color family in Tailwind (e.g. slate, blue, violet, rose, emerald) spans an 11-step numerical scale from 50 (lightest tint) to 950 (darkest shade).
Why OKLCH and Alpha Modifiers matter
Color consistency across light and dark UI states is notoriously difficult in custom CSS. With Tailwind's 50-950 scale, building accessible color contrasts is systematic: pairing text-slate-100 on a bg-slate-900 card guarantees high contrast.
Furthermore, adjusting element transparency in traditional CSS required writing separate opacity rules or defining custom rgba() values for every color.
Tailwind's **Alpha Modifier syntax** lets you append /<opacity> directly to any color utility (e.g. bg-blue-500/50, text-slate-200/80, border-white/10). In Tailwind v4, this compiles using native CSS color-mix() or OKLCH alpha channels, giving you effortless glass effects and translucent overlays.
How to use color scale and alpha modifier utilities
Apply color utilities across five main UI categories:
1. **Backgrounds**: bg-slate-900, bg-sky-500, bg-emerald-500/20 (20% opacity background wash).
2. **Text**: text-slate-100 (headings), text-slate-200 (readable body), text-sky-400 (brand accent).
3. **Borders & Rings**: border-slate-700, ring-2 ring-violet-500/50 (translucent focus ring).
4. **Dividers & Accents**: divide-slate-800, accent-pink-500 (form input accent).
5. **Arbitrary Alpha Values**: Use bracketed values when an exact transparency percentage is needed: bg-blue-500/[0.33].
Inspect Palette Shades and Translucent Alpha Modifiers
Observe how the 50-950 shade scale progresses from subtle washes to deep tones, and see how the /opacity modifier creates crisp translucent layers.
OKLCH Shade Scale (sky family)
Alpha Modifier Transparency (/opacity)
Tailwind v4 OKLCH color scale provides perceptually uniform shades, while /opacity modifiers add instant transparency.
Check yourself
Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.
Remember this
- Tailwind v4 default palettes use the perceptually uniform OKLCH color space.
- Color scales range from 50 (lightest) to 950 (darkest).
- Append
/<opacity>(e.g.bg-blue-500/50) for instant transparency adjustments. - Always maintain WCAG accessibility by pairing
text-slate-100/text-slate-200with dark backgrounds.
Done with this concept?
Mark it complete to track your progress. No login needed.