<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cloud Four Blog</title>
	
	<link>http://blog.cloudfour.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 16 May 2012 00:47:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/cloudfour" /><feedburner:info uri="cloudfour" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>45.51379</geo:lat><geo:long>-122.645805</geo:long><image><link>http://www.cloudfour.com/blog/</link><url>http://www.cloudfour.com/wp-content/themes/cloudfour/images/logo_cloudfour.gif</url><title>Cloud Four</title></image><feedburner:emailServiceId>cloudfour</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>A framework for discussing responsive images solutions</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/d1Q7O4IRTLQ/</link>
		<comments>http://blog.cloudfour.com/a-framework-for-discussing-responsive-images-solutions/#comments</comments>
		<pubDate>Thu, 03 May 2012 21:24:43 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Mobile Web and Services]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2498</guid>
		<description><![CDATA[Over the last few weeks many more web developers and designers have become engaged in the conversation surrounding responsive images. On the whole, this is great news because the more people we have telling browser makers that this is a legitimate issue, the more likely it is to get addressed quickly. However, some of the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few weeks many more web developers and designers have become engaged in the conversation surrounding responsive images. On the whole, this is great news because the more people we have telling browser makers that this is a legitimate issue, the more likely it is to get addressed quickly.</p>
<p>However, some of the conversations about responsive images end up going in circles because people are talking past each other. I believe this is happening because we don’t have a common framework to look at the problem.</p>
<p>I believe there are two separate, but related issues that need to be solved regarding the use of the img element in responsive designs. They are:</p>
<h3 id="artdirection">1. How do we enable authors so that they can display different images under different conditions based on art direction?</h3>
<p>To understand this issue, it helps to look at a specific use case. Take for example the following <a href="http://www.flickr.com/photos/barackobamadotcom/5795228030/">photo of President Obama speaking at a Chrysler plant</a>.<sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup></p>
<p style="text-align:center"><img src="http://blog.cloudfour.com/wp-content/uploads/2012/05/obama-500.jpg" alt="Obama speaking at Chrysler plant" /></p>
<p>When the image is displayed at larger sizes, it makes sense for the image to show the automobile factory in the background. The background helps explain where the event took place and adds to the image. But look what happens when we scale the image down to fit a smaller screen.</p>
<p style="text-align:center;"><img src="http://blog.cloudfour.com/wp-content/uploads/2012/05/obama-100.jpg" alt="Obama speaking at Chrysler plant shrunk to 100 pixels wide. Obama himself is tiny in the picture at this size." /></p>
<p>At that size, you can barely recognize Obama. You can’t make out his face. Instead of simply resizing the image, it may make sense to crop the image to get rid of some of the background and focus in on him. The end result is an image that works better at the smaller size:</p>
<p style="text-align:center;"><img src="http://blog.cloudfour.com/wp-content/uploads/2012/05/obama-100-art.jpg" alt="Obama speaking at Chrysler plant shrunk to 100 pixels wide and cropped so Obama can be seen better." /></p>
<p>This is what I refer to as enabling art direction. Authors need to be able to provide different sources for images at different sizes not based on resolution or based on network speed, but based on the judgment of the designer for what is the best image at a particular breakpoint.</p>
<p>As an aside, showing photographs at different sizes to illustrate a point is more difficult when you’re dealing with flexible images in a responsive design. If those examples don’t make sense on your phone, I’m afraid you may have to look at it on a wider screen to see what I’m talking about! :-)</p>
<h3 id="resolution">2. Enabling authors to provide different resolutions of images based on a variety of conditions.</h3>
<p>When people talk about how to handle images for retina displays, they are talking about this second issue. The same is true of making decisions about the size of images based on bandwidth. All are dealing with how to deliver different resolutions based on conditions (pixel density, network speed, etc.).</p>
<p>Apple’s proposed addition to CSS4, <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/1103.html">image-set</a>, is designed to solve this issue in CSS. Authors define images at different densities and the browser picks the best one based on some criteria that could be as simple as pixel density or as complex as a combination of observed network speed, pixel density, and user preference. What the criteria is remains to be defined.</p>
<h3 id="picture">Where the &lt;picture&gt; element fits</h3>
<p>The <a href="http://www.w3.org/community/respimg/2012/03/15/polyfilling-picture-without-the-overhead/">proposed &lt;picture&gt; element</a> attempts to solve issue #1. It focuses on how to give authors the ability to specify different images, but doesn’t do anything about pixel density or bandwidth.</p>
<p>I’ve seen a lot of feedback on the &lt;picture&gt; element that says we should have a new type of image format to replace JPEG, PNG and GIF that would be resolution independent. That would be awesome. And it would solve issue #2, but it wouldn’t help with the art direction outlined in issue #1.</p>
<p>When we discuss various solutions, it behooves us to figure out which issue we’re trying to solve. We can also debate whether or not the two issues I outlined are legitimate or if there are other issues that aren’t addressed by them.</p>
<p>But in order to have a fruitful discussion about how to solve these issues, we need to be clear about which issues we’re talking about or we’ll end up wasting more time. What I often see in comment threads and on Twitter is two people debating different solutions for responsive images, both looking at different issues, and neither realizing that the other isn’t looking at the same problem.</p>
<p>My hope is that by defining these issues, we can stop spinning our wheels and have more successful discussions.</p>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">
<p>Photo of Obama licensed under Creative Commons. <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en">CC BY-NC-SA 2.0</a> by <a href="http://www.flickr.com/photos/barackobamadotcom/5795228030/">BarackObamaDotCom</a></p>
</li>
</ol>
</section>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=d1Q7O4IRTLQ:ZMIIw7e1C4o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=d1Q7O4IRTLQ:ZMIIw7e1C4o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=d1Q7O4IRTLQ:ZMIIw7e1C4o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=d1Q7O4IRTLQ:ZMIIw7e1C4o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=d1Q7O4IRTLQ:ZMIIw7e1C4o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=d1Q7O4IRTLQ:ZMIIw7e1C4o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=d1Q7O4IRTLQ:ZMIIw7e1C4o:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/d1Q7O4IRTLQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/a-framework-for-discussing-responsive-images-solutions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/a-framework-for-discussing-responsive-images-solutions/</feedburner:origLink></item>
		<item>
		<title>WebVisions Portland Coming Up Soon</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/4zgBGl1zbRU/</link>
		<comments>http://blog.cloudfour.com/webvisions-portland-coming-up-soon/#comments</comments>
		<pubDate>Thu, 03 May 2012 16:55:18 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Conferences & Speaking Engagements]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2490</guid>
		<description><![CDATA[Over the last few months, I’ve been proud to represent Portland as the WebVisions conference branched out into other cities. It’s been awesome to see “the little conference that could” find new communities eager to welcome it. Despite that fact, I’ll freely admit that I have a special affection for the Portland version of WebVisions. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.cloudfour.com/wp-content/uploads/2012/05/punchy.gif" style="float:right;border:none;" />Over the last few months, I’ve been proud to represent Portland as the <a href="http://www.webvisionsevent.com">WebVisions conference</a> branched out into other cities. It’s been awesome to see “the little conference that could” find new communities eager to welcome it.</p>
<p>Despite that fact, I’ll freely admit that I have a special affection for the <a href="http://www.webvisionsevent.com/portland/">Portland version of WebVisions</a>. It was the first conference I attend and the first one I spoke at. There are talks that I saw at WebVisions that still influence my work to this day.</p>
<p>This is the 12th year of the conference. The organizers bring in fantastic speakers and do so at a price that is much less expensive than what it costs to attend most other conferences. At my previous job, I would often take our entire team to WebVisions.</p>
<p>This year is no different. The conference starts on May 16th. Lyza and I will be giving a <a href="http://www.webvisionsevent.com/portland/workshop/mobile-devices-preparedness/?redir=L3BvcnRsYW5kL3dvcmtzaG9wcy8jNw==">workshop</a> showing desktop web developers how to convert their skills to mobile. I’m also giving a talk called <a href="http://www.webvisionsevent.com/portland/session/choose-your-mobile-adventure-y7v2/?redir=L3BvcnRsYW5kL3Nlc3Npb25zLyMxMg==">Casting Off Our Desktop Shackles</a>. We’d love to see you at both!</p>
<p>If you’re in the Portland area, I encourage you to attend WebVisions. I love the community around the event. And I like playing host to all of the smart people who travel to our city to attend or speak at WebVisions. If you do attend, please say hello.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=4zgBGl1zbRU:lUwWyUmhc_c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=4zgBGl1zbRU:lUwWyUmhc_c:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=4zgBGl1zbRU:lUwWyUmhc_c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=4zgBGl1zbRU:lUwWyUmhc_c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=4zgBGl1zbRU:lUwWyUmhc_c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=4zgBGl1zbRU:lUwWyUmhc_c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=4zgBGl1zbRU:lUwWyUmhc_c:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/4zgBGl1zbRU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/webvisions-portland-coming-up-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/webvisions-portland-coming-up-soon/</feedburner:origLink></item>
		<item>
		<title>Pixels are ruining my life</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/T_lyfiZwg5E/</link>
		<comments>http://blog.cloudfour.com/pixels-are-ruining-my-life/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 15:31:31 +0000</pubDate>
		<dc:creator>Lyza Gardner</dc:creator>
				<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[content first]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ems]]></category>
		<category><![CDATA[mobile first]]></category>
		<category><![CDATA[relative]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2474</guid>
		<description><![CDATA[It&#8217;s been a strange few years for the pixel, that unit we love to hate and generally blithely use anyway. First, there is the weird brain-bending device pixel versus CSS pixel math we&#8217;re all trying to do in our head since we started seeing a lot of high-density digital displays on the market. Then there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a strange few years for the pixel, that unit we love to hate and generally blithely use anyway.</p>
<p>First, there is the weird brain-bending device pixel versus CSS pixel math we&#8217;re all trying to do in our head since we started seeing a lot of high-density digital displays on the market.</p>
<p>Then there&#8217;s the whole schizophrenia in the standards worlds about what a pixel even is. Ask the <a href="http://www.w3.org/TR/css3-values/#absolute-lengths">W3C currently</a>, and you&#8217;ll get a wholly incomprehensible definition (kind of fun as a drinking game/party laugh) that in the end claims &quot;absolute unit.&quot; Ask the <a href="https://developer.mozilla.org/en/CSS-2_Quick_Reference/Units">Mozilla Developer Network</a>, and you&#8217;ll get a brief answer of &quot;relative.&quot;<sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup></p>
<blockquote>
<p>The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm&#8217;s length. For a nominal arm&#8217;s length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm&#8217;s length, 1px thus corresponds to about 0.26 mm (1/96 inch). —Excerpt from the <a href="http://www.w3.org/TR/css3-values/#absolute-lengths">W3C definition of a reference pixel</a></p>
</blockquote>
<p>And this all before we&#8217;ve even reached the lively world of viewports: layout viewports, visual viewports, viewport scales. And the different treatment by browsers of zooming—Webkit browsers don&#8217;t really scale pixel-based units after a zoom, Mozilla and Opera do. <a href="http://twitter.com/ppk">@ppk</a> may understand pixels<sup><a href="#fn2" class="footnoteRef" id="fnref2">2</a></sup>, but I think he may be superhuman.</p>
<p>So, pixels may be relative or absolute, big or small, device-specific or theoretical. Here&#8217;s the rub at this point: <strong>I don&#8217;t care</strong>.</p>
<h3 id="whats-a-pixel-i-dont-care">What&#8217;s a pixel? I don&#8217;t care</h3>
<p>When I wrote the post about <a href="http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/">The Ems Have it</a> (em-based media queries) a few weeks ago, I <em>was</em> mostly just focusing on the surgical problem of getting Webkit browsers to behave, when you get down to it. I spoke of practicalities: em-based media queries don&#8217;t break when you zoom.</p>
<p>But whether or not pixels ultimately <em>do</em> scale in Webkit browsers is beside the (deeper) point. If we&#8217;re staying true to a &quot;content first&quot; maxim, it follows, logically, that our media queries—as well as our layouts overall—might benefit by being subordinate to the content itself.</p>
<p>From my perspective, ems are more true to content.</p>
<p>For me, thinking in pixels for media queries ties me into some bad habits. I start thinking as if there is some 320 x 480px inviolable &quot;mobile smartphone&quot; reality that we can rely on. On the other hand, <code>30em</code> is a readable column width regardless of the surrounding pixel complexities.</p>
<p>We&#8217;re moving further into a world where content is king, and we know it needs to &quot;flow like water.&quot; The containers we build to hold it can likewise be based on the proportions of the content itself. Ideal line lengths, space to breathe around text—those are things most naturally derived by using units tied to the text itself. Ems.</p>
<p>The fact that baseline ems <em>tend</em> to be loosely tied to pixels, i.e.: <code>1em ~= 16px ~= 14pt</code> should help control freaks to unclench a bit. But, as I&#8217;ve been arguing for a while now, that control is illusory anyway. Your content has already broken free of its jail cell. You just might not know it yet.</p>
<p>In his talk at <a href="http://bdconf.com/2012/orlando">Breaking Development Orlando</a>, <a href="http://twitter.com/beep">Ethan Marcotte</a> (the Great Father of Responsive Web Design) mentioned his support for em-based media queries going forward. While he didn&#8217;t delve into the specifics of his reasoning, my hunch is that his motives are generally in line with this notion: content first.</p>
<p>So, I&#8217;ve done some of the convolutions. I&#8217;ve tried to understand exactly what a pixel is in a zoomed viewport on a pixel-dense device vis-a-vis its CSS-to-device pixel ratio. I&#8217;m done with that for now. Long live ems.</p>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">
<p><a href="http://reference.sitepoint.com/css/lengthunits">Sitepoint</a> also says relative. This may be an artifact of both MDN and Sitepoint referencing CSS2.1. <a href="http://fantasai.inkedblade.net/style/specs/css2.1/px-unit">This change doc</a> appears to represent the switch between relative (2.1) and fixed (3). I dunno. I can&#8217;t really make a whole lot of sense of it.<a href="#fnref1">↩</a></p>
</li>
<li id="fn2">
<p><a href="http://www.youtube.com/watch?v=4wscVOXjIzQ">PPK &quot;A Pixel is not a Pixel&quot;</a> (YouTube)<a href="#fnref2">↩</a></p>
</li>
</ol>
</section>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=T_lyfiZwg5E:2nuKz9UEVUU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=T_lyfiZwg5E:2nuKz9UEVUU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=T_lyfiZwg5E:2nuKz9UEVUU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=T_lyfiZwg5E:2nuKz9UEVUU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=T_lyfiZwg5E:2nuKz9UEVUU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=T_lyfiZwg5E:2nuKz9UEVUU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=T_lyfiZwg5E:2nuKz9UEVUU:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/T_lyfiZwg5E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/pixels-are-ruining-my-life/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/pixels-are-ruining-my-life/</feedburner:origLink></item>
		<item>
		<title>“The Mobile Omnivore”: A Webcast on O’Reilly</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/aPzGNagZNrc/</link>
		<comments>http://blog.cloudfour.com/the-mobile-omnivore-a-webcast-on-oreilly/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 19:19:05 +0000</pubDate>
		<dc:creator>Lyza Gardner</dc:creator>
				<category><![CDATA[Conferences & Speaking Engagements]]></category>
		<category><![CDATA[head first mobile web]]></category>
		<category><![CDATA[oreilly]]></category>
		<category><![CDATA[webcast]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2464</guid>
		<description><![CDATA[Tomorrow (Tuesday, April 3, 2012) at 10AM Pacific, Jason and I will be presenting &#8220;The Mobile Omnivore: A Taste Test of Mobile Website Development&#8221; on O&#8217;Reilly. The 60-minute webcast will include a 35-minute (ish) presentation, followed by audience Q&#38;A. Synposis The mobile web is a complex place. There are lots of ways to build a [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow (Tuesday, April 3, 2012) at 10AM Pacific, Jason and I will be presenting <strong>&#8220;<a href="http://oreillynet.com/pub/e/2201">The Mobile Omnivore</a>: A Taste Test of Mobile Website Development&#8221;</strong> on O&#8217;Reilly. The 60-minute webcast will include a 35-minute (ish) presentation, followed by audience Q&amp;A.</p>
<h3>Synposis</h3>
<p>The mobile web is a complex place. There are lots of ways to build a mobile website—how do you choose the right tool for the job?</p>
<p>In this webcast presentation, we touch on a series of technologies and techniques including:</p>
<ul>
<li>Responsive Web Design (RWD)</li>
<li>Mobile-first RWD</li>
<li>Server-side device detection</li>
<li>HTML5 and CSS3 on mobile</li>
<li>Device idiosyncrasies</li>
<li>Some of our favorite tools and tips for mobile development</li>
</ul>
<h4>Who is this webcast for?</h4>
<p>If you already have web development chops but want to go mobile, this is the talk for you! Familiarity with HTML and CSS is a must; comfort with some JavaScript is helpful.</p>
<h3>Register Now!</h3>
<p>The webcast is <strong>free</strong>. <a href="http://oreilly.com/go/mobile_omnivore">Register now</a>—we&#8217;ll see you there!</p>
<h4>Resource Links</h4>
<p>Here are some links to some of the topics and tools we talk about in our presentation.</p>
<ul>
<li>Ethan Marcotte&#8217;s original <a href="http://www.alistapart.com/articles/responsive-web-design/">article about Responsive Web Design</a> on<em> A List Apart</em></li>
<li>The <a href="http://bostonglobe.com">Boston Globe&#8217;s</a> new responsively-designed site</li>
<li>A few articles about using the Fluid Formula and creating fluid layouts: from <a href="http://jakebresnehan.com/2011/09/10/responsive-web-design-formula/">Jake Bresnehan</a> and <a href="http://www.studiopress.com/design/flexible-grid.htm">StudioPress</a></li>
<li>You can also read Ethan&#8217;s brief and comprehensive book: <em><a href="http://www.abookapart.com/products/responsive-web-design">Responsive Web Design</a></em></li>
<li>Our <a href="http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/">blog post about em-based media queries</a></li>
<li><a href="http://blaze.io/mobile">Blaze.io</a></li>
<li><a href="https://github.com/scottjehl/Respond">Respond.js</a> polyfill for media queries in IE</li>
<li><a href="http://wurfl.sourceforge.net/">WURFL</a> device database, service by <a href="http://www.scientiamobile.com/">ScientiaMobile</a></li>
<li><a href="http://deviceatlas.com/">DeviceAtlas</a> device detection service</li>
<li><a href="http://www.lukew.com/ff/entry.asp?1392">RESS</a> (Responsive Design + Server-side Components) post by Luke Wroblewski</li>
<li><a href="http://responsive.is">Responsive.is</a> for previewing responsive designs</li>
<li><a href="http://responsivepx.com/">ResponsivePX</a> for previewing responsive designs</li>
<li>Chrome extension: <a href="https://chrome.google.com/webstore/detail/kkelicaakdanhinjdeammmilcgefonfh">Window Resizer</a></li>
<li><a href="http://labs.adobe.com/downloads/shadow.html">Adobe Shadow</a> testing and preview tool</li>
<li><a href="http://futurefriend.ly">Future friendly</a></li>
<li>Our book: <em><a href="http://bit.ly/hf-mw">Head First Mobile Web</a></em> (O&#8217;Reilly)</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=aPzGNagZNrc:Z4CPJvA8TQ8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=aPzGNagZNrc:Z4CPJvA8TQ8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=aPzGNagZNrc:Z4CPJvA8TQ8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=aPzGNagZNrc:Z4CPJvA8TQ8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=aPzGNagZNrc:Z4CPJvA8TQ8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=aPzGNagZNrc:Z4CPJvA8TQ8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=aPzGNagZNrc:Z4CPJvA8TQ8:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/aPzGNagZNrc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/the-mobile-omnivore-a-webcast-on-oreilly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/the-mobile-omnivore-a-webcast-on-oreilly/</feedburner:origLink></item>
		<item>
		<title>The EMs have it: Proportional Media Queries FTW!</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/9PN5-wlKPbw/</link>
		<comments>http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 22:23:45 +0000</pubDate>
		<dc:creator>Lyza Gardner</dc:creator>
				<category><![CDATA[Cloud Four Stories]]></category>
		<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[fluid layouts]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[mobile web design]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2439</guid>
		<description><![CDATA[If we&#8217;re going to be proportional&#8230; A core tenet of Responsive Web Design (RWD) is fluidity and proportion. Instead of using fixed-width layouts, we enlightened web devs and designers use percentages in our CSS. Font units aren&#8217;t pixels or points anymore, they&#8217;re percentages (typically for top-level baseline reset) or, more often, ems. And yet the [...]]]></description>
			<content:encoded><![CDATA[<h3>If we&#8217;re going to be proportional&#8230;</h3>
<section class="level3" id="if-were-going-to-be-proportional...">A core tenet of Responsive Web Design (RWD) is fluidity and proportion. Instead of using fixed-width layouts, we enlightened web devs and designers use percentages in our CSS. Font units aren&#8217;t pixels or points anymore, they&#8217;re percentages (typically for top-level baseline reset) or, more often, ems. And yet the vast majority of us still write width-based media queries in pixels, e.g.:</p>
<pre><code>@media all and (min-width: 500px) {}</code></pre>
<pre><code>@media screen and (max-width: 800px) {}</code></pre>
<p>It&#8217;s a natural thought process: for windows or screens of particular width ranges, we want to flow our content in a particular way. This naturally seems like a pixel dimension. But, once again, to bring out my big hammer, what about when we look at things from a content perspective?</p>
<p>Folks who design for traditional reading media—where the content really is king—don&#8217;t center design decisions around the absolute width of content-holding elements so much as around the optimal <a href="http://www.maxdesign.com.au/articles/em/"><em>line lengths</em></a> for the content they&#8217;re flowing. There are some tried-and-true numbers one can shoot for that make for the &#8220;right&#8221; number of letters (and thus words) per line for comfortable human reading.</p>
<p>Thus actual column width is a function of font size and ems-per-line.</p>
</section>
<section class="level3" id="baseline-expectations">
<h3>Baseline expectations</h3>
<p>You may have seen the rule of thumb (useful, admittedly!) that makes the following general equation in terms of baseline font sizes in CSS:</p>
<pre><code>100% = 1 em ~= 16px ~= 14pt</code></pre>
<p>This means that, at your baseline, that is, before you&#8217;ve adjust font sizes in any child elements, the default font size in the browser is <em>usually</em> approximately 16px and <em>usually</em> approximately 14pt but always 100% and 1em.</p>
<p>If we start from a baseline of 16px, you may well wonder what the difference (beyond academic) is between a media query like:</p>
<pre><code>@media all and (min-width: 400px)</code></pre>
<p>and one like this, that uses ems multiplied against the 16px baseline approximation:</p>
<pre><code>@media all and (min-width: 25em)</code></pre>
</section>
<section class="level3" id="the-answer-my-friend-is-content">
<h3>The answer, my friend, is content</h3>
<p>Here&#8217;s the 64-dollar question or whatever:</p>
<blockquote><p>What happens when the baseline is <em>not</em> 14pt/16px?</p></blockquote>
<p>On Ye Olde Desktop Web, this situation most often comes about (&#8220;most often&#8221; is unscientific here, but I&#8217;m willing to toss out the hypothesis, at least) from user-intiated zoom in browsers. Low-sight users might do it, I know <em>I</em> do it when I&#8217;m surfing the web on my Mac Mini from the couch across the room. I&#8217;m not <em>that</em> old but, man, it&#8217;s hard to see the contents of a Wikipedia article on a 23&#8243; monitor from 10 feet away.</p>
<p>As I zoom in, that is, make the text larger in my browser, I&#8217;m no longer at a 14pt/16px baseline. 100%/1em in my world is now a different number, maybe 18pt, maybe 32px. Pixel-defined content holders no longer have comfortable amounts of words per line. Pixel-defined content holders that float might wrap awkwardly as the content in them swells.</p>
</section>
<section class="level3" id="case-study-our-nav">
<h3>Case study: Our nav</h3>
<p>Our creative director and CSS wizard extraordinaire, <strong>Aileen</strong>, whipped us up a beaut of a responsive new site layout. For various screen widths, our site&#8217;s nav has a few different behaviors.</p>
<p>In pixels at normal zoom, the nav elements fit in a line roughly at a width of around 656px. There&#8217;s generous room to detatch and float next to the logo at around 960px.</p>
<p>For screens/windows narrow enough that the full set of top-level nav elements would not fit on one line, we use the menu button nav pattern:</p>
<p>&nbsp;</p>
<p><img src="http://cloudfour.github.com/figures/ems/narrow-width.jpg" alt="For screens/windows narrow enough that the full set of top-level nav elements would not fit on one line, we use the menu button nav pattern." /></p>
<p>&nbsp;</p>
<figcaption>For screens/windows in a particular range that are wide enough to fit the top-level nav elements on a single line, we do that.</figcaption>
<p>&nbsp;</p>
<p><img src="http://cloudfour.github.com/figures/ems/medium-width.jpg" alt="For screens/windows in a particular range that are wide enough to fit the top-level nav elements on a single line, we do that." /></p>
<p>&nbsp;</p>
<figcaption>For screens/windows wide enough to fit all of the top-level nav elements horizontally <em>and</em> have enough room left over for our logo, we detatch and float the nav to the top right.</figcaption>
<p>&nbsp;</p>
<p><img src="http://cloudfour.github.com/figures/ems/desktop-width.jpg" alt="For screens/windows wide enough to fit all of the top-level nav elements horizontally and have enough room left over for our logo, we detatch and float the nav to the top right." /></p>
<section class="level4" id="but-what-happens-if-a-user-has-his-or-her-zoom-set-higher">
<h4>But what happens if a user has his or her zoom set higher?</h4>
<p>I&#8217;ll show you a little experiment. I&#8217;m using the Chrome browser, and I&#8217;m viewing our site with a window about 670 pixels wide. With a pixel-based media query, that puts me in the second category of nav experience: all of the top level items are shown horizontally, docked to the top of the content:</p>
<p>&nbsp;</p>
<figure> <img src="http://cloudfour.github.com/figures/ems/medium-width.jpg" alt="" /></figure>
<p>&nbsp;</p>
<p>OK, now I&#8217;m going to use the <code>Zoom In</code> command twice to make my text larger.</p>
<p>With a pixel-based media query:</p>
<p>&nbsp;</p>
<figure> <img src="http://cloudfour.github.com/figures/ems/medium-borken.jpg" alt="" /> </figure>
<p>&nbsp;</p>
<p>With an em-based media query:</p>
<p>&nbsp;</p>
<figure> <img src="http://cloudfour.github.com/figures/ems/medium-ems.jpg" alt="" /></figure>
<p>&nbsp;</p>
<p>Why did this happen?</p>
<p>The pixel-based media query <code>@media all and (min-width:656px)</code> still evaluates to true with the zoomed-in text and therefore creates awkwardly-wrapped nav elements.</p>
<p>However, the em-based media query of <code>@media all and (min-width: 41em)</code> scales to the larger text size. Zoomed in like this, the browser no longer satisfies that query: we have fewer than 41ems to work with. So we deliver the menu-button nav pattern and other layout and styling appropriate for the way the text fits. Content, again, is what ends up dictating what we&#8217;re doing in the end.</p>
<p>You could also make the text smaller and watch the same proportional adjustments occur, in the inverse.</p>
<p><em>BTW:</em> It should be noted that, unlike window resizes, which cause media queries to be re-evaluated immediately, you&#8217;ll need to reload the current page if you zoom in or out for em-based media queries to re-apply. My hunch is that most users who zoom a lot keep their zoom set as they navigate around different pages and aren&#8217;t changing zoom settings on a site-by-site basis. I could be wrong about that, though.</p>
</section>
</section>
<section class="level3" id="the-specifics-of-em-based-media-queries">
<h3>The specifics of em-based media queries</h3>
<p>The media queries on our site are all crafted based on the approximate baseline. We played with our browser window widths, adjusting them until it looked like they were at the appropriate width to create a breakpoint at normal text zoom. We noted that pixel measurement and divided it by the rough baseline of 16px to arrive at our em units. There may well be a better way to do this math, but this seems to do the trick so far.</p>
</section>
<section class="level3" id="a-device-specific-aside">
<h3>A device-specific aside</h3>
<p>One of the things that spurred me toward thinking about em-based media queries was my own Kindle Touch. Through no action of my own, the Kindle browser&#8217;s default text zoom is, roughly put, <em>high</em>. Like newer smartphones, the Kindle has a high pixel density, 167ppi. An absolute-sized font (say, 16px) on a high-density screen is correspondingly tiny. Most smartphone browsers get around this by reporting their resolution differently for purposes of the web. An iPhone 4, for example, which has a real resolution of 640&#215;960 and 326ppi, masquerades as 320&#215;480 in the browser as a way to get normally-designed websites to look normally-sized and not teeny tiny. For the iPhone, 1em is still approximately 16px or 14pt, and so pixel-based media queries generally behave equivalently to em-based ones (disclaimer: that&#8217;s a broad generalization).</p>
<p>The Kindle Touch, on the other hand, has taken a different approach. It reports its web pixel resolution as 600&#215;800, but its default text size is considerably larger than 16px/14pt.</p>
<p>Our early, pixel-based media queries for our nav looked dreadful on the Kindle. Its resolution meant that it was using our tablet-range layout, but its text was enormous, causing widespread ugliness as the pixel-width elements didn&#8217;t scale to adjust. The site looks pretty decent, however, with media queries in ems:</p>
<p>&nbsp;</p>
<figure> <img src="http://cloudfour.github.com/figures/ems/kindle.jpg" alt="Our site looks tolerable on a Kindle Touch. That's about as good as it's going to get on that browser." /></p>
<figcaption>Our site looks tolerable on a Kindle Touch. That&#8217;s about as good as it&#8217;s going to get on that browser. </figcaption>
</figure>
<p>&nbsp;</p>
<p>Sadly, I did find that, as reported by <a href="http://twitter.com/stephanierieger">Stephanie</a> and <a href="http://twitter.com/bryanrieger">Bryan</a> Rieger, the Kindle considers itself to be in color, so the media query <code>@media all and (monochrome)</code> doesn&#8217;t match it and <code>@media all and (color)</code> <em>does.</em> Too bad! Speaking of Kindle and Stephanie Rieger, the Kindle Fire tablet&#8217;s browser is also a great cautionary tale about mistaken complacence about &#8220;standard&#8221; device screen widths like 480, here is an enlightening <a href="https://twitter.com/#!/stephanierieger/statuses/139745699435778048">tweet</a>:</p>
<p>&nbsp;</p>
<figure> <img src="http://cloudfour.github.com/figures/ems/stephanie-rieger-tweet.jpg" alt="" /></p>
<figcaption></figcaption>
</figure>
<p>&nbsp;</p>
<p>Food for thought, Stephanie, food for thought&#8230;</p>
<p>p.s. Thanks to the observant folks in the community who have noticed that our nav, at wider widths, has drop-down elements that are not ideal in terms of usability. We<del>&#8216;re cooking up ideas about how to make this better!</del> have actually made improvements to the tablet-version nav on touch devices since I started working on this post! More to come in Nav-Land.</p>
</section>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=9PN5-wlKPbw:M2QMWbWyrDE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=9PN5-wlKPbw:M2QMWbWyrDE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=9PN5-wlKPbw:M2QMWbWyrDE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=9PN5-wlKPbw:M2QMWbWyrDE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=9PN5-wlKPbw:M2QMWbWyrDE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=9PN5-wlKPbw:M2QMWbWyrDE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=9PN5-wlKPbw:M2QMWbWyrDE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/9PN5-wlKPbw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/</feedburner:origLink></item>
		<item>
		<title>Taking “Content First” Very Seriously</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/ojKf8A8M-ds/</link>
		<comments>http://blog.cloudfour.com/taking-content-first-very-seriously/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 17:21:10 +0000</pubDate>
		<dc:creator>Lyza Gardner</dc:creator>
				<category><![CDATA[Cloud Four Stories]]></category>
		<category><![CDATA[Emerging Technology]]></category>
		<category><![CDATA[cloudfour.com]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[content first]]></category>
		<category><![CDATA[responsive web design]]></category>

		<guid isPermaLink="false">http://blog.cloudfour.com/?p=2424</guid>
		<description><![CDATA[The new www.cloudfour.com site stretches content-first thinking to its academic extremes Whereas my personal theme for the second half of 2011 was about letting content go, 2012 seems to be the year I obsess about content: what is content, what does it mean, and what does it look like? How do we go about untangling [...]]]></description>
			<content:encoded><![CDATA[<h3 id="the-new-www.cloudfour.com-site-stretches-content-first-thinking-to-its-academic-extremes">The new www.cloudfour.com site stretches content-first thinking to its academic extremes</h3>
<p>Whereas my personal theme for the second half of 2011 was about <a href="http://www.slideshare.net/lyzadanger/crap-it-doesnt-look-quite-right-or-how-i-learned-to-stop-worrying-and-set-my-mobile-web-sites-free-9518337">letting content go</a>, 2012 seems to be the year I <a href="http://5by5.tv/webahead/20">obsess about content</a>: what is content, what does it mean, and what does it look like? How do we go about untangling the CMS mess we&#8217;ve built over the last decade-and-a-half? How should content be marked up? Stored? Transformed? Delivered to devices and clients?</p>
<p>With the new <a href="http://www.cloudfour.com">Cloudfour.com</a> site, we got a chance to Think Very Deeply about content and our mobile experience. We got to explore some of the nagging questions that keep us (well, me, at least) up at night. I&#8217;m not going to profess to have the answer, nor am I going to assert that the (long) thinking, designing and development process we endured was without convulsions or struggle<sup><a id="fnref1" class="footnoteRef" href="#fn1">1</a></sup>. But I think we&#8217;ve been lucky in the opportunity to dig in.</p>
<h3 id="content-is-content-is-content-is-content...">Content is content is content is content&#8230;</h3>
<p>At its core, <a href="http://www.cloudfour.com">www.cloudfour.com</a> is content. Human-readable content written by regular people. Being bold and brave (maybe it&#8217;s hubris), we started with content before any design happened.</p>
<p>We&#8217;re not, by far, the first to shout, &#8220;<em>Hey, Content First!</em>&#8221; That notion&#8217;s been around the block a few times. But the practical challenge lies in unmooring oneself from 15 years of executing web development and design in <em>particular ways</em> and trying new habits and processes on for size. What sounds straightforward—have a point <em>first</em> and <em>then</em> make it pretty—actually goes against a staggering amount of what we&#8217;ve become used to doing with our web projects.</p>
<p>In our case, we opted for writing and storing our content in static text files. We selected markdown for this project, specifically, pandoc-extended markdown with Cloud Four-specific post processing extensions. Phew. More on that sometime other than now. Important piece being: human-readable text in a loose but meaningful format.</p>
<h3 id="what-a-transformation">What a transformation!</h3>
<p>Our happy, respected content sits there on the filesystem, grinning mysteriously, versioned, simple, ready to serve whatever purpose it needs to serve. In our case, obviously, we want a web site, so we can <em>transform</em> that core content into a set of web pages to make up a site that works in web browsers.</p>
<p>You&#8217;ll note that a lot of this sounds like, um, duh, yeah, we&#8217;re web devs, we make web sites. But in peeling back and thinking this hard about content, web pages as HTML isn&#8217;t necessarily a given for every context that we might use this content. But let&#8217;s talk about web pages for our purposes today.</p>
<p>Our content is transformed using a somewhat magical tool called <strong>pandoc</strong><sup><a id="fnref2" class="footnoteRef" href="#fn2">2</a></sup>, which processes it, plunks it in an HTML template and does some other miscellaneous things—out come HTML pages! These HTML pages are then pushed to the live server environment where they enjoy a performance-tuned, simple existence, just waiting for folks to look at them and enjoy their content.</p>
<p>Though the content <em>changes</em> from time to time—it&#8217;s versioned in a github repository—it isn&#8217;t actually <em>dynamic</em>, so serving it out of a database (here I am getting a bit pedantic again) provides more of a performance-maintenance drain than a boon. Or at least, that&#8217;s what I tell myself to feel awesome.</p>
<h3 id="but-what-about-the-blog-aint-broke-dont-fix">But what about the blog? Ain&#8217;t broke, don&#8217;t fix</h3>
<p>As giddy as the simplicity of static content and transformations and a <em>pure ultra magical shared philosophical language of core content</em> makes me as a dev, I have to kneel to practicality and <em>things that make sense</em> sometimes.</p>
<p>WordPress is a blogging framework. It&#8217;s been around a long while, we&#8217;ve used it a long while, and it has the tools for, well, you know, <em>blogging.</em> We&#8217;re sticking with WordPress for our blog, though you may notice that our blog now lives a robustly independent existence as blog.cloudfour.com. Heck, maybe I&#8217;ll get the exciting opportunity to futz around with partially-static WordPress options with John!</p>
<h3 id="theres-a-lot-more-to-talk-about">There&#8217;s a lot more to talk about</h3>
<p>The site is intensely responsive. It uses some edgy CSS selectors to get its job done semantically. The process of separating content from presentation can be deeply, deeply hard and we have stuff to say about that. We&#8217;ve spent a lot of time optimizing performance. We&#8217;ve battled specific bugs (many we knew about, some we didn&#8217;t) to get the site to look reasonably decent across a lot of devices. We are doing unprecedented things with <code>:before</code> pseudo elements. Our media queries are in ems.</p>
<p><strong>We&#8217;ll continue to talk about the specific cool stuff we experimented with to get the new site working</strong> in upcoming posts. But I wanted to give a quick, high-level look at what we did before getting lost in the details.</p>
<h3 id="here-is-a-nice-picture">Here is a nice picture</h3>
<p> <img src="http://cloudfour.github.com/figures/pandoc-cloudfour-dot-com.png" alt="" /></p>
<ol type="1">
<li>Static content pages and image content, managed in a github repository.</li>
<li>Pandoc and other transformation processing.</li>
<li>Layout, design and behavior resources shared between static web and our blog.</li>
<li>Blog content stored in WP database.</li>
</ol>
<h3 id="thank-you-cloud-four-team">Thank you, Cloud Four Team</h3>
<p>I owe a great amount of gratitude to the brilliant team at Cloud Four. Thinking the new site through and building it wasn&#8217;t always easy, fun or even sane. We had to (uncomfortably) learn new ways to do things that we were <em>quite competent at before thankyouverymuch</em>. There were confounding moments. It took John 327 hours or whatever to get Haskell compiled<sup><a id="fnref3" class="footnoteRef" href="#fn3">3</a></sup> on our shared development server so we could run pandoc. And Aileen endured my weird experiments with SASS.</p>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">Sometimes there was downright silliness as I pushed to explore the pedantic edges of what we could pull off with <em>just content</em><a href="#fnref1">↩</a></li>
<li id="fn2">Not <em>actually</em> magic, but written in Haskell, which is kind of the same thing to my inadequate brain. <a href="http://johnmacfarlane.net/pandoc">More about pandoc here.</a><a href="#fnref2">↩</a></li>
<li id="fn3">Not actually true. But it did take John quite some time—it was hard! So, thank you, John.<a href="#fnref3">↩</a></li>
</ol>
</section>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=ojKf8A8M-ds:nzUN-8QiswI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=ojKf8A8M-ds:nzUN-8QiswI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=ojKf8A8M-ds:nzUN-8QiswI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=ojKf8A8M-ds:nzUN-8QiswI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=ojKf8A8M-ds:nzUN-8QiswI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=ojKf8A8M-ds:nzUN-8QiswI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=ojKf8A8M-ds:nzUN-8QiswI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/ojKf8A8M-ds" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/taking-content-first-very-seriously/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/taking-content-first-very-seriously/</feedburner:origLink></item>
		<item>
		<title>The Best Mobile Web Conferences are Coming Soon</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/cIDCFoyuWvE/</link>
		<comments>http://blog.cloudfour.com/the-best-mobile-web-conferences-are-coming-soon/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 00:55:35 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Mobile Web and Services]]></category>

		<guid isPermaLink="false">http://cloudfour.com/?p=2420</guid>
		<description><![CDATA[In the coming two months, Lyza and I are honored to be giving workshops and speaking at what we consider to be the two best conferences about the mobile web: Mobilism and the Breaking Development conferences. You should join us. Here’s what you need to know. Live in Europe or need a vacation? Attend Mobilism [...]]]></description>
			<content:encoded><![CDATA[<p>In the coming two months, Lyza and I are honored to be giving workshops and speaking at what we consider to be the two best conferences about the mobile web: <a href="http://mobilism.nl">Mobilism</a> and the <a href="http://bdconf.com">Breaking Development</a> conferences. You should join us.</p>
<p>Here’s what you need to know.</p>
<h3>Live in Europe or need a vacation? Attend Mobilism</h3>
<p>You must attend <a href="http://mobilism.nl">Mobilism</a> on May 10-11. We can’t speak highly enough of this conference.</p>
<ul>
<li>This is the only conference in Europe focused on mobile web technology.</li>
<li>The <a href="http://mobilism.nl/2012/programme">speaker’s list is fantastic</a>. Lyza went last year and vouches for how awesome the conference is.
<li>Lyza will be giving a talk entitled: <a href="http://mobilism.nl/2012/programme#lyza-danger-gardner">Cutting through the crap: The essence of content on the future web</a></li>
<li>I’m going to giving a talk called <a href="http://mobilism.nl/2012/programme#jason-grigsby">The Immobile Web</a> which will focus on the upcoming explosion of smart TVs.</li>
</ul>
<p>Seriously, <a href="http://mobilism.paydro.net/">register now</a>. If you can’t attend, please pass on the word. This is a great conference, but they need your help making sure enough people attend so they can continue to put on this event..</p>
<h4>Discount!!! EXPIRES SOON.</h4>
<p>You can get 10% discount on the ticket price by going to a <a href="https://mobilism.paydro.net/event/amobilism-2012/JasonGrigsby">special registration page</a>. This offer <strong>expires March 31st</strong>.</p>
<h4>Attend Our Workshop</h4>
<p>Lyza and I are also giving a workshop in Amsterdam. Here is a short description:</p>
<blockquote><p>
<strong>How to get from here to everywhere: Taking your web skills mobile</strong></p>
<p>OK. You already know how to wield HTML and CSS, and maybe you can juggle JavaScript and server-side technologies, too. What you need to know is how to take your existing web skills mobile—quickly.</p>
<p>Lyza Gardner and Jason Grigsby, co-authors of &#8220;Head First Mobile Web&#8221; (O&#8217;Reilly), will show you the leading strategies for making web sites mobile friendly, whether you&#8217;re adapting existing sites or building new ones from scratch. There is no silver bullet. But in this hands-on workshop, we&#8217;ll show you the tools that make up the mobile web designer and developer arsenal—and how to choose which tactics to use for different projects.
</p></blockquote>
<p>This is a great opportunity for you or someone on your team to learn how to build things for the mobile web. It is a day-long immersion in the tools and techniques required to deal with device diversity. <strong>Seats are limited to please <a href="http://mobilism.paydro.net/">register soon</a></strong>.</p>
<h3>In the States? Attend Breaking Development</h3>
<p>Come join us at the Breaking Development conference in Orlando on April 16-18. I’ve written in the past about <a href="http://cloudfour.com/breaking-development-conference-mobile-web-awesomeness/">how much we love this conference</a>. We love it so much that <a href="http://cloudfour.com/join-cloudfour-at-bdconf/">we sent the entire company to the last Breaking Development conference</a>.</p>
<p>Here are the highlights of why you should join us:</p>
<ul>
<li>This is the only conference in the United States focused on mobile web technology.</li>
<li>Like Mobilism, <a href="http://2012.bdconf.com/speakers">the speakers list is fantastic</a>.</li>
<li>Everyone at the conference is interested in mobile web. The conversations continue into the evening. You leave the conference buzzing with ideas.</li>
<li>I’m presenting on Smart TVs again with my <a href="http://mobilism.nl/2012/programme#jason-grigsby">The Immobile Web</a> talk.</li>
<li>People are guaranteed to make fun of me. I’m sure this will happen at Mobilism as well, but the Breaking Development organizers have refined it to an art form. :-)</li>
</ul>
<p>I don’t know what else to say. <a href="https://register.bdconf.com/">Register soon</a>.</p>
<h4>Discount!!! Limited to the first 10 people.</h4>
<p>The first ten people to use discount code &#8216;ORGRI12&#8242; will save $100 on their registration.</p>
<h3>Attend our workshop</h3>
<p>There is ONE and ONLY ONE seat left in the workshop that Lyza and I will be giving in Orlando. The workshop is called <a href="http://2012.bdconf.com/workshops#grigs">Zombie Apocalypse Preparedness 101</a>. It teaches you the survival skills you need to survive the <a href="http://designmind.frogdesign.com/blog/the-coming-zombie-apocalypse-small-cheap-devices-will-disrupt-our-old-school-ux-assumptions.htm">upcoming zombie apocalypse of devices</a>. <a href="https://register.bdconf.com/">Register ASAP before the final seat is taken</a>.</p>
<h2>Support these conferences</h2>
<p>If you care about the topics that we cover on this blog, then you need to support these two conferences. They are the only conferences focused exclusively on the challenges of building things for mobile devices.</p>
<p>Conference like this run on thin margins. I know the organizers of both conferences would like to make money, but are primarily motivated by helping our community get off the ground. If we want the conferences to continue, we have to support them.</p>
<p>Even if you cannot attend the conference, please pass the information on to your co-workers and friends. Tweet about it. Share on Facebook. Do whatever you can to help them out.</p>
<p>I would consider it a big favor if you would do so. Thanks in advance.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=cIDCFoyuWvE:hHCY66VGOrE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=cIDCFoyuWvE:hHCY66VGOrE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=cIDCFoyuWvE:hHCY66VGOrE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=cIDCFoyuWvE:hHCY66VGOrE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=cIDCFoyuWvE:hHCY66VGOrE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=cIDCFoyuWvE:hHCY66VGOrE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=cIDCFoyuWvE:hHCY66VGOrE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/cIDCFoyuWvE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/the-best-mobile-web-conferences-are-coming-soon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/the-best-mobile-web-conferences-are-coming-soon/</feedburner:origLink></item>
		<item>
		<title>First thing you should do to optimize your desktop site for mobile</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/dnlCJnPSSpY/</link>
		<comments>http://blog.cloudfour.com/first-thing-you-should-do-to-optimize-your-desktop-site-for-mobile/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 19:50:30 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cloudfour.com/?p=2409</guid>
		<description><![CDATA[Bruce Lawson has great post today called What Users Want from Mobile, and what we can re-learn from them. I highly recommend reading it. Bruce quotes from a survey of mobile web users and pulls out a few highlights including a huge demand by users for performance. Bruce writes: This tells us that speed is [...]]]></description>
			<content:encoded><![CDATA[<p>Bruce Lawson has great post today called <a href="http://www.brucelawson.co.uk/2012/what-users-want-from-mobile-and-what-we-can-re-learn-from-them/">What Users Want from Mobile, and what we can re-learn from them</a>. I highly recommend reading it.</p>
<p>Bruce quotes from a survey of mobile web users and pulls out a few highlights including a huge demand by users for performance. Bruce writes:</p>
<blockquote><p>
This tells us that speed is more important than aesthetics. So perhaps some of the time and effort put into media queries, viewports, avoiding scrolling, line length would actually be better employed reducing HTTP requests and optimising so that websites are perceived to render faster.
</p></blockquote>
<p>Exactly.</p>
<p>This echoes something <a href="http://twitter.com/brad_frost">Brad Frost</a> and I were talking about the last time I was in New York.</p>
<p>If you could only do one thing to prepare your desktop site for mobile and had to choose between employing media queries to make it look good on a mobile device or optimizing the site for performance, you would be better served by making the desktop site blazingly fast.</p>
<p>Most mobile browsers are pretty good about providing tools to help someone utilize a design meant for desktop on a small screen. People can double-tap or pinch and zoom to see and read the content.</p>
<p>But if your site is a bloated mess, there is nothing people can do about it. There is no magical gesture that people can invoke to make something load faster if the developer hasn’t built the site for speed in the first place.</p>
<p>The only gesture they are likely to use involves a single, upright finger as they ditch your site for one that responds to their requests in a timely fashion.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=dnlCJnPSSpY:T6X-u5gOil4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=dnlCJnPSSpY:T6X-u5gOil4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=dnlCJnPSSpY:T6X-u5gOil4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=dnlCJnPSSpY:T6X-u5gOil4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=dnlCJnPSSpY:T6X-u5gOil4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=dnlCJnPSSpY:T6X-u5gOil4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=dnlCJnPSSpY:T6X-u5gOil4:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/dnlCJnPSSpY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/first-thing-you-should-do-to-optimize-your-desktop-site-for-mobile/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/first-thing-you-should-do-to-optimize-your-desktop-site-for-mobile/</feedburner:origLink></item>
		<item>
		<title>How Apple.com will serve retina images to new iPads</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/64eJShfzd04/</link>
		<comments>http://blog.cloudfour.com/how-apple-com-will-serve-retina-images-to-new-ipads/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 21:59:42 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Mobile Web and Services]]></category>

		<guid isPermaLink="false">http://cloudfour.com/?p=2387</guid>
		<description><![CDATA[One of the more interesting questions raised by the new iPad and its retina display is whether or not web sites should deliver higher resolution images when there is no way to know the connection speed. AppleInsider found that Apple.com is being prepped to deliver high-res images and documented how you can test it in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more interesting questions raised by the new iPad and its retina display is whether or not web sites should deliver higher resolution images when there is no way to know the connection speed. AppleInsider found that <a href="http://www.appleinsider.com/articles/12/03/13/applecom_upgrading_to_high_resolution_images_ahead_of_retina_ipad_launch.html">Apple.com is being prepped to deliver high-res images</a> and documented <a href="http://www.appleinsider.com/articles/12/03/13/how_to_preview_the_retina_display_enhanced_applecom_in_safari_on_mac_or_pc.html">how you can test it in Safari on your desktop</a>.</p>
<p>As you can imagine given my <a href="http://cloudfour.com/responsive-imgs-part-2/">research on responsive images</a>, I was keenly interested to see what approach Apple took.</p>
<p>What they’ve chose to do is load the regular images for the site and then if the device requesting the page is a new iPad with the retina display, they use javascript to replace the image with a high-res version of it.</p>
<p>The heavy lifting for the image replacement is being done by <a href="http://images.apple.com/v/ipad/a/scripts/image_replacer.js">image_replacer.js</a>. <a href="https://twitter.com/froots101/status/179613928064679936">Jim Newberry</a> prettified the code and placed it in a <a href="https://gist.github.com/2029936">gist</a> for easier reading.</p>
<p>The code works similarly to <a href="https://github.com/filamentgroup/Responsive-Images">responsive images</a> in that data attributes are added to the markup to indicate what images should be replaced with high-res versions:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;article id=&quot;billboard&quot; class=&quot;selfclear&quot; data-hires=&quot;true&quot;&gt;
  &lt;a id=&quot;hero&quot; class=&quot;block&quot; href=&quot;/ipad/&quot;&gt;
    &lt;hgroup&gt;
      &lt;h1&gt;
        &lt;img src=&quot;http://images.apple.com/home/images/ipad_title.png&quot; alt=&quot;Resolutionary&quot; width=&quot;471&quot; height=&quot;93&quot; class=&quot;center&quot; /&gt;
      &lt;/h1&gt;
      &lt;h2&gt;
        &lt;img src=&quot;http://images.apple.com/home/images/ipad_subtitle.png&quot; alt=&quot;The new iPad.&quot; width=&quot;471&quot; height=&quot;54&quot; class=&quot;center&quot; /&gt;
      &lt;/h2&gt;
     &lt;/hgroup&gt;
     &lt;img src=&quot;http://images.apple.com/home/images/ipad_hero.jpg&quot; alt=&quot;&quot; width=&quot;1454&quot; height=&quot;605&quot; class=&quot;hero-image&quot; /&gt; 
  &lt;/a&gt;
&lt;/article&gt;</pre></td></tr></table></div>

<p>Unlike most of the solutions I reviewed last summer, Apple is applying the data-hires attribute to the parent container instead of to the images to themselves. Also, the images borrow from native iOS development and have consistent sizes. So the high-res version of ‘ipad_title.png’ can be found at ‘ipad_title_2x.png’.</p>
<p>As far as I can tell, there is no attempt to prevent duplicate downloads of images. New iPad users are going to download both a full desktop size image and a retina version as well.</p>
<p>The price for both images is fairly steep. For example, the <a href="http://images.apple.com/home/images/ipad_hero.jpg">iPad hero image</a> on the home page is 110.71K at standard resolution. The retina version is 351.74K. The new iPad will download both for a payload of 462.45K for the hero image alone.</p>
<p>The total size of the page goes from 502.90K to 2.13MB when the retina versions of images are downloaded.</p>
<p>Another interesting part of image_replacer.js is that it checks for the existence of 2x images before downloading them:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">    requestHeaders<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> a._headers <span style="color: #339933;">===</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> b <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
            src <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hiResSrc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">/^</span>http<span style="color: #339933;">:</span><span style="color: #006600; font-style: italic;">//.*.apple.com//, &quot;/&quot;);</span>
            b.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;HEAD&quot;</span><span style="color: #339933;">,</span> src<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            b.<span style="color: #660066;">onreadystatechange</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>b.<span style="color: #660066;">readyState</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>b.<span style="color: #000066;">status</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        a._exists <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> f <span style="color: #339933;">=</span> b.<span style="color: #660066;">getAllResponseHeaders</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        a._headers <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
                            src<span style="color: #339933;">:</span> src
                        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> d<span style="color: #339933;">,</span> e<span style="color: #339933;">;</span>
                        f <span style="color: #339933;">=</span> f.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>d <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
                        d <span style="color: #339933;">&lt;</span> f.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> d<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            e <span style="color: #339933;">=</span> f<span style="color: #009900;">&#91;</span>d<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                                a._headers<span style="color: #009900;">&#91;</span>e<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;n&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> e<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        a._exists <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                        a._headers <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> c <span style="color: #339933;">===</span> <span style="color: #3366CC;">&quot;function&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        c<span style="color: #009900;">&#40;</span>a._headers<span style="color: #339933;">,</span> a<span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            b.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            c<span style="color: #009900;">&#40;</span>a._headers<span style="color: #339933;">,</span> a<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>This is probably necessary as they move to providing two sets of assets in case someone forgets to provide the retina image. It prevents broken images. Unfortunately, it means that there are now three http requests for each assets: a GET request for the standard image, a HEAD request to verify the existence of the retina image, and a GET request to retrieve the retina image.</p>
<p style="text-align:center"><img src="http://blog.cloudfour.com/wp-content/uploads/2012/03/hero-http-requests.png" alt="Web Inspector timeline showing additional HEAD request for 2x image" /></p>
<p>Another interesting bit of image_replacer.js is when they decide to go retrieve the double-size image:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>26
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">debug</span> <span style="color: #339933;">!==</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> AC.<span style="color: #660066;">Detector</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">&amp;&amp;</span> AC.<span style="color: #660066;">Detector</span>.<span style="color: #660066;">isMobile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>AC.<span style="color: #660066;">ImageReplacer</span>.<span style="color: #660066;">devicePixelRatio</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>Of particular interest is the test for <code>AC.Detector.isMobile()</code>. This is defined in a separate script called <a href="http://images.apple.com/global/scripts/browserdetect.js">browserdetect.js</a> (<a href="https://gist.github.com/2029964">prettified gist version</a>).</p>
<p>The browserdetect.js is full of user agent string parsing looking for things like operating systems and even versions of OS X. The <code>isMobile()</code> function does the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>166
167
168
169
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">isMobile<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> c <span style="color: #339933;">||</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getAgent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">isWebKit</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>d.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/Mobile/i</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">isiPad</span><span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>Basically, is this a WebKit browser, does the user agent mention mobile, and let’s make sure it isn’t an iPad. Browsers not using WebKit need not apply.</p>
<h3>Testing for yourself</h3>
<p>AppleInsider’s instructions on <a href="http://www.appleinsider.com/articles/12/03/13/how_to_preview_the_retina_display_enhanced_applecom_in_safari_on_mac_or_pc.html">how to test the retina version of Apple.com on your computer</a> are very easy. Open Apple.com in Safari. Go to the console in the Web Inspector and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">AC.<span style="color: #660066;">ImageReplacer</span>._devicePixelRatio <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span>
<span style="color: #003366; font-weight: bold;">new</span> AC.<span style="color: #660066;">ImageReplacer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>You’ll get back a <code>klass</code> object as shown below.</p>
<p style="text-align:center"><img src="http://blog.cloudfour.com/wp-content/uploads/2012/03/apple-console.png" alt="Console screenshot" /></p>
<p>As an aside, notice SVG references in the console screenshot.</p>
<h3>What can we learn from this?</h3>
<p>Probably not a whole lot for a typical site because our goals will be different than Apple’s.</p>
<p>For Apple, it probably makes more sense to show off how wonderful the screen is regardless of the extra time and bandwidth required to deliver the high-resolution version. For everyone else, the balance between performance and resolution will be more pressing.</p>
<p>There are a few minor things that we can take away though:</p>
<ul>
<li>Planning ahead and knowing that you can depend on high-res images being available would be preferable to making extra HEAD requests to check to see if the images exist.</li>
<li>Setting priority on which images to replace first is a good idea. This is something to look at and borrow from image_replacer.js.</li>
<li>The retina version of Apple.com’s home page is four times the standard home page. Delivering retina images should be considered carefully.</li>
</ul>
<p>Perhaps most importantly, Apple isn’t sitting on some secret technique to make retina images work well. Maybe they will provide better solutions in iOS 6. The way they handle images—downloading both sizes plus an additional HEAD request—may be the least efficient way to support retina displays. But for Apple, it likely doesn’t matter as much as it will for your site.</p>
<p>Hat tip to <a href="https://twitter.com/nstop">Jen Matson</a> for pointing me to the original AppleInsider article.</p>
<h4>Further reading</h4>
<ul>
<li><a href="http://bradfrostweb.com/blog/notes/ipad3s-retina-display-web/">ipad3′s retina display will wreak havoc on the web</a></li>
<li><a href="http://bradfrostweb.com/blog/mobile/hi-res-optimization/">optimizing web experiences for high resolution screens</a></li>
<li><a href="http://globalmoxie.com/blog/new-ipad-image-sizes.shtml">3.1 Million Pixels Are Heavy</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=64eJShfzd04:mGrKbL7gJU8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=64eJShfzd04:mGrKbL7gJU8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=64eJShfzd04:mGrKbL7gJU8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=64eJShfzd04:mGrKbL7gJU8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=64eJShfzd04:mGrKbL7gJU8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=64eJShfzd04:mGrKbL7gJU8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=64eJShfzd04:mGrKbL7gJU8:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/64eJShfzd04" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/how-apple-com-will-serve-retina-images-to-new-ipads/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/how-apple-com-will-serve-retina-images-to-new-ipads/</feedburner:origLink></item>
		<item>
		<title>Will Apple’s New TV Feature a Browser?</title>
		<link>http://feedproxy.google.com/~r/cloudfour/~3/kz38SS1cFBo/</link>
		<comments>http://blog.cloudfour.com/will-apples-new-tv-feature-a-browser/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 17:22:10 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[Mobile Web and Services]]></category>

		<guid isPermaLink="false">http://www.cloudfour.com/?p=2228</guid>
		<description><![CDATA[The rumor mill has been going full tilt with expectations that Apple is going to release a new TV product either this year or next. The rumors have been accelerated by Steve Jobs declaring that he had “finally cracked” how to make a usable TV. If we take Steve Jobs at his word, then a [...]]]></description>
			<content:encoded><![CDATA[<p>The rumor mill has been going full tilt with expectations that Apple is going to release a new TV product either this year or next. The rumors have been accelerated by Steve Jobs declaring that he had “<a href="http://www.forbes.com/sites/briancaulfield/2011/10/21/steve-jobs-on-tv-i-finally-cracked-it/">finally cracked</a>” how to make a usable TV.</p>
<p>If we take Steve Jobs at his word, then a question for web developers to ponder is whether or not this new TV will include a browser. Let’s take a look at some of the arguments for and against including a browser.</p>
<h4>Reasons why a new Apple TV will not include a browser</h4>
<ul>
<li>The current Apple TV does not have a browser.</li>
<li>Browsers on TVs have not had the best user experience and adoption has been low.</li>
<li>When announcing the latest Apple TV, Steve Jobs said, people “<a href="http://articles.businessinsider.com/2010-09-01/tech/30059652_1_google-tv-apple-tv-nexus-one">don&#8217;t want a computer on their TV</a>. They have computers. They go to their wide-screen TVs for entertainment. Not to have another computer. This is a hard one for people in the computer industry to understand, but it&#8217;s really easy for consumers to understand. They get it.”</li>
</ul>
<h4>Reasons why a new Apple TV might include a browser</h4>
<ul>
<li>Apple TV is built on top of iOS and has the WebKit rendering engine built in.</li>
<li>People jailbreaking their Apple TV have been able to get <a href="http://firecore.com/atvflash-black">access to the browser</a>.</li>
<li>There is a good chance that an App Store for Apple TV would be one of the major mechanisms for getting new content to the Apple TV.</li>
<li>If Apple TV had an App Store, support for embedded webviews would be necessary as many apps these days combine native and web components including Apple’s own iTunes, Apple Store, and App Store apps.</li>
<li>If embedded webviews and an App Store are available, someone will build a browser absent a specific policy from Apple against browsers. Such a policy seems unlikely as it would be difficult to enforce and cause an unnecessary backlash.</li>
<li>If others are going to create browsers for the platform, it makes sense that Apple would want to define the default browsing experience by shipping Safari on the platform.</li>
<li>Steve Jobs has a history of dismissing something until Apple has solved how it wants to implement it (see: multi-tasking in iOS).</li>
</ul>
<h3>Why worry about what Apple will do?</h3>
<p>It wasn’t too long ago that people believed <a href="http://www.nytimes.com/2007/11/25/technology/25proto.html">no one wanted to use the web on their mobile phones</a>. The iPhone proved that to be wrong.</p>
<p>Now we hear similar refrains about how no one uses the web on their TV. If Apple releases a new TV and they include a browser, we may again see a shift in user behavior that would disprove those assertions.</p>
<p>If that happens, the challenges of building web pages will again increase as we all start to consider how to address a new form factor that we’ve long ignored.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/cloudfour?a=kz38SS1cFBo:2zO0sHePFXc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=kz38SS1cFBo:2zO0sHePFXc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=kz38SS1cFBo:2zO0sHePFXc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=kz38SS1cFBo:2zO0sHePFXc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=kz38SS1cFBo:2zO0sHePFXc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/cloudfour?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/cloudfour?a=kz38SS1cFBo:2zO0sHePFXc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/cloudfour?i=kz38SS1cFBo:2zO0sHePFXc:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/cloudfour/~4/kz38SS1cFBo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.cloudfour.com/will-apples-new-tv-feature-a-browser/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.cloudfour.com/will-apples-new-tv-feature-a-browser/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.263 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-15 17:48:09 -->

