混合(Mixin) 是一种将一组属性从一个规则集包含(或混入)到另一个规则集的方法。
Less 中的作用域与 CSS 中的作用域非常类似。首先在本地查找变量和混合(mixins),如果找不到,则从“父”级作用域继承。
@color: red;
.father{
background:@color;
}
#son{
color: @color;
.father();
}
编译后 >>>
原创文章 62获赞 143访问量 7万+
关注
私信
展开阅读全文
作者:数据库爆破专家