-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing ruleset with variables to mixin #2004
Comments
So is it "pass named set of variables to mixin" or "pass one mixin into another by name"? Those are quite different things actually. OK, never mind, I guess I can guess what you need. Well, you can use old good "tagged mixins" for this:
Although, technically I also would expect your initial snippet to work as it is too (i.e. Alternatively another working solution is:
Though I don't think it has any advantages over the first one. |
For my usecase it doesn't matter what will I pass to the underlying ( Slightly different example with expected output:
The output:
|
Yes, I get it. Hence my first example. The only difference is that instead of |
Thank you! I just found your SO ansfer about such and other workarounds. However is there a plan/roadmap to add generic mixin-as-parameter feature? I can easily imagine the cases where it would be very userfull though.. |
There was a discussion of it at least (so maybe, eventually). |
If you don't mind I'll close this as not an issue or bug report (there's discussable variable visibility behaviour in the initial example but it's probably better to be reported separately in more formal way). |
Is there a way to pass named set of variables to mixin? Like so:
Generally speaking, I need some way of parametric composition, the way to pass one mixin into another by name. I think this is quite useful in many cases. There is may be an approach to simulate this behavior?
The text was updated successfully, but these errors were encountered: