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

> I think, as a design principle, locals should not introduce any boilerplate to mixins that don't need locals. Not just for ergonomics, but also strategically: it means simple mixins can ship first and locals can be implemented later, without simple mixins having this weird wart that only makes sense once complex mixins ship.

There is no shipping-complexity benefit to doing a "no locals" version of Mixins, fwiw. They're just another way to spell Mixin arguments, without the confusion of making them passable.

-------

FWIW, I'm strongly **for** the `@result` rule, in the standard Mixin here. We already have existence proof that authors find the syntax parallel with `@function/result` to make sense. (Miriam's interview with Chris Coyier, where as Miriam showed off the basic syntax, Chris literally said something like "oh like the 'result' property, makes sense".)

I think we should *really* value that sort of mental-model consistency when we can, because Mixins and Functions have *enormous* functional and behavioral parallels and keeping their syntax and concepts as parallel as possible is a *huge* win I think. I do not believe the cost of `@result` in small Mixins is worth having a complete syntax break between the two *and* dealing with the complexity of how exactly locals are mixed with styles in conditionals/etc.

Remember, also, that we have a resolution to introduce a *different* rule that has the "unscoped"/"simple" behavior, where there's no locals, no hygiene, no scoping, and thus no need for an `@result`. I think a lot of those "small" Mixins would be perfectly fine just using that rule instead.

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


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

Received on Tuesday, 3 March 2026 23:57:43 UTC