Skip to content

Instantly share code, notes, and snippets.

@chrisforrette
Created February 12, 2015 00:13
Show Gist options
  • Select an option

  • Save chrisforrette/808bcce870837d21494e to your computer and use it in GitHub Desktop.

Select an option

Save chrisforrette/808bcce870837d21494e to your computer and use it in GitHub Desktop.

Revisions

  1. chrisforrette created this gist Feb 12, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    Modernizr.addTest('retina', function() {
    // starts with default value for modern browsers
    var dpr = window.devicePixelRatio ||

    // fallback for IE
    (window.screen.deviceXDPI / window.screen.logicalXDPI) ||

    // default value
    1;

    return !!(dpr > 1);
    });