【发布时间】:2013-09-22 21:14:31
【问题描述】:
我有以下 scss:
@mixin logo($size:mobile) {
@if $size == mobile {
#logo {
@extend %logoMobile;
a {
@extend %logoMobile;
}
}
}
@else {
#logo {
@extend %logoDesktop;
a {
@extend %logoDesktop;
}
}
}
}
%fullWidth {
width: 100%;
}
%logoMobile {
@extend %fullWidth;
height: 30px;
}
%logoDesktop {
width: 211px;
height: 35px;
}
#header {
@include logo('mobile');
}
@media only screen and (min-width: 768px) {
#header {
@include logo('desktop');
}
}
其中生成的css输出为:
#header #logo, #header #logo a {
width: 100%;
}
#header #logo, #header #logo a {
height: 30px;
}
知道为什么没有生成@media 查询吗?
【问题讨论】:
-
为什么会生成媒体查询?
-
什么意思?它在 scss 文件中 - 因此您希望它在输出中生成 - 对吧?
标签: css sass media-queries