我正在尝试使用一个.flexbox
接受参数的 mixin @orient
,它也应该自动应用box-orient
。将它与 结合使用时!important
,我遇到了一个错误,该错误也可以通过更缩小的测试用例重现:
.foo() {
.bar;
}
.bar {
color: red;
}
body {
.foo() !important;
}
这使得 LESS 抛出一个错误(我在 node.js 中使用它):
C:\...\node_modules\less\lib\less\parser.js:385
throw new(LessError)(e, env);
^
TypeError: Cannot call method 'charAt' of undefined
奇怪的是,使用.foo
而不是.foo()
按预期工作:
.foo {
.bar;
}
.bar {
color: red;
}
body {
.foo !important;
}
我究竟做错了什么?