scss混入,@mixin与@include

定义一个混入:
@mixin flex{
display: flex;
justify-content:space-between;
align-items: center;
flex-direction: row;
}
使用混入:
.flight {
@include flex;
box-sizing: border-box;
}
--------------------------------
//向混入传递变量

定义一个混入:
$center:center;
@mixin flex($vertical:$center) {
display: flex;
align-items: $vertical;
}
使用混入:
.flight {
@include flex(left);
box-sizing: border-box;
}

上一篇:VSCode动态加载scss


下一篇:create-react-app 配置scss,ant-design,装饰器,代理,node支持最新语法,express es6 后端,链接mongodb