if (window.devicePixelRatio > 1) { /* highDPI display */ } if (window.devicePixelRatio >= 2) { /* retina display */ }