A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.md 8.3KB

4 yıl önce
12345
  1. title: Continuum
  2. url: https://adactio.com/journal/6692
  3. hash_url: 1efa2e01199c9e2e3f761386162bf875
  4. <p>Yesterday afternoon, I <a href="https://twitter.com/jgarber/status/564855344934170625">posted a little jab at Vine</a>. What you see in that screenshot is a Vine video page completely devoid of usable content owing to a JavaScript error. I’m attempting a pretty typical task and a primary function of Vine’s service: I want to watch <a href="https://vine.co/v/OUvAvAYQm6I">Jay-Z’s reaction to Kanye reprising his schtick at the Grammys</a>. As you do.</p> <p>But I can’t. Something went wrong. You see, Vine’s video pages are built in a way that expects everything goes off without a hitch. The web browser will receive all the necessary assets in the necessary order and execute everything <em>exactly</em> as the developer intended. Unfortunately, that’s not the way the Web often works.</p> <p>(For those curious, I was using the most up-to-date version of Google Chrome on a MacBook Air running the latest operating system on my home’s broadband Internet connection. Pretty optimal conditions, right?)</p> <p>So I post about it on Twitter. Friend and colleague <a href="http://helenvholmes.com/">Helen Holmes</a> saw my post and <a href="https://twitter.com/helenvholmes/status/564858232087539712">kicked off a lengthy back-and-forth</a> that convinced me to commit my thoughts to the page. I’ve been meaning to write about this particular topic for a while and here’s what’s been rattling around in my head.</p> <p>The Web is a Continuum</p> <p>The way Vine’s video pages are built illustrates the fault in thinking of the Web as a platform. Platforms are static, defined software environments responsible for running neatly packaged bundles of code: a downloadable native app, an installable desktop application, a Flash movie. iOS, Android, Mac OS X, Windows, Flash—these are platforms.</p> <p><em>This is not the Web.</em> Rather, this is not <em>today’s</em> Web. Today’s Web is a <a href="https://adactio.com/journal/6692">continuum</a>.</p> <p>Today’s Web makes no guarantees. Every bit of code—HTML, CSS, and JavaScript—shipped from a server across the wire acts as a <em>suggestion</em> as to how the browser should interpret and display content. More often than not, everything works planned, but for any number of reasons, a browser could fail to request or render a particular asset. Luckily, browsers are by design resilient in how they handle HTML and CSS. <a href="https://en.wikipedia.org/wiki/Robustness_principle">Being liberal in what they accept</a>, browsers will simply ignore any HTML or CSS they don’t understand. Unfortunately, as the Vine example above demonstrates, browsers don’t do so well when encountering JavaScript problems. Rather than carrying on, the browser halts further execution of any script.</p> <p>That right there highlights the problem with thinking of the Web as a platform. Something <em>will</em> go wrong, even under nearly ideal conditions. And when something inevitably goes wrong, what happens to your website? To your users?</p> <p>What are we to do? How do we design for <a href="http://trentwalton.com/2014/03/10/device-agnostic/">hostile browsers</a>?</p> <p>Experience Layers</p> <p>Nearly a year ago, I likened the Web to <a href="/posts/the-web-is-cake">a layer cake</a>. A delicious metaphor, to be certain, but not entirely accurate. In the intervening eleven months, I’ve thought back to that post and the metaphor’s shortcomings. I think I’ve cracked it: The Web is <em>experience layers</em>, built from the bottom up, with each successive layer enhancing the previous.</p> <p>Practically speaking, this amounts to an initial content layer described using semantic HTML—the Web’s native tongue—enhanced with a layer of style applied with CSS. Embeddable media—images, audio, and video—fall somewhere in the neighborhood of the style layer. Lastly, behavior applied using JavaScript tops out the experience stack.</p> <p>Lower foundational levels should never rely on higher layers for their primary functionality. Rendering a website’s content, for instance, shouldn’t require JavaScript. Higher levels in the stack should <em>improve</em> the overall experience, hanging on hooks found in the foundational levels (e.g. CSS classes and ID attributes).</p> <p>Designing from the Bottom Up</p> <p>In his book <a href="http://www.amazon.com/dp/0321887867/?tag=sixtwothree-20">Responsive Design Workflow</a>, <a href="http://www.the-haystack.com/">Stephen Hay</a> details his process for designing in text. The entire book is worth your time, but you can read <a href="http://www.peachpit.com/articles/article.aspx?p=2040824">this particular chapter</a> for free online. Stephen also detailed this technique as well in <a href="https://vimeo.com/45915667">his presentation at Mobilism</a> back in 2012.</p> <p>Stephen advocates a content-first approach using plain text. The emphasis on content is critical: everything in your interface is content whether it be the text of an article, the navigation, or control elements like form inputs. It’s all content and it all needs writing.</p> <p>I <em>love</em> this content-focused approach to design. It just makes sense.</p> <p>Moving up a layer from plain text, Stephen recommends the popular <a href="http://daringfireball.net/projects/markdown/">Markdown</a> text formatting syntax. Markdown is a simple set of formatting rules for describing common text components such as headings and lists and maps closely to the elements in HTML. <em>Awfully convenient.</em> There are a bunch of great Markdown editors available—I use <a href="http://bywordapp.com/">Byword</a>—and every one of them will easily convert Markdown documents to HTML.</p> <p>Now that you have an HTML file full of well-structured content, you can begin layering on design. This is where existing design tools and techniques like branding guidelines, <a href="http://styletil.es/">style tiles</a>, and Photoshop mockups are most useful. The HTML generated from Markdown is barebones, so you’ll want to add additional structural elements as necessary to accommodate your website’s visual design.</p> <p>This is, to a degree, <a href="http://www.stuffandnonsense.co.uk/blog/about/walls_come_tumbling_down_presentation_slides_and_transcript/">designing in the browser</a>. I urge you, though, to think of it as designing <em>with</em> the browser. Use the browser as you would every other tool at your disposal.</p> <p>With your website’s structure and visual design in place, you can bring the whole thing to life with a final layer of behavior applied with JavaScript. As before, this step may involve additional HTML, class names, or ID attributes. That’s okay, but try to keep it lightweight.</p> <p>Designing in this fashion allows you to easily test along the way—and you should test furiously! Try disabling styles. Does your site still read well? It should if you were rigorous during the content-crafting phase and used Markdown to organize your content. Disable JavaScript and make sure your website’s primary content is still available. Do most of your website’s features still function at a basic level? Most importantly, is your website still accessible in the absence of any one (or more) of these enhancing layers?</p> <p>A Progressive Experience</p> <p>If you’ve read this far and thought, “Why, that sounds like <a href="https://en.wikipedia.org/wiki/Progressive_enhancement">progressive enhancement</a>,” you’d be correct! Progressive enhancement is the best strategy for building for today’s Web. With so many people connecting to and interacting with the Web on a <a href="https://www.flickr.com/photos/brad_frost/7387724364">mind-boggling</a> number of devices of <a href="http://viewportsizes.com/">varying screen sizes</a> in an infinite array of circumstances, it’s critical to design layers of experience. Any layer atop another should serve to enhance the base-level experience of the previous. The essential functionality of the base layers should continue to function smoothly in the absence of higher-layer enhancements.</p> <p>Approaching design through the lens of experience layers is <em>the</em> design strategy for the Web; one that’s better for users and designers alike.</p> <p>Many thanks to <a href="http://trevordavis.net/">Trevor Davis</a> for reviewing an early draft of this post.</p>