Created
October 11, 2012 22:29
-
-
Save bearroast/3875948 to your computer and use it in GitHub Desktop.
Simple retina mixin from 37signals
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
// Mixin (1.3 due to Nexus 7) | |
@mixin image-2x($image, $width, $height) { | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 2.6/2), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
background-image: url($image); | |
background-size: $width $height; | |
} | |
} | |
// In use | |
input[type="email"] { | |
background: url(mail.png) 14px 14px no-repeat; | |
background-size: 21px 16px; | |
@include image-2x("mail@2x.png", 21px, 16px); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment