Re: [csswg-drafts] [css-mixins-1] A var()-based model for mixin parameters (#12927)

All right, I added the "simple Mixin" variant to the spec. Since its core "thing" is that it just injects its contents directly with no rewriting, I decided that a good name would be `@macro`. I'm not attached to it, if we come up with something better.

I decided that macro/Mixins were too close to make them completely distinct, so I made them share a namespace, and they're both invoked via `@apply` in an identical fashion. Basically, whether you're defining a Mixin or a macro is an authoring decision; it doesn't actually affect how it's used. In many cases there's not any difference *at all* between the two of them, after all!

The other wrinkle I settled on that wasn't actually discussed in the meeting is that `@macro` doesn't accept any arguments. I don't think there's any way to make it take arguments that doesn't "magically" add those as *public* custom properties into the result. In that case, it's better to just document them as custom properties that your macro refers to, and have the user set the custom props themselves.

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


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

Received on Wednesday, 4 March 2026 23:00:25 UTC