Skip to content

Instantly share code, notes, and snippets.

@rdobrynin
Created February 24, 2015 10:59
Show Gist options
  • Save rdobrynin/dd9c94087e739fee2e7c to your computer and use it in GitHub Desktop.
Save rdobrynin/dd9c94087e739fee2e7c to your computer and use it in GitHub Desktop.

Revisions

  1. rdobrynin created this gist Feb 24, 2015.
    13 changes: 13 additions & 0 deletions gistfile1.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    @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) {
    /* on retina, use image that's scaled by 2 */
    background-image: url($image);
    background-size: $width $height;
    }
    }

    // @include image-2x("logo2x.png", 137px, 17px);