The @apply rule accepts a block following it, which can be used inside a @mixin rule using @contents:
@mixin --m(--color, @contents) {
color: var(--color);
&:hover {
@contents;
}
}
div {
@apply --m(green) {
text-underline: underline;
}
}
The spec currently requires @contents to appear in the parameter list of the mixin for the above to be valid. Do we need that, though? Can't we just pretend that the @contents parameter is always there?
The
@applyrule accepts a block following it, which can be used inside a@mixinrule using@contents:The spec currently requires
@contentsto appear in the parameter list of the mixin for the above to be valid. Do we need that, though? Can't we just pretend that the@contentsparameter is always there?