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

Can't apply mixin as varible from a namespace #3406

Open
ahultgren opened this issue Jul 16, 2019 · 1 comment
Open

Can't apply mixin as varible from a namespace #3406

ahultgren opened this issue Jul 16, 2019 · 1 comment

Comments

@ahultgren
Copy link

This might be related to #3405:

.mix (@n) {
  value: @n;
}

@var: .mix(var);

#lookup {
  @var: .mix(lookup);
  @bar: bar;
}

.example {
  @var();
  value2: #lookup[@bar];

  // This is what I'm trying to do, since the above works:
  #lookup[@var]();
}

Expected:

.example {
  value: lookup;
  value2: bar;
}

Actual: unexpected token.

In this case I can't find a workaround using detached rulesets, but since @var() works I expect the nested syntax #lookup[@var]() to work as well.

@matthew-dean
Copy link
Member

AFAIK this is simply an unsupported feature i.e. you can't call a mixin from a lookup. You need to alias it to a variable, as you mentioned.

matthew-dean added a commit to matthew-dean/less.js that referenced this issue Aug 25, 2019
matthew-dean added a commit to matthew-dean/less.js that referenced this issue Aug 25, 2019
matthew-dean added a commit that referenced this issue Aug 25, 2019
* Fixes to Gruntfile
* Fixes #3405
* Added #3406 example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants