Scaling factor Ratio of screen pixels to CSS pixels on a single dimension height: 2px width: 2px CSS Standard (1x) Android ‘hdpi’ (1.5x) ‘Retina’/ ‘xhdpi’ (2x)
Hundreds of commercial typefaces Licensing + CDN hosting included Unlimited websites + 500,000 pageviews for $49/yr Also included with Adobe Creative Cloud membership
New free font service powered by Typekit technology Hundreds of free/open-source fonts, including Cooper Black No signup required Integrated into Edge Tools & Services Adobe Edge Web Fonts
Accessibility Generated content is invisible to search engines, but not to assistive devices Inbox Inbox This will be read by VoiceOver on iOS as: “Inbox Tray, Inbox.”
#selector { background-image: url(no-image-set.png); background-image: -webkit-image-set(url(myimage.jpg) 1x, url(myimage-hires.jpg) 2x); /* other prefixes for -moz, -o and -ms go here */ } Proposed image-set syntax Available today in Chrome, Safari 6, iOS 6
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and ( min--moz-device-pixel-ratio: 2), only screen and ( -o-min-device-pixel-ratio: 2/1), only screen and ( min-device-pixel-ratio: 2), only screen and ( min-resolution: 192dpi), only screen and ( min-resolution: 2dppx) { /* Retina-specific stuff here */ } It wouldn’t be CSS if there weren’t f$%&ing vendor prefixes
// Returns the scaling factor, e.g. 1.5 or 2 if((window.devicePixelRatio === undefined ? 1 » : window.devicePixelRatio) > 1) { document.cookie='HTTP_IS_RETINA=1;path=/'; } devicePixelRatio property Available in WebKit browsers + Opera Sets a cookie ‘HTTP_IS_RETINA’ if scaling factor > 1
Changes the src attribute of all tags inside a container Uses data attributes to track opt into replacement, track which images have been replaced Loads both 1x and 2x versions, with noticeable “flash of non-Retina content” Naïve JavaScript replacement on Apple.com
Use the most appropriate strategy for each kind of image Whenever possible, use CSS Try serving only one resolution Use Picturefill if true responsive images are needed