Less实战(三):混合(Mixins)

Aggie ·
更新时间:2024-09-20
· 882 次阅读

文章目录混合(Mixins)Mixins中的选择器命名空间!important 关键词参数传递混合匹配选择器函数功能混叠(Aliasing Mixins) 混合(Mixins)

混合(Mixin) 是一种将一组属性从一个规则集包含(或混入)到另一个规则集的方法。
Less 中的作用域与 CSS 中的作用域非常类似。首先在本地查找变量和混合(mixins),如果找不到,则从“父”级作用域继承。

@color: red; .father{ background:@color; } #son{ color: @color; .father(); }

编译后 >>>
原创文章 62获赞 143访问量 7万+ 关注 私信 展开阅读全文
作者:数据库爆破专家



less

需要 登录 后方可回复, 如果你还没有账号请 注册新账号