阅读背景:

如何在LESS中的变量中使用变量名?

来源:互联网 

I have this code snippet:

我有这段代码:

// Color settings 
.setCat(@x) {
    .cat@{x} {
        .menu-link {
            &.selected, &:hover { background: ~@{"catColor@{x}"}; }
            &:hover:after { border-top-color: ~@{"catColor@{x}"}; }
            &:only-child:after { border-top-color: transparent; }
        }
        .menu-link-submenu { background: ~@{"catColor@{x}"}; }
    }
}

.setCat(1);
// Color 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: