There are two simple things you can do to get your pages to work in both modes.
First, you set your viewport using the meta tag in the document head. This will give you a page width of 480 in landscape orientation and 320 in portrait. You can check what orientation you use when using CSS queries.
<meta name="viewport" content="width=device-width; initial-scale=1, maximum-scale=1">
Second, feed retina images for all of your images using the CSS background size property. Since your virtual page width is 320 pixels, each pixel is actually 2px by 2px on the retina screen. If you feed a 40x40 image in a 20x20 field, the retina displays will show it as it is, and images without a retina will reduce pixels.
.my-button { width: 20px; height: 20px; background-image: url(retina-images/my-button-40x40.png); -webkit-background-size: 20px 20px; background-size: 20px 20px; }
This should also work if you use an image tag:
<img src="retina-images/my-button-40x40.png" width="20" height="20">
Perhaps you could do more work to check the actual screen size and serve smaller images for a non-mesh crowd, but I don't think the benefits would be so dramatic.
Brian nickel
source share