<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"  xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Adactio: Journal</title>
        <description>The online journal of Jeremy Keith, an author and web developer living and working in Brighton, England.</description>
        <language>en</language>
        <link>https://adactio.com/journal/</link>
        <managingEditor>jeremy@adactio.com (Jeremy Keith)</managingEditor>
        <webMaster>jeremy@adactio.com (Jeremy Keith)</webMaster>
        <image>
            <title>Adactio: Journal</title>
            <link>https://adactio.com/journal/</link>
            <url>https://adactio.com/images/rssbutton.gif</url>
            <width>88</width>
            <height>19</height>
        </image>
        <atom:link href="https://adactio.com/journal/rss" rel="self" type="application/rss+xml" />
        <item>
            <title>Vertical limit</title>
            <link>https://adactio.com/journal/11690</link>
            <description>
<![CDATA[
<p>When I was first styling <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>, I made heavy use of <code>vh</code> units. The vertical spacing between elements—headings, paragraphs, images—was all proportional to the overall viewport height. It looked great!</p>

<p>Then I tested it on real devices.</p>

<p>Here’s the problem: when a page loads up in a mobile browser—like, say, Chrome on an Android device—the URL bar is at the top of the screen. The height of that piece of the browser interface isn’t taken into account for the viewport height. That makes sense: the viewport height is the amount of screen real estate available for the content. The content doesn’t extend into the URL bar, therefore the height of the URL bar shouldn’t be part of the viewport height.</p>

<p>But then if you start scrolling down, the URL bar scrolls away off the top of the screen. So now it’s behaving as though it <em>is</em> part of the content rather than part of the browser interface. At this point, the value of the viewport height changes: now it’s the previous value <strong>plus</strong> the height of the URL bar that was previously there but which has now disappeared.</p>

<p>I totally understand why the URL bar is squirrelled away once the user starts scrolling—it frees up some valuable vertical space. But because that necessarily means recalculating the viewport height, it effectively makes the <code>vh</code> unit in CSS very, very limited in scope.</p>

<p>In my initial implementation of <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>, the one where I was styling almost everything with <code>vh</code>, the site was unusable. Every time you started scrolling, things would jump around. I had to go back to the drawing board and remove almost all instances of <code>vh</code> from the styles.</p>

<p>I’ve left it in for one use case and I think it’s the most common use of <code>vh</code>: making an element take up exactly the height of the viewport. The front page of the web book uses <code>min-height: 100vh</code> for the title.</p>

<p><a href="https://adactio.com/notes/11689"><img src="https://adactio.com/images/uploaded/11689/small.jpg" alt="Scrolling." /></a></p>

<p>But as soon as you scroll down from there, that element changes height. The content below it suddenly moves.</p>

<p>Let’s say the overall height of the browser window is 600 pixels, of which 50 pixels are taken up by the URL bar. When the page loads, <code>100vh</code> is 550 pixels. But as soon as you scroll down and the URL bar floats away, the value of <code>100vh</code> becomes 600 pixels.</p>

<p>(This also causes problems if you’re using vertical media queries. If you choose the wrong vertical breakpoint, then the media query <em>won’t</em> kick in when the page loads but <em>will</em> kick in once the user starts scrolling …or vice-versa.)</p>

<p>There’s a mixed message here. On the one hand, the browser is declaring that the URL bar is part of its interface; that the space is off-limits for content. But then, once scrolling starts, that is invalidated. Now the URL bar is behaving as though it is part of the content scrolling off the top of the viewport.</p>

<p>The result of this messiness is that the <code>vh</code> unit is practically useless for real-world situations with real-world devices. It works great for desktop browsers if you’re grabbing the browser window and resizing, but that’s not exactly a common scenario for anyone other than web developers.</p>

<p>I’m sure there’s a way of solving it with JavaScript but that feels like using an atomic bomb to crack a walnut—the whole point of having this in CSS is that we don’t need to use JavaScript for something related to styling.</p>

<p>It’s such a shame. A piece of CSS that’s great in theory, and is <a href="http://caniuse.com/#search=vh">really well supported</a>, just falls apart where it matters most.</p>

<p><strong>Update</strong>: There’s a two-year old <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=428132"> bug report</a> on this for Chrome, and it looks like it might actually get fixed in February.</p>

]]>
            </description>
            <pubDate>Tue, 03 Jan 2017 12:23:31 GMT</pubDate>
            <guid>https://adactio.com/journal/11690</guid>
            <category>browsers</category>
            <category>css</category>
            <category>viewport</category>
            <category>vertical</category>
            <category>frontend</category>
            <category>development</category>
            <category>layout</category>
            <category>vh</category>
            <category>units</category>
            <category>interface</category>
            <category>ui</category>
            <category>medium:id=4da32080295b</category>
        </item>
        <item>
            <title>2016 reading list</title>
            <link>https://adactio.com/journal/11684</link>
            <description>
<![CDATA[
<p>I was having a think back over 2016, trying to remember which books I had read during the year. To the best of my recollection, I think that this is the final tally&#8230;</p>

<p><strong>Non-fiction</strong></p>

<ul>
<li><cite>Endurance</cite> by Alfred Lansing</li>
<li><cite>The Rational Optimist</cite> by Matt Ridley</li>
<li><cite>The Real World of Technology</cite> by Ursula Franklin</li>
<li><cite>Design For Real Life</cite> by Eric Meyer and Sara Wachter-Boettcher</li>
<li><cite>Practical SVG</cite> by Chris Coyier</li>
<li><cite>Demystifying Public Speaking</cite> by Lara Hogan</li>
<li><cite>Working The Command Line</cite> by Remy Sharp</li>
</ul>

<p><strong>Fiction</strong></p>

<ul>
<li><cite>The Revenant</cite> by Michael Punke</li>
<li><cite>The Adjacent</cite> by Christopher Priest</li>
<li><cite>Helliconia Spring</cite> by Brian Aldiss</li>
<li><cite>High Rise</cite> by J.G. Ballard</li>
<li><cite>The Affirmation</cite> by Christopher Priest</li>
<li><cite>Brodeck&#8217;s Report</cite> by Philippe Claudel</li>
<li><cite>Greybeard</cite> by Brian Aldiss</li>
<li><cite>Fictions</cite> by Jorge Luis Borges</li>
<li><cite>The Long Way to a Small Angry Planet</cite> by Becky Chambers</li>
<li><cite>The Dark Forest</cite> by Cixin Liu</li>
<li><cite>Death&#8217;s End</cite> by Cixin Liu</li>
<li><cite>The First Fifteen Lives of Harry August</cite> by Claire North</li>
</ul>

<p>Seems kinda meagre to me. Either I need to read more books or I need to keep better track of what books I&#8217;m reading when. <a href="https://adactio.com/notes/11683">Starting now</a>.</p>

]]>
            </description>
            <pubDate>Mon, 02 Jan 2017 10:32:38 GMT</pubDate>
            <guid>https://adactio.com/journal/11684</guid>
            <category>reading</category>
            <category>books</category>
            <category>2016</category>
            <category>medium:id=1fc3e1d48da8</category>
        </item>
        <item>
            <title>Twenty sixteen</title>
            <link>https://adactio.com/journal/11678</link>
            <description>
<![CDATA[
<p>When <a href="https://adactio.com/journal/8079">I took a look at back at 2015</a>, it was to remark on how nicely uneventful it was. I wish I could say the same about 2016. Instead, this was the year that too damned much kept happening.</p>

<p>The big picture was dominated by Brexit and Trump, disasters that are sure to shape events for years to come. I try to keep the even bigger picture in perspective and remind myself that our species is doing well, and that we’re successfully battling poverty, illiteracy, violence, pollution, and disease. But it’s so hard sometimes. I still think the overall trend for this decade will be two steps forward, but the closing half is almost certain to be one step back.</p>

<p>Some people close to me have had a really shitty year. More than anything, I wish I could do more to help them.</p>

<p>Right now I’m thinking that one of the best things I could wish for 2017 is for it to be an uneventful year. I’d really like it if the end-of-year round-up in 365 days time had no world-changing events.</p>

<p>But for me personally? 2016 was fine. I didn’t accomplish any big goals—although I’m very proud to have published <a href="https://resilientwebdesign.com"><cite>Resilient Web Design</cite></a>—but I’ve had fun at work, and as always, I’m very grateful for all the opportunities that came my way.</p>

<p>I ate some delicious food…</p>

<p><a href="https://adactio.com/notes/10111">
<img src="https://adactio.com/images/uploaded/10111/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10111/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10111/square/medium.jpg 4x,https://adactio.com/images/uploaded/10111/square/large.jpg 6.6x" alt="Short rib.">
</a>
<a href="https://adactio.com/notes/10407">
<img src="https://adactio.com/images/uploaded/10407/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10407/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10407/square/medium.jpg 4x,https://adactio.com/images/uploaded/10407/square/large.jpg 6.6x" alt="Seabass with carrot-top pesto on beet greens and carrot purée.">
</a>
<a href="https://adactio.com/notes/10516">
<img src="https://adactio.com/images/uploaded/10516/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10516/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10516/square/medium.jpg 4x,https://adactio.com/images/uploaded/10516/square/large.jpg 6.6x" alt="Bratwurst.">
</a>
<a href="https://adactio.com/notes/10575">
<img src="https://adactio.com/images/uploaded/10575/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10575/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10575/square/medium.jpg 4x,https://adactio.com/images/uploaded/10575/square/large.jpg 6.6x" alt="Sausage and sauerkraut.">
</a>
<a href="https://adactio.com/notes/10695">
<img src="https://adactio.com/images/uploaded/10695/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10695/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10695/square/medium.jpg 4x,https://adactio.com/images/uploaded/10695/square/large.jpg 6.6x" alt="Short ribs.">
</a>
<a href="https://adactio.com/notes/10911">
<img src="https://adactio.com/images/uploaded/10911/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10911/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10911/square/medium.jpg 4x,https://adactio.com/images/uploaded/10911/square/large.jpg 6.6x" alt="Homemade pappardelle with pig cheek ragu.">
</a>
<a href="https://adactio.com/notes/10967">
<img src="https://adactio.com/images/uploaded/10967/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10967/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10967/square/medium.jpg 4x,https://adactio.com/images/uploaded/10967/square/large.jpg 6.6x" alt="Barbecued Thai chicken.">
</a>
<a href="https://adactio.com/notes/11087">
<img src="https://adactio.com/images/uploaded/11087/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11087/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11087/square/medium.jpg 4x,https://adactio.com/images/uploaded/11087/square/large.jpg 6.6x" alt="Daily oyster.">
</a>
<a href="https://adactio.com/notes/11271">
<img src="https://adactio.com/images/uploaded/11271/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11271/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11271/square/medium.jpg 4x,https://adactio.com/images/uploaded/11271/square/large.jpg 6.6x" alt="Kebab.">
</a>
<a href="https://adactio.com/notes/11397">
<img src="https://adactio.com/images/uploaded/11397/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11397/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11397/square/medium.jpg 4x,https://adactio.com/images/uploaded/11397/square/large.jpg 6.6x" alt="Chicharrones.">
</a>
<a href="https://adactio.com/notes/11676">
<img src="https://adactio.com/images/uploaded/11676/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11676/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11676/square/medium.jpg 4x,https://adactio.com/images/uploaded/11676/square/large.jpg 6.6x" alt="Nightfireburger.">
</a>
<a href="https://adactio.com/notes/11677">
<img src="https://adactio.com/images/uploaded/11677/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11677/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11677/square/medium.jpg 4x,https://adactio.com/images/uploaded/11677/square/large.jpg 6.6x" alt="Ribeye.">
</a></p>

<p>I went to beautiful places…</p>

<p><a href="https://adactio.com/notes/10119">
<img src="https://adactio.com/images/uploaded/10119/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10119/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10119/square/medium.jpg 4x,https://adactio.com/images/uploaded/10119/square/large.jpg 6.6x" alt="Popped in to see Caravaggio and Holbein.">
</a>
<a href="https://adactio.com/notes/10261">
<img src="https://adactio.com/images/uploaded/10261/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10261/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10261/square/medium.jpg 4x,https://adactio.com/images/uploaded/10261/square/large.jpg 6.6x" alt="Our home for the week.">
</a>
<a href="https://adactio.com/notes/10527">
<img src="https://adactio.com/images/uploaded/10527/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10527/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10527/square/medium.jpg 4x,https://adactio.com/images/uploaded/10527/square/large.jpg 6.6x" alt="Bodleian go where no one has gone before.">
</a>
<a href="https://adactio.com/notes/10570">
<img src="https://adactio.com/images/uploaded/10570/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10570/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10570/square/medium.jpg 4x,https://adactio.com/images/uploaded/10570/square/large.jpg 6.6x" alt="Tram.">
</a>
<a href="https://adactio.com/notes/10828">
<img src="https://adactio.com/images/uploaded/10828/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10828/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10828/square/medium.jpg 4x,https://adactio.com/images/uploaded/10828/square/large.jpg 6.6x" alt="Amsterdam’s looking lovely this morning.">
</a>
<a href="https://adactio.com/notes/11144">
<img src="https://adactio.com/images/uploaded/11144/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11144/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11144/square/medium.jpg 4x,https://adactio.com/images/uploaded/11144/square/large.jpg 6.6x" alt="Stockholm street.">
</a>
<a href="https://adactio.com/notes/11149">
<img src="https://adactio.com/images/uploaded/11149/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11149/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11149/square/medium.jpg 4x,https://adactio.com/images/uploaded/11149/square/large.jpg 6.6x" alt="Mauer.">
</a>
<a href="https://adactio.com/notes/11189">
<img src="https://adactio.com/images/uploaded/11189/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11189/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11189/square/medium.jpg 4x,https://adactio.com/images/uploaded/11189/square/large.jpg 6.6x" alt="Ah, Venice!">
</a>
<a href="https://adactio.com/notes/11402">
<img src="https://adactio.com/images/uploaded/11402/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11402/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11402/square/medium.jpg 4x,https://adactio.com/images/uploaded/11402/square/large.jpg 6.6x" alt="Barcelona.">
</a>
<a href="https://adactio.com/notes/11466">
<img src="https://adactio.com/images/uploaded/11466/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11466/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11466/square/medium.jpg 4x,https://adactio.com/images/uploaded/11466/square/large.jpg 6.6x" alt="Malibu sunset.">
</a>
<a href="https://adactio.com/notes/11649">
<img src="https://adactio.com/images/uploaded/11649/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11649/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11649/square/medium.jpg 4x,https://adactio.com/images/uploaded/11649/square/large.jpg 6.6x" alt="Cuskinny.">
</a></p>

<p>And I got to hang out with some lovely doggies…</p>

<p><a href="https://adactio.com/notes/10206">
<img src="https://adactio.com/images/uploaded/10206/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10206/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10206/square/medium.jpg 4x,https://adactio.com/images/uploaded/10206/square/large.jpg 6.6x" alt="Mia!">
</a>
<a href="https://adactio.com/notes/10322">
<img src="https://adactio.com/images/uploaded/10322/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10322/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10322/square/medium.jpg 4x,https://adactio.com/images/uploaded/10322/square/large.jpg 6.6x" alt="Archie is my favourite @EnhanceConf speaker.">
</a>
<a href="https://adactio.com/notes/10470">
<img src="https://adactio.com/images/uploaded/10470/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10470/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10470/square/medium.jpg 4x,https://adactio.com/images/uploaded/10470/square/large.jpg 6.6x" alt="Mesa, Lola, and @wordridden.">
</a>
<a href="https://adactio.com/notes/10484">
<img src="https://adactio.com/images/uploaded/10484/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10484/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10484/square/medium.jpg 4x,https://adactio.com/images/uploaded/10484/square/large.jpg 6.6x" alt="Rainier McChedderton!">
</a>
<a href="https://adactio.com/notes/10672">
<img src="https://adactio.com/images/uploaded/10672/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10672/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10672/square/medium.jpg 4x,https://adactio.com/images/uploaded/10672/square/large.jpg 6.6x" alt="I met Zero! Yay! Thanks, @wilto.">
</a>
<a href="https://adactio.com/notes/10861">
<img src="https://adactio.com/images/uploaded/10861/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/10861/square/small.jpg 2.6x, https://adactio.com/images/uploaded/10861/square/medium.jpg 4x,https://adactio.com/images/uploaded/10861/square/large.jpg 6.6x" alt="On the bright side, Huxley is in the @Clearleft office today.">
</a>
<a href="https://adactio.com/notes/11076">
<img src="https://adactio.com/images/uploaded/11076/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11076/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11076/square/medium.jpg 4x,https://adactio.com/images/uploaded/11076/square/large.jpg 6.6x" alt="The day Herbie came to visit @Clearleft.">
</a>
<a href="https://adactio.com/notes/11114">
<img src="https://adactio.com/images/uploaded/11114/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11114/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11114/square/medium.jpg 4x,https://adactio.com/images/uploaded/11114/square/large.jpg 6.6x" alt="It’s Daphne.">
</a>
<a href="https://adactio.com/notes/11345">
<img src="https://adactio.com/images/uploaded/11345/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11345/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11345/square/medium.jpg 4x,https://adactio.com/images/uploaded/11345/square/large.jpg 6.6x" alt="Poppy’s on patrol.">
</a>
<a href="https://adactio.com/notes/11530">
<img src="https://adactio.com/images/uploaded/11530/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11530/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11530/square/medium.jpg 4x,https://adactio.com/images/uploaded/11530/square/large.jpg 6.6x" alt="Morty!">
</a>
<a href="https://adactio.com/notes/11564">
<img src="https://adactio.com/images/uploaded/11564/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11564/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11564/square/medium.jpg 4x,https://adactio.com/images/uploaded/11564/square/large.jpg 6.6x" alt="Scribble is a good dog.">
</a>
<a href="https://adactio.com/notes/11641">
<img src="https://adactio.com/images/uploaded/11641/square/thumb.jpg" srcset="https://adactio.com/images/uploaded/11641/square/small.jpg 2.6x, https://adactio.com/images/uploaded/11641/square/medium.jpg 4x,https://adactio.com/images/uploaded/11641/square/large.jpg 6.6x" alt="Sleepy.">
</a></p>

<p>Have a happy—and uneventful—new year!</p>

]]>
            </description>
            <pubDate>Sun, 01 Jan 2017 14:51:14 GMT</pubDate>
            <guid>https://adactio.com/journal/11678</guid>
            <category>2016</category>
            <category>year</category>
            <category>review</category>
            <category>medium:id=b74a5bcfde2b</category>
        </item>
        <item>
            <title>The many formats of Resilient Web Design</title>
            <link>https://adactio.com/journal/11670</link>
            <description>
<![CDATA[
<p>If you don&#8217;t like reading in a web browser, you might like to know that <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> is now available in more formats.</p>

<p><a href="http://jiminy.chapalpanoz.com/">Jiminy Panoz</a> created a lovely <a href="https://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign.epub">EPUB version</a>. I tried it out in Apple&#8217;s iBooks app and it looks great. I tried to submit it to the iBooks store too, but that process threw up a few too many roadblocks.</p>

<p>Oliver Williams has created <a href="https://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign.mobi">a MOBI version</a>. That&#8217;s means you can read it on a Kindle. I plugged my old Kindle into my computer, dragged that file onto its disc image, and it worked a treat.</p>

<p>And there&#8217;s always the PDF versions; one <a href="https://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-portrait.pdf">in portrait</a> and another <a href="http://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-landscape.pdf">in landscape</a> format. Those were generated straight from <a href="https://adactio.com/journal/11627">the print styles</a>.</p>

<p>Oh, and there&#8217;s <a href="https://itunes.apple.com/podcast/resilient-web-design/id1183700985">the podcast</a>. I&#8217;ve only released two chapters so far. The Christmas break and an untimely cold have slowed down the release schedule a little bit.</p>

<p>I&#8217;d love to make a physical, print-on-demand version of <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> available—maybe through <a href="https://www.lulu.com/">Lulu</a>—but my InDesign skills are non-existent.</p>

<p>If you think the book should be available in any other formats, and you fancy having a crack at it, please feel free to <a href="https://github.com/adactio/resilientwebdesign">use the source files</a>.</p>

]]>
            </description>
            <pubDate>Wed, 28 Dec 2016 21:57:10 GMT</pubDate>
            <guid>https://adactio.com/journal/11670</guid>
            <category>publishing</category>
            <category>book</category>
            <category>epub</category>
            <category>mobi</category>
            <category>pdf</category>
            <category>digital</category>
            <category>resilientwebdesign</category>
            <category>medium:id=a3c5f11ccada</category>
        </item>
        <item>
            <title>Deep linking with fragmentions</title>
            <link>https://adactio.com/journal/11632</link>
            <description>
<![CDATA[
<p>When I was marking up <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> I wanted to make sure that people could link to individual sections within a chapter. So I added IDs to all the headings. There’s no UI to expose that though—like the hover pattern that some sites use to show that something is linkable—so unless you know the IDs are there, there’s no way of getting at them other than “view source.”</p>

<p>But if you’re reading a passage in <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> and you highlight some text, you’ll notice that the URL updates to include that text after a hash symbol. <a href="https://twitter.com/andrewmaier/status/808843103012581376">If that updated URL gets shared</a>, then anyone following it should be sent straight to that string of text within the page. That’s <a href="https://indieweb.org/fragmention">fragmentions</a> in action:</p>

<blockquote>
  <p>Fragmentions find the first matching word or phrase in a document and focus its closest surrounding element. The match is determined by the case-sensitive string following the # (or ## double-hash)</p>
</blockquote>

<p>It’s a similar idea to <a href="http://simonstl.com/articles/cssFragID.html">Eric and Simon’s proposal</a> to use CSS selectors as fragment identifiers, but using plain text instead. You can find out more about <a href="http://www.kevinmarks.com/fragmentions.html">the genesis of fragmentions</a> from Kevin. I’m using <a href="https://github.com/chapmanu/fragmentions">Jonathon Neal’s script</a> with some <a href="https://github.com/adactio/resilientwebdesign/pull/3">handy updates</a> from <a href="http://dracos.co.uk/">Matthew</a>.</p>

<p>I’m using the fragmention support to power <a href="https://resilientwebdesign.com/index/">the index of the book</a>. It relies on JavaScript to work though, so Matthew has come to the rescue again and created <a href="https://github.com/adactio/resilientwebdesign/pull/2">a version of the site with IDs</a> for each item linked from the index (I must get around to merging that).</p>

<p>The fragmention functionality is ticking along nicely with one problem…</p>

<p>I’ve tweaked the typography of <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> to within an inch of its life, including a crude but effective technique to avoid widowed words at the end of a paragraph. The last two words of every paragraph are separated by a <a href="http://www.fileformat.info/info/unicode/char/a0/index.htm">UTF-8 no-break space character</a> instead of <a href="http://www.fileformat.info/info/unicode/char/0020/index.htm">a regular space</a>.</p>

<p>That solves the widowed words problem, but it confuses the fragmention script. <a href="https://twitter.com/ashleyjoost/status/810633935243845632">Any selected text that includes the last two words of a paragraph fails to match</a>. I’ve tried tweaking the script, but I’m stumped. If you fancy having a go, please <a href="https://github.com/adactio/resilientwebdesign/blob/master/js/scripts.js">have at it</a>.</p>

<p><strong>Update</strong>: And <a href="https://github.com/adactio/resilientwebdesign/pull/7">fixed</a>! Thanks to <a href="http://leereamsnyder.com/">Lee</a>.</p>

]]>
            </description>
            <pubDate>Mon, 19 Dec 2016 12:57:36 GMT</pubDate>
            <guid>https://adactio.com/journal/11632</guid>
            <category>fragmentions</category>
            <category>linking</category>
            <category>publishing</category>
            <category>sharing</category>
            <category>resilientwebdesign</category>
            <category>book</category>
            <category>indieweb</category>
            <category>javascript</category>
            <category>medium:id=7cc938d595da</category>
        </item>
        <item>
            <title>Print styles</title>
            <link>https://adactio.com/journal/11627</link>
            <description>
<![CDATA[
<p>I really wanted to make sure that the print styles for <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> were pretty good—or at least as good as they could be given the everlasting lack of support for many print properties in browsers.</p>

<p>Here’s the first thing I added:</p>

<pre><code>@media print {
  @page {
    margin: 1in 0.5in 0.5in;
    orphans: 4;
    widows: 3;
  }
}
</code></pre>

<p>That sets the margins of printed pages in inches (I could’ve used centimetres but the numbers were nice and round in inches). The <code>orphans: 4</code> declaration says that if there’s less than 4 lines on a page, shunt the text onto the next page. And <code>widows: 3</code> declares that there shouldn’t be less than 3 lines left alone on a page (instead more lines will be carried over from the previous page). </p>

<p>I always get widows and orphans confused so I remind myself that orphans are left alone at the start; widows are left alone at the end.</p>

<p>I try to make sure that some elements don’t get their content split up over page breaks:</p>

<pre><code>@media print {
  p, li, pre, figure, blockquote {
    page-break-inside: avoid;
  }
}
</code></pre>

<p>I don’t want headings appearing at the end of a page with no content after them:</p>

<pre><code>@media print {
  h1,h2,h3,h4,h5 {
    page-break-after: avoid;
  }
}
</code></pre>

<p>But sections should always start with a fresh page:</p>

<pre><code>@media print {
  section {
    page-break-before: always;
  }
}
</code></pre>

<p>There are a few other little tweaks to hide some content from printing, but that’s pretty much it. Using print preview in browsers showed some pretty decent formatting. In fact, I used the “Save as PDF” option to create the PDF versions of the book. <a href="https://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-portrait.pdf">The portrait version</a> comes from Chrome’s preview. <a href="http://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-landscape.pdf">The landscape version</a> comes from Firefox, which offers more options under “Layout”.</p>

<p>For some more print style suggestions, have a look at the article <a href="https://uxdesign.cc/i-totally-forgot-about-print-style-sheets-f1e6604cfd6"><cite>I totally forgot about print style sheets</cite></a>. There’s also <a href="https://www.smashingmagazine.com/2013/03/tips-and-tricks-for-print-style-sheets/">tips and tricks for print style sheets</a> on Smashing Magazine. That includes a clever little trick for generating QR codes that only appear when a document is printed. I’ve used that technique for some page types over on <a href="https://thesession.org/">The Session</a>.</p>

]]>
            </description>
            <pubDate>Fri, 16 Dec 2016 16:53:13 GMT</pubDate>
            <guid>https://adactio.com/journal/11627</guid>
            <category>print</category>
            <category>styles</category>
            <category>css</category>
            <category>resilientwebdesign</category>
            <category>book</category>
            <category>printing</category>
            <category>medium:id=b9a0783cd646</category>
        </item>
        <item>
            <title>Design principles</title>
            <link>https://adactio.com/journal/11620</link>
            <description>
<![CDATA[
<p>Andrew Travers wrote about <a href="http://trvrs.co/journal/designing-design-principles">designing design principles</a> at Co-op Digital. I’m somewhat obsessed with design principles—hence <a href="https://principles.adactio.com/">my collection</a>—so I’m also obsessed with figuring out what makes for “good” design principles.</p>

<p>One of my favourite design principles (yes, I have favourites) is from the <a href="https://www.w3.org/TR/html-design-principles/">HTML Design Principles</a>. It’s <a href="https://www.w3.org/TR/html-design-principles/#priority-of-constituencies">the priority of constituencies</a>:</p>

<blockquote>
  <p><strong>In case of conflict</strong>, consider users over authors over implementors over specifiers over theoretical purity.</p>
</blockquote>

<p>The emphasis my own. It demonstrates how the design principle can be put to use (“in case of conflict”). Andrew also describes <em>uses</em> for the design principles they’re putting together:</p>

<blockquote>
  <p>What we’re building towards is a set of principles, few enough to be memorable, short enough to be repeatable, relevant enough to be usable. When we’re running a design crit, it’s these principles that we want to lean on. When a sole designer in an agile delivery team is talking about a design approach, it’s these principles that back her up.</p>
</blockquote>

<p>Those sound like good use cases to me. Those are situations when design principles can help people reach agreement on priorities, without it having to be about ego or who shouts loudest.</p>

<p>I think it was from <a href="https://www.cennydd.com/">Cennydd</a> that I heard about a really good test of a design principle: is it reversible? In other words, could you imagine the exact opposite of the design principle being perfectly valid in a different organisation or on a different project? If not, then the principle may be too weak to be effective. (<a href="https://twitter.com/Cennydd/status/809553086322737152">Cennydd points out</a> that he heard this from Jared who has written a lot about <a href="https://articles.uie.com/creating-design-principles/">evaluating design principles</a>.)</p>

<p>“Make it easy to use” would be an example of a weak design principle. It’s hard to imagine a situation where “make it hard to use” would be a reasonable guiding principle.</p>

<p>Frankly, there are plenty of “bad” examples in <a href="https://principles.adactio.com/">my collection of design principles</a>. Many of them wouldn’t pass the reversibility test. Just recently though, I spotted some that would pass the test with flying colours. They weren’t even labelled as design principles—they’re the tips that <a href="http://www.heydonworks.com/">Heydon</a> includes at the end of <a href="https://24ways.org/2016/what-the-heck-is-inclusive-design/">his excellent 24 Ways article on inclusive design</a>:</p>

<blockquote>
  <ul>
  <li>Involve code early</li>
  <li>Respect conventions</li>
  <li>Don’t be exact</li>
  <li>Enforce simplicity</li>
  </ul>
</blockquote>

<p>I could easily imagine endeavours where the complete opposite of those tips would be valued. Personally, I think they’re really great design princples.</p>

<p>I should add them to <a href="https://principles.adactio.com/">the list</a>.</p>

]]>
            </description>
            <pubDate>Thu, 15 Dec 2016 19:00:17 GMT</pubDate>
            <guid>https://adactio.com/journal/11620</guid>
            <category>design</category>
            <category>principles</category>
            <category>medium:id=52bdc267c56a</category>
        </item>
        <item>
            <title>The typography of a web book</title>
            <link>https://adactio.com/journal/11615</link>
            <description>
<![CDATA[
<p>I&#8217;m a sucker for classic old-style serif typefaces: Caslon, Baskerville, Bembo, Garamond …I love &#8216;em. That&#8217;s probably why I&#8217;ve always found the typesetting in Edward Tufte&#8217;s books so appealing—he always uses a combination of Bembo for body copy and Gill Sans for headings.</p>

<p><a href="https://adactio.com/links/10941">Earlier this year</a> I stumbled on a screen version of Bembo used for Tufte&#8217;s digital releases called <a href="https://edwardtufte.github.io/et-book/">ET Book</a>. Best of all, it&#8217;s <a href="https://github.com/edwardtufte/et-book">open source</a>:</p>

<blockquote>
  <p>ET Book is a Bembo-like font for the computer designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte. It is free and open-source.</p>
</blockquote>

<p>When I was styling <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>, I knew that the choice of typeface would be one of the most important decisions I would make. Remembering that open source ET Book font, I plugged it in to see how it looked. I liked what I saw. I found it particularly appealing when it&#8217;s full black on full white at a nice big size (with lower contrast or sizes, it starts to get a bit fuzzy).</p>

<p>I love, love, love the old-style numerals of ET Book. But I was disappointed to see that ligatures didn&#8217;t seem to be coming through (even when I had enabled them in CSS). I mentioned this to <a href="http://clagnut.com/">Rich</a> and of course he couldn&#8217;t resist doing a bit of typographic sleuthing. It turns out that the ligature glyphs are there in the source files but the files needed a little tweaking to enable them. Because the files are open source, Rich was able to tweak away to his heart&#8217;s content. I then took the tweaked open type files and ran them through Font Squirrel to generate WOFF and WOFF2 files. <a href="https://github.com/adactio/et-book/tree/gh-pages/et-book-ligatures-enabled">I&#8217;ve put them on Github</a>.</p>

<p>For this book, I decided that the measure would be the priority. I settled on a measure of around 55 to 60 characters—about 10 or 11 words per line. I used a max-width of 27em combined with <a href="https://madebymike.com.au/writing/precise-control-responsive-typography/">Mike&#8217;s brilliant fluid type technique</a> to maintain a consistent measure.</p>

<p>It looks great on small-screen devices and tablets. On large screens, the font size starts to get really, really big. Personally, I like that. Lots of other people like it too. But some people really don&#8217;t like it. I should probably add <a href="http://www.zeldman.com/2016/12/14/font-size-widgets/">a font-resizing widget</a> for those who find the font size too shocking on luxuriously large screens. In the meantime, their only recourse is to <a href="https://github.com/adactio/resilientwebdesign">fork the CSS</a> to make their own version of the book with more familiar font sizes.</p>

<p>The visceral reaction a few people have expressed to the font size reminds me of <a href="http://www.zeldman.com/2012/05/18/web-design-manifesto-2012/">the flak Jeffrey received</a> when he redesigned his personal site a few years back:</p>

<blockquote>
  <p>Many people who’ve visited this site since the redesign have commented on the big type. It’s hard to miss. After all, words are practically the only feature I haven’t removed. Some of the people say they love it. Others are undecided. Many are still processing. A few say they hate it and suggest I’ve lost my mind.</p>
</blockquote>

<p>I wonder how the people who complained then are feeling now, a few years on, in a world with <a href="https://medium.com/">Medium</a> in it? Jeffrey&#8217;s redesign doesn&#8217;t look so extreme any more.</p>

<p><a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> will be on the web for a very, very, very long time. I&#8217;m curious to see if its type size will still look shockingly large in years to come.</p>

]]>
            </description>
            <pubDate>Wed, 14 Dec 2016 17:05:58 GMT</pubDate>
            <guid>https://adactio.com/journal/11615</guid>
            <category>typography</category>
            <category>fonts</category>
            <category>tufte</category>
            <category>measure</category>
            <category>reading</category>
            <category>publishing</category>
            <category>resilientwebdesign</category>
            <category>book</category>
            <category>medium:id=5683861dae04</category>
        </item>
        <item>
            <title>Introducing Resilient Web Design</title>
            <link>https://adactio.com/journal/11608</link>
            <description>
<![CDATA[
<p>I wrote a thing. The thing is a book. But the book is not published on paper. This book is on the web. It&#8217;s a web book. Or &#8220;wook&#8221; if you prefer &#8230;please don&#8217;t prefer. Here it is:</p>

<p><a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>.</p>

<p>It&#8217;s yours for free.</p>

<p>Much of the subject matter will be familiar if you&#8217;ve seen my conference talks from the past couple of years, particularly <a href="https://adactio.com/articles/9465"><cite>Enhance!</cite></a> and <a href="https://adactio.com/articles/11481"><cite>Resilience</cite></a>. But the book ended up taking some twists and turns that surprised me. It turned out to be a bit of a history book: the history of design, the history of the web.</p>

<p><a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a> is a short book. It&#8217;s between sixteen and seventeen megawords long. You could read the whole thing in a couple of hours. Or—because the book has seven chapters—you could take fifteen to twenty minutes out of a day to read one chapter and you&#8217;d have read the whole thing done in a week.</p>

<p>If you make websites in any capacity, I hope that this book will resonate with you. Even if you don&#8217;t make websites, I still hope there&#8217;s an interesting story in there for you.</p>

<p>You can <a href="https://resilientwebdesign.com/">read the whole book on the web</a>, but if you&#8217;d rather have a single file to carry around, I&#8217;ve made some PDFs as well: one in <a href="https://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-portrait.pdf">portrait</a>, one in <a href="http://resilientwebdesign.s3.amazonaws.com/downloads/ResilientWebDesign-landscape.pdf">landscape</a>.</p>

<p>I&#8217;ve licensed the book quite liberally. It&#8217;s released under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons attribution share-alike licence</a>. That means you can re-use the material in any way you want (even commercial usage) as long as you provide some attribution and use the same licence. So if you&#8217;d like to release the book in some other format like ePub or anything, go for it.</p>

<p>I&#8217;m currently making an audio version of <a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>. I&#8217;ll be releasing it one chapter at a time as a podcast. Here&#8217;s <a href="https://resilientwebdesign.com/podcast.rss">the RSS feed</a> if you want to subscribe to it. Or you can <a href="https://itunes.apple.com/gb/podcast/resilient-web-design/id1183700985">subscribe directly from iTunes</a>.</p>

<p>I took my sweet time writing this book. I wrote the first chapter in March 2015. I wrote the last chapter in May 2016. Then I sat on it for a while, figuring out what to do with it. Eventually I decided to just put the whole thing up on the web—it seems fitting.</p>

<p>Whereas the writing took over a year of solid procrastination, making the website went surprisingly quickly. After one weekend of marking up and styling, I had most of it ready to go. Then I spent a while tweaking. <a href="https://github.com/adactio/resilientwebdesign">The source files are on Github</a>.</p>

<p>I&#8217;m pretty happy with the end result. I&#8217;ll write a bit more about some of the details over the next while—the typography, the offline functionality, print styles, and stuff like that. In the meantime, I hope you&#8217;ll peruse this little book at your leisure&#8230;</p>

<p><a href="https://resilientwebdesign.com/"><cite>Resilient Web Design</cite></a>.</p>

<p>If you like it, please spread the word.</p>

]]>
            </description>
            <pubDate>Tue, 13 Dec 2016 16:06:16 GMT</pubDate>
            <guid>https://adactio.com/journal/11608</guid>
            <category>book</category>
            <category>publishing</category>
            <category>writing</category>
            <category>resilientwebdesign</category>
            <category>medium:id=543e0ba85fa3</category>
        </item>
        <item>
            <title>Certbot renewals with Apache</title>
            <link>https://adactio.com/journal/11599</link>
            <description>
<![CDATA[
<p>I wrote a while back about <a href="https://adactio.com/journal/10727">switching to HTTPS on Apache 2.4.7 on Ubuntu 14.04 on Digital Ocean</a>. In that post, I pointed to <a href="https://gist.github.com/adactio/f0e13a2f8b9f9f084676bb2a901c5c95">an example .conf file</a>.</p>

<p>I&#8217;ve been having a few issues with my certificate renewals with Certbot (the artist formerly known as Let&#8217;s Encrypt). If I did a dry-run for renewing my certificates&#8230;</p>

<pre><code>/etc/certbot-auto renew --dry-run
</code></pre>

<p>&#8230; I kept getting this message:</p>

<blockquote>
  <p>Encountered vhost ambiguity but unable to ask for user guidance in non-interactive mode. Currently Certbot needs each vhost to be in its own conf file, and may need vhosts to be explicitly labelled with ServerName or ServerAlias directories. Falling back to default vhost *:443&#8230;</p>
</blockquote>

<p>It turns out that Certbot doesn&#8217;t like HTTP and HTTPS configurations being lumped into <a href="https://gist.github.com/adactio/f0e13a2f8b9f9f084676bb2a901c5c95">one .conf file</a>. Instead it expects to see all the port 80 stuff in a <code>domain.com.conf</code> file, and the port 443 stuff in a <code>domain.com-ssl.conf</code> file.</p>

<p>So I&#8217;ve taken <a href="https://gist.github.com/adactio/f0e13a2f8b9f9f084676bb2a901c5c95">that original .conf file</a> and split it up into two.</p>

<p>First I SSH&#8217;d into my server and went to the Apache directory where all these .conf files live:</p>

<pre><code>cd /etc/apache2/sites-available
</code></pre>

<p>Then I copied the current (single) file to make the SSL version:</p>

<pre><code>cp yourdomain.com.conf yourdomain.com-ssl.conf
</code></pre>

<p>Time to fire up one of those weird text editors to edit that newly-created file:</p>

<pre><code>nano yourdomain.com-ssl.conf
</code></pre>

<p>I deleted everything related to port 80—all the stuff between (and including) the <code>VirtualHost *:80</code> tags:</p>

<pre><code>&lt;VirtualHost *:80&gt;
...
&lt;/VirtualHost&gt;
</code></pre>

<p>Hit <kbd>ctrl</kbd> and <kbd>o</kbd>, press <kbd>enter</kbd> in response to the prompt, and then hit <kbd>ctrl</kbd> and <kbd>x</kbd>.</p>

<p>Now I do the opposite for the original file:</p>

<pre><code>nano yourdomain.com.conf
</code></pre>

<p>Delete everything related to <code>VirtualHost *:443</code>:</p>

<pre><code>&lt;VirtualHost *:443&gt;
...
&lt;/VirtualHost&gt;
</code></pre>

<p>Once again, I hit <kbd>ctrl</kbd> and <kbd>o</kbd>, press <kbd>enter</kbd> in response to the prompt, and then hit <kbd>ctrl</kbd> and <kbd>x</kbd>.</p>

<p>Now I need to tell Apache about the new .conf file:</p>

<pre><code>a2ensite yourdomain.com-ssl.conf
</code></pre>

<p>I&#8217;m told that&#8217;s cool and all, but that I need to restart Apache for the changes to take effect:</p>

<pre><code>service apache2 restart
</code></pre>

<p>Now when I test the certificate renewing process&#8230;</p>

<pre><code>/etc/certbot-auto renew --dry-run
</code></pre>

<p>&#8230;everything goes according to plan.</p>

]]>
            </description>
            <pubDate>Sat, 10 Dec 2016 11:32:39 GMT</pubDate>
            <guid>https://adactio.com/journal/11599</guid>
            <category>certbot</category>
            <category>apache</category>
            <category>ubuntu</category>
            <category>security</category>
            <category>https</category>
            <category>ssl</category>
            <category>conf</category>
            <category>commandline</category>
            <category>cli</category>
            <category>server</category>
            <category>terminal</category>
            <category>medium:id=a3ac276bade3</category>
        </item>

   </channel>
</rss>