-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path_image.scss
27 lines (24 loc) · 1.08 KB
/
_image.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// This mixin require Modernizr
@mixin background-image($name, $size: false){
background-image: url(#{$image-path}/#{$name}.svg);
@if($size){
background-size: $size;
}
.no-svg &{
background-image: url(#{$image-path}/#{$name}.#{$image-fallback-extension});
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
background-image: url(#{$image-path}/#{$name}#{$image-retina-suffix}.#{$image-fallback-extension});
}
}
}
@mixin image-2x($name, $image-size: $sprite-size) {
@media (-moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
background-image: url(#{$image-path}/#{$name}#{$image-retina-suffix}.#{$image-fallback-extension});
@include bg-size($image-size);
}
}
@mixin sprite($width, $height, $bg-extras) {
width: $width;
height: $height;
background: url(#{$image-path}/#{$sprite}) no-repeat $bg-extras;
}