小编Nat*_*zza的帖子

In LESS CSS, is it possible to use a namespaced variable in a call to another mixin?

In LESS CSS, is it possible to use a namespaced variable in a call to another mixin or as a default value in another mixin? Using the normal syntax, it appears not, but is there an escape sequence or other syntax I can use to achieve the effect I'm looking for?

I'm thinking of code like this:

#namespace {
    @nsColor: #333;
}

.testMixin1(@mixinColor) {
    background-color: @mixinColor;
}

.selector { .testMixin1(#namespace > @nsColor); } 
Run Code Online (Sandbox Code Playgroud)

Or alternatively...

.testMixin2(@anotherMixinColor: #myNamespace > @myColor) { …
Run Code Online (Sandbox Code Playgroud)

css namespaces mixins less

7
推荐指数
1
解决办法
3331
查看次数

标签 统计

css ×1

less ×1

mixins ×1

namespaces ×1