@mixin md {
@media (max-width: 768px) {
@content;
}
}
.className{
@include md {
background: blue;
}
}
$screen-md-min: 768px;
@mixin md {
@media (max-width: #{$screen-md-min}) {
@content;
}
}
$screen-md-min: 768px;
$screen-xl-min: 1024px;
@mixin md {
@media (max-width: #{$screen-md-min}) {
@content;
}
}
@mixin xl {
@media (max-width: #{$screen-xl-min}) {
@content;
}
}
.testStyle{
//max-width로 정했으니까 큰기기->작은 기기 순으로 스타일을 쓴다.
@include xl{
background: red;
}
@include md {
background: blue;
color: yellow;
}
}
https://medium.com/codeartisan/breakpoints-and-media-queries-in-scss-46e8f551e2f2