Created
November 22, 2013 19:43
-
-
Save krisbulman/7605649 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
@import "compass"; | |
// Retina Wrapper | |
// Wrap anything in a resolution query | |
// | |
// Params: | |
// $background-size - Optional value to set background size | |
// | |
@mixin hdpi-wrapper($background-size: FALSE) { | |
@media only screen and (-webkit-min-device-pixel-ratio: 2), | |
only screen and (min--moz-device-pixel-ratio: 2), | |
only screen and (-o-min-device-pixel-ratio: 2 / 1), | |
only screen and (min-device-pixel-ratio: 2), | |
only screen and (min-resolution: 192dpi), | |
only screen and (min-resolution: 2dppx) { | |
@content; | |
@if $background-size != FALSE { | |
@include background-size($background-size); | |
} | |
} | |
} | |
.retina-magic { | |
background: image-url('test-1360×572.jpg') no-repeat 0 0; | |
@include hdpi-wrapper(1360px 572px) { | |
background: image-url('test-2720×1144.jpg') no-repeat 0 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
.retina-magic { | |
background: url('/test-1360×572.jpg') no-repeat 0 0; | |
} | |
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { | |
.retina-magic { | |
background: url('/test-2720×1144.jpg') no-repeat 0 0; | |
-moz-background-size: 1360px 572px; | |
-o-background-size: 1360px 572px; | |
-webkit-background-size: 1360px 572px; | |
background-size: 1360px 572px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment