CSS had no way to reuse a named chunk of declarations.
--x) holds one value.@function (shipped in Chrome 139) returns part of a property value, nothing more.position/width/height/overflow/clip-path, a button's colors + spacing + :hover, "styles that only apply at this breakpoint") had to come from Sass/Less mixins, utility classes, or copy-paste.Tab Atkins's first version put a ruleset inside a custom property and expanded it with @apply:
x-component { --heading-style: { color: var(--theme-color); }; }
.heading { @apply(--heading-style); }
This "mixed levels". A custom property doesn't care whether it holds a value or a ruleset, so var(--theme-color) was resolved early, on the element where the property was defined (say, .list), not on the element that used it. Then came more questions (who sees custom properties set inside the block? what does it mean for a ruleset to inherit?), and Tab withdrew it himself in "Why I Abandoned @apply".
The new design learns from that: a mixin is not an inherited value but a definition that rewrites the style sheet.
@mixin --button(--bg <color>: royalblue, --fg <color>: white) {
background: var(--bg);
color: var(--fg);
padding: .5em 1em;
&:hover { background: color-mix(in oklch, var(--bg), black 20%); }
}
.danger { @apply --button(crimson); }
--. Parameters are optional and can have a type (such as <color>) and a default. If a default doesn't match its type, the whole @mixin is invalid.@media/@supports/@container, nested style rules, and further @apply calls are all allowed.@mixin is top-level only (not inside a style rule). @apply is the opposite: it's only valid inside a style rule (or a nested group rule).