【发布时间】:2015-07-18 03:41:00
【问题描述】:
我正在尝试让嵌套的 IE10+ 媒体查询在 SASS 中工作,但我不理解输出。我认为使用媒体查询or 运算符, 会变得很奇怪。因此,此查询不适用于所有情况,因为输出的唯一内容是or 的一侧。
请注意,这些最初是 mixin;我删除了 mixins 以使调试更容易
.element {
@media only screen and (min-width: 825px) and (max-width: 999px) {
font-size: 10.4vw;
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
font-size: 9.6vw;
}
}
}
编译成这样:
@media only screen and (min-width: 825px) and (max-width: 999px) {
.element {
font-size: 10.4vw;
}
}
@media only screen and (min-width: 825px) and (max-width: 999px) and (-ms-high-contrast: active) {
.element {
font-size: 9.6vw;
}
}
预期结果是:
@media all and (-ms-high-contrast: none) and (min-width: 825px) and (max-width: 999px), (-ms-high-contrast: active) and (min-width: 825px) and (max-width: 999px) {
.element {
font-size: 9.6vw;
}
}
【问题讨论】:
-
您希望由此生成什么查询?您是否尝试过验证您预期的 CSS?
-
我在原帖中添加了预期的结果
标签: css sass nested media-queries