Less 为什么对引导变量使用@{variableName}而不是@variableName

Less 为什么对引导变量使用@{variableName}而不是@variableName,less,Less,我正在查看无引导源代码,其中有以下内容: .calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) { .col-@{class}-@{index} { width: percentage((@index / @grid-columns)); } } 为什么他们要编写-@{class}而不是简单地编写-@class?正如@Damien\u所解释的那样,无异信者使您能够使用选

我正在查看无引导源代码,其中有以下内容:

.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {
  .col-@{class}-@{index} {
    width: percentage((@index / @grid-columns));
  }
}

为什么他们要编写
-@{class}
而不是简单地编写
-@class

正如@Damien\u所解释的那样,无异信者使您能够使用选择器名称、属性名称、URL和@import语句。(也?)


大括号{}用于清除变量名。在
@ab
的情况下,您可以读取变量
@a
@ab
{a}b
强制使用变量
@a
并附加字符串
b

@Damien\u不信者请添加您的评论作为答案,以便我可以接受