Density Buckets for iOS, Android & Windows by Jeff Broderick

Indicates your screen's current density. It's actually quite easy to detect the pixel density with just a little CSS. By modifying the same @media query slightly we can get pretty accurate density control. For iOS and Mac devices it's pretty straight-forward. We have our normal CSS, but then override with retina (2x).