在LESS中,我可以写出这样的东西:
.foo {
color: red;
}
.boo {
.foo();
background: blue;
}
将类.foo
属性"包含"到.boo
类中。
在 SCSS 中获得类似 beavior 的最简单、干净的方法是什么?
像这样尝试怎么样,
mixins.scss
@mixin flex($x: center, $y: center) {
display: flex;
align-items: $x;
justify-content: $y;
}
custom.scss
.classname {
@include flex(flex-start, space-between);
color: red;
}
使用@include