【发布时间】:2016-05-19 13:52:25
【问题描述】:
我在工作过程中写了很多媒体查询。
像这样:
@mixin fullWidth {
@media screen and (max-width: 1024px) and (min-width: 960px) {
@content;
}
}
并在许多文件中使用了这个 mixin。
@include laptop {
.test { content: "" }
}
@include laptop {
.text2 {content: "2" }
}
它在我的 CSS 文件中生成了两个媒体查询:
@media screen and (max-width: 1024px) and (min-width: 960px) {
.test { content: "" }
}
@media screen and (max-width: 1024px) and (min-width: 960px) {
.test2 { content: "2" }
}
我想合并相似的查询 我正在使用咕噜声。
如果有必要,我会尽一切可能解决
【问题讨论】:
-
在纯 css 中,您应该将 1 个媒体查询的所有规则一起编写(不确定 gruntjs)