emp*_*ine 7 css sass neat media-queries bourbon
我知道以下可以在波旁威士忌中完成:
$mobile: new-breakpoint(max-width: 320px);
$tablet: new-breakpoint(max-width:760px min-width:321px);
$desktop: new-breakpoint(min-width: 761px);
Run Code Online (Sandbox Code Playgroud)
然后我可以这样做:
@include media($mobile) {
// some styling
}
Run Code Online (Sandbox Code Playgroud)
它很棒.现在我必须添加影响移动设备和平板电脑的样式.我正在寻找移动和平板电脑断点联盟.
//desired behavior
//I know this is not available. Just made up
@include media($mobile, $tablet) {
// some styling.
// this should be applied to mobile and tablet
}
Run Code Online (Sandbox Code Playgroud)
不确定是否还有人需要这个,但我做了以下功能:
@mixin multiple-media($media...) {
@each $query in $media {
@include media($query) {
@content
}
}
}
Run Code Online (Sandbox Code Playgroud)
这对我很有用.
@include multiple-media($mobile-landscape, $tablet-portrait, $tablet-landscape, $laptop, $desktop) {
.mobile {
@include display(none);
}
}
Run Code Online (Sandbox Code Playgroud)
产生
@media screen and (min-width: 29.25em) and (max-width: 48em) and (max-height: 29.25em) {
.logo a .mobile {
display: none; } }
@media screen and (min-width: 29.25em) and (max-width: 50em) and (min-height: 29.25em) {
.logo a .mobile {
display: none; } }
@media screen and (min-width: 48em) and (max-width: 80em) and (max-height: 50em) {
.logo a .mobile {
display: none; } }
@media screen and (min-width: 80em) and (max-width: 105em) {
.logo a .mobile {
display: none; } }
@media screen and (min-width: 105em) {
.logo a .mobile {
display: none; } }
Run Code Online (Sandbox Code Playgroud)