CSS alpha() Lets You Adjust Transparency Without Duplicating Color Tokens
- Geoff Graham
- 642 reads
CSS alpha() changes a color’s transparency where you use it, helping design systems create variations while keeping their original color tokens.

CSS’s alpha() function gives teams a direct way to change a color’s transparency at the point of use. That can keep a design system’s color tokens focused on base colors instead of accumulating separate tokens for every translucent variation.

The function uses relative color syntax: it takes an existing color, then sets or calculates its alpha channel. Because the input can be a custom property or a named color, the same operation works across different color formats.
.some-element {
background-color: alpha(from orange / 25%);
}Named colors make the syntax easy to see. Traditionally, applying transparency to a named color meant expressing the color in a format that supports alpha. With alpha(), the color can stay named while the function supplies the transparency. For production design systems, though, the more useful input is likely to be a color token whose value is controlled by the project.
Derive variations from existing tokens
Suppose a system defines orange as an opaque RGB value:
:root {
--orange: rgb(255, 122, 24);
}A link underline might look better with that orange softened. One option is to create a second custom property for the translucent version. That makes the intended role explicit, but it also adds another token to maintain whenever the base color changes.
:root {
--orange: rgb(255, 122, 24);
--chill-orange: rgb(255, 122, 24 / 50%);
}
a {
text-decoration-color: var(--chill-orange);
}A component can instead derive the variation where it needs it. CSS already offers color-mix() for blending colors, including with transparency:
:root {
--orange: rgb(255, 122, 24);
}
a {
text-decoration-color: color-mix(in srgb, var(--orange), transparent 50%);
}With alpha(), the same property can set the alpha channel directly:

:root {
--orange: rgb(255, 122, 24);
}
a {
text-decoration-color: alpha(from var(--orange) / 50%);
}The practical distinction is that color-mix() describes a blend, while alpha() names the channel being adjusted. For a simple transparency change, the latter makes the intent easier to scan. Either approach can reduce the need for one-off color tokens; the better fit depends on whether the design calls for a channel adjustment or a broader color blend.
Theme by changing the source color
Relative color operations can also sit inside a theme definition. The example below uses light-dark() to select a translucent orange in light mode and an opaque orange in dark mode:
:root {
color-scheme: light dark;
--orange: light-dark(
alpha(from rgb(255, 122, 24) / 50%),
rgb(255, 122, 24)
);
}This keeps the mode-specific choice attached to the token, so components that consume --orange can follow the theme without each defining its own color variation. The example combines two CSS features, however, so teams should check support for both in the browsers they need to serve before relying on the result.
Replace an existing alpha value
The function can set a new alpha value even when the input color already has transparency. For example, a token with 25% alpha can be used at 50% alpha in a particular property:
:root {
--orange: rgb(255, 122, 24 / 25%);
}
a {
text-decoration-color: alpha(from var(--orange) / 50%);
}That lets the shared token remain unchanged while a component chooses a different alpha for its own context. It also means the declared output value is an explicit override, rather than an additional reduction applied to the input’s existing alpha. That distinction matters when reviewing styles: a value of 50% here sets the output alpha to 50%.
Calculate transparency from the input
Sometimes a fixed output is less useful than a relationship to the source color. Inside calc(), the alpha keyword refers to the input color’s alpha channel:
:root {
--orange: rgb(255, 122, 24 / 10%);
}
a {
/* Use 75% of the source alpha value */
text-decoration-color: alpha(from var(--orange) / calc(alpha * 75%));
}Here the input alpha is 10%, so multiplying it by 75% produces an output alpha of 7.5%. The result is less opaque than the source. This is useful when a family of colors should preserve its existing transparency relationships instead of being forced to one fixed value. The CSS comment should describe the calculation precisely: reducing alpha to 75% of its original value is different from making a color “75% more transparent.”
Syntax and browser readiness
The specified form is:
alpha(from <color> / [<alpha-value> | none])The alpha value can be a percentage or a number from 0 to 1. A decimal works in calculations as well:
text-decoration-color: alpha(from var(--orange) / calc(alpha * .75));alpha() is defined in the CSS Color Module Level 5 Editor’s Draft, so its specification may change before it reaches Candidate Recommendation. At the time described, the feature had “Newly Available” status in September 2026 and was expected to become “Widely Available” in March 2029. Those milestones make browser support a central implementation concern: check current support for the target browsers, and provide a fallback if the function is part of a critical color path.
For teams already organizing colors around reusable tokens, alpha() offers a compact way to express local transparency choices and calculated variants. Its clearest value is in making those transformations visible where they matter. Before adopting it broadly, verify support across the browser matrix and decide whether each variation should be a reusable token or a context-specific adjustment.