Re: [csswg-drafts] [css-mixins-1] Do we really need the `@contents` parameter? (#12946)

> As arguments are currently defined...

That was a subtle hint that I believe the best would be if exceeding arguments were just disregarded instead of making the whole rule invalid.

> ... I think it makes most sense to determine whether the mixin uses an `@contents` in its body. And if it doesn't, `@apply`'s having a block are invalid.

The consistency lies in `@apply` being considered invalid when an unexpected argument _or_ body is provided. But if exceeding arguments and an unexpected body were simply ignored, we'd also have consistency.
Having to add `@contents` to the `@mixin`s signature is consistent with having to declare the arguments, but in my eyes (and obviously also @andruud's) it is an unnecessary redundancy.

> Basing it on the body means that you couldn't, say, temporarily simplify the mixin to debug something (removing the use of the content block), as that would mean you have to go back and change _all the call sites_ too.

Right, same applies to simplifying mixins by removing an argument, currently.

Sebastian

PS: @tabatkins Little tip on quoting: Select the part you want to quote and choose "Quote reply" from the menu. Doing so keeps the formatting intact and doesn't unnecessarily poke any GitHub accounts coincidentally having the same name as some at-rules.

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


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

Received on Wednesday, 15 October 2025 20:29:01 UTC