移动端项目在sass中使用@2x@3x图
Sass (Scss)
@mixin bg_image($url) {
background-image: url($url+".png");
background-size: 100% 100%;
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
background-image: url($url+"@2x.png");
}
}
Sass (Scss)
//使用
@include bg-image('你图片地址');