【发布时间】:2018-10-06 21:27:58
【问题描述】:
如何为同一个 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“大断点”不接受内容块。
【问题讨论】:
标签: css sass scss-mixins