Skip to content
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

ParseError: Missing closing ')' while creating Not Outputting the Mixin or Parametric mixin #2698

Closed
YahweRaj opened this issue Sep 19, 2015 · 3 comments

Comments

@YahweRaj
Copy link

I am trying to create a dynamic mixin name and it throws the error. Refer the below screen shot and code snippet.

@color: #fff;
@A: 2;
.mixin-@{a}(){
color: @color;
}
div{
.mixin-2();
}

image

How to resolve this issue? Am I missed something ?

@seven-phases-max
Copy link
Member

No, you can't use variables to form a name of a mixin to invoke. All contexts where variable interpolation is valid are listed in the docs.

The feature you imagined above is discussed in #1399 among other less or more similar and alternative stuff (in particular there's an opinion that other proposed features would better fit any use-cases you could use this one for).


I will close this one as "expected behaviour". Feel free to re-open though, if you will invent a use-case for this (a use-case where this feature appears as a must have and nothing but this one can resolve it), thus so that we could treat it as a feature request. But meanwhile, since I know your original use-case was http://stackoverflow.com/questions/32665124 (which is much more easy and more straight-forward to be solved with other stuff), closing...

@seven-phases-max
Copy link
Member

Closing as expected behaviour.

@Bear-Foot
Copy link

Bear-Foot commented Aug 18, 2016

I'm facing a situation where I need to build a mixin with a variable name.

First, I need to avoid this, and this is why I need it as a silent mixin.
http://stackoverflow.com/questions/31535315/avoiding-output-duplication-using-webpack-less-loader-and-extract-text-webpack

Is there any workaround to do something like .@{a}() at the moment ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants