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

The CSS Working Group just discussed `[css-mixins-1] A var()-based model for mixin parameters`.

<details><summary>The full IRC log of that discussion</summary>
&lt;ydaniv> TabAtkins: just intro-ing this topic<br>
&lt;ydaniv> ... current spec for mixins, for some reasons, it has to handle args to mixins in speciial way<br>
&lt;ydaniv> ... can't just use var(), becaue the body is passed to another rule and you don't want to pollute other stuff<br>
&lt;ydaniv> ... so I difined a new idea of scope<br>
&lt;ydaniv> ... it kanda works, have some issues<br>
&lt;ydaniv> ... and we thought of another idea<br>
&lt;ydaniv> ... effectively when you apply a mixin, we do a funky inversion where you end up with a lot of anonymous functions in the leaf property values<br>
&lt;ydaniv> ... where you have a behavior where they interleave in a nice way<br>
&lt;ydaniv> ... so not inventting a new way to invoke funcitons<br>
&lt;ydaniv> ... makes it work substantially better, may have some odd implications<br>
&lt;ydaniv> ... helps a lot with caching<br>
&lt;ydaniv> ... we used YOUTUBE as test case<br>
&lt;ydaniv> ... so letting ppl know that we're experimenting with it, very happy about it internally<br>
&lt;lea> q+<br>
&lt;miriam> q+<br>
&lt;kizu> +1<br>
&lt;ydaniv> ... if there are no objections, would like to change spec to this new model<br>
&lt;ydaniv> lea: based on this summary, not sure what is proposed<br>
&lt;ydaniv> ... very hard to say whether we object<br>
&lt;ntim> +1 to lea<br>
&lt;ydaniv> TabAtkins: this is just an intro<br>
&lt;ydaniv> ... in the linked issue there are more details<br>
&lt;fantasai> +1 to lea<br>
&lt;astearns> ack lea<br>
&lt;astearns> ack miriam<br>
&lt;ydaniv> miriam: I think would be helpful to have comments on implications, not just impl. details<br>
&lt;ydaniv> TabAtkins: the author facing implications, A: not introducing a new arg for custom funcs and var, they look similar<br>
&lt;ydaniv> ... B: this makes variables passed to mixins work better, to some extent<br>
&lt;ydaniv> ... in most cases did not work in previous model<br>
&lt;miriam> q+ to finish my thought<br>
&lt;ydaniv> ... there are some limitations still, like how geenric macro works<br>
&lt;ydaniv> ... but upshot is, in general case, maybe all, passing variables in should work<br>
&lt;ydaniv> ... and same authoring model<br>
&lt;astearns> ack miriam<br>
&lt;Zakim> miriam, you wanted to finish my thought<br>
&lt;ydaniv> miriam: and there are also implications that you can only impact decendants?<br>
&lt;ydaniv> TabAtkins: not necessarily, if I want to add a restriction that it acts like it's scoped<br>
&lt;ydaniv> ... if you don't apply it then, if you select above or siblings, they may work differently<br>
&lt;ydaniv> .. it's a bit of a footgun if you want to allow unscoped mixins<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to ask what impact this has on people using mixins<br>
&lt;ydaniv> miriam: will have to look into it more<br>
&lt;ydaniv> fantasai: what is the look path for foo variable?<br>
&lt;ydaniv> TabAtkins: similar to custom functions, mixins also introduce hypothetical elements<br>
&lt;ydaniv> ... so if you in the simple cases ...<br>
&lt;ydaniv> fantasai: from the element you apply from?<br>
&lt;ydaniv> TabAtkins: this comes to discussion on scoping or not<br>
&lt;ydaniv> fantasai: if I take a code block and apply a mixin, if I ask for element foo do I get same element? or looking it up on the applied?<br>
&lt;ydaniv> TabAtkins: you first use where you apply, the walk up the tree<br>
&lt;ydaniv> astearns: we have this proposal, and impl behind flag you can try out<br>
&lt;ydaniv> miriam: we can play with it in canary?<br>
&lt;ydaniv> TabAtkins: yea<br>
&lt;ydaniv> astearns: moving on<br>
</details>


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


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

Received on Friday, 14 November 2025 06:12:43 UTC