LESS:如何访问另一个名称中有变量的变量引用的变量?

LESS: How access variable referenced by another variable who has a variable in its name?

正如标题所说,除了名称参数化之外,我还需要访问一个被引用的变量内容。

这是必需的,因为我使用的 less 库引用了变量。

设置:

适当的例子,因为如果不解释就不清楚:

我正在使用的 X 库有这个 mixin:

.get-color-main-variables(@name) {
  @color-50:  ~"@{name}-50";
 // ... more lines to follow like the above.
}

稍后在我的代码中,我使用这个 mixin 来获取这些变量:

.generate-raised-variant (@color) {
  .get-color-main-variables(@color);

  .color-@{color}-50 {
      color : @@color-50;
  }
}

到目前为止一切顺利,我可以访问上面指出的那些变量。

问题:

问题是我需要设置很多这样的样式,所以我想到了一个生成器 mixin 以 Y 间隔为我生成它们,所以我做了类似的事情:

// Defining the generator.
.generator (@color, @step: 50) when (@size <= 1000) {
  .get-color-main-variables(@color);

  .color-@{color}-@{step} {
    color: @@color-50; // <------ ISSUE HERE!!!!!!
    // THIS DON'T WORK:
    // color: @@color-@step;
  }

  .generator(@color, @step + 50);
}

// And using it:
.generator(@color, 0);

我知道在 less 中这是一个复杂的变量使用,但这是图书馆为我推迟的障碍,所以:

问题:

question/s 将是:

谢谢

在@seven-phases-max 的帮助下以及大量的反复试验中,我得以完成此任务。

以下对我有用(尽管很奇怪):

.color-@{color}-@{step} {
    @buffer: 'color-@{step}';
    @color: @@buffer;

    color: @@color;
}