Re: [csswg-drafts] [css-mixins-1] Auto-wrap mixin body in `@result` if omitted? (#13524)

I really like the proposed design and current spec text.

I was hesitant over the required `@result` rule before but have since changed my mind on this.
When thinking of this as implicit vs. explicit `return` statements as seen in ruby or rust, I personally prefer explicit notation. It makes it so much easier to scan code and directly understand what everything does.

I can imagine that some mixins might be fairly lengthy and with optional `@result` you need to carefully scan the entirety of the mixin to know if there are any `@result` blocks.

I also don't think this places undue burden onto authors. The mixins feature in general will be used a lot, but writing a new `@mixin` will be fairly rare. Definitely not saying that there won't be some cases that can't be a `@macro` and could have been a `@mixin` with an implicit `@result` and that this could have saved someone a few keystrokes and a few seconds.

> Whoa. I had not realized locals cannot be defined within nested rules. Why?

Because those are contradictory.

If you are writing a selector then you aren't working "locally" within the mixin, then you are styling something external to the mixin.

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


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

Received on Saturday, 7 March 2026 19:14:39 UTC