
CSS-Tricks · 3 min readCSS & layout
alpha()
The alpha() CSS function adds transparency to any color, including named colors, by transforming existing design tokens without creating new ones. It works with relative color syntax, calc() for dynamic alpha, and can aid theming for light/dark modes, offering concise, reusable styling.
- alpha() can apply transparency to named colors and design tokens directly
- Use alpha() with calc() to derive transparency relative to the original alpha
- Combine alpha() with light-dark for seamless light/dark mode theming