Re: [csswg-drafts] [css-mixins-1] Should we be more explicit about the result? (@result) (#13138)

I kinda lost track of concurrent and evolving proposals. What is the current consensus for the [body of the `@mixin {}` at-rule block](https://drafts.csswg.org/css-mixins-1/#mixin-body)?

1. Only custom properties (i.e. actually: _custom descriptors_) and …
   1. a single `@result {}`
      1. anywhere.
      2. at the end.
   2. multiple additive `@result {}`.
   3. multiple exclusive `@result {}`.
   4. multiple conditional `@result () {}`.
2. Only custom properties and at-rules, including `@media` and `@container` and
   1. `@result`,
   2. `@contents`,
   3. `@apply` (even recursive).
3. Either `@result`(s), possibly mixed with custom descriptors, (option 1 or 2)  
or a ”normal“ declaration list of properties, possibly mixed with custom properties;  
not both at once.
4. Anything that is valid verbatim wherever the mixin is `@apply`ed, 
   1. i.e. no special at-rules or descriptors.
   2. … except `@contents`.
5. Any number and order of “normal” declarations, “global” at-rules and special at-rules.

--------

For what it’s worth, I believe CSS mixins should work like dumb preprocessor macros as much as possible. I don’t even like the idea of passing `@contents`. Any logic that shall be evaluated before transclusion should be restricted to sub-at-rules that are not available outside `@mixin`, so option 1.4 appeals to me. 
The declaration variant of `@mixin` without a declaration list inside `{}` could be used for aliasing. 

-- 
GitHub Notification of comment by Crissov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13138#issuecomment-3686044337 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 23 December 2025 10:10:09 UTC