如何在支持内容块的情况下为同一个 mixin 定义多个名称?
定义
@mixin desktop-breakpoint {
@media only screen and (min-width: 769px) {
@content;
}
}
@mixin large-breakpoint {
@include desktop-breakpoint;
}
用法
.my-class {
font-size: small;
@include desktop-breakpoint {
font-size: big;
}
}
.my-other-class {
color: red;
@include large-breakpoint {
color: blue;
}
}
错误信息
Mixin“大断点”不接受内容块。