less学习(二):合并`Merge`

123 阅读1分钟

合并(Merge):将多个值合并到单个属性下的逗号或空格分隔列表中

Merge

.mixin() {
    box-shadow+: inset 0 0 10px #555;
} 
.myclass {
    .mixin();
    box-shadow+: 0 0 20px black;
}

转义:

.myclass {
    box-shadow: inset 0 0 10px #555, 0 0 20px black;
}

Space

.mixin() { 
    transform+_: scale(2); 
} 
.myclass { 
    .mixin(); 
    transform+_: rotate(15deg); 
}

转:


.myclass {
    transform: scale(2) rotate(15deg);
}