Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * example: @include background@2x( 'path/to/image', 'png', repeat-x);
- */
- @mixin background_2x($path, $ext: "png", $repeat: no-repeat) {
- $at1x_path: "#{$path}.#{$ext}";
- $at2x_path: "#{$path}@2x.#{$ext}";
- background-image: url("#{$at1x_path}");
- background-repeat: $repeat;
- @media all and (-webkit-min-device-pixel-ratio : 1.5),
- all and (-o-min-device-pixel-ratio: 3/2),
- all and (min--moz-device-pixel-ratio: 1.5),
- all and (min-device-pixel-ratio: 1.5) {
- background-image: url("#{$at2x_path}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement