Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RWD Techniques Workshop

RWD Techniques Workshop

Deck from my half-day workshop on responsive web design techniques in Salt Lake City on July 29, 2013.

Ben Callahan

July 29, 2013
Tweet

More Decks by Ben Callahan

Other Decks in Design

Transcript

  1. For the Type-A Personalities ‣ Getting Started with RWD ‣

    RWD Workflow ‣ Creating Flexibility ‣ RWD Retrofitting ‣ Lessons Learned ‣ Future of RWD Monday, July 29, 13
  2. 177% increase in tablet ownership since last year In the

    US... http://bit.ly/YFW4Ai Monday, July 29, 13
  3. 80% of consumers multi-task with other devices while watching TV

    In the US... http://bit.ly/YFW4Ai Monday, July 29, 13
  4. Q1 2013 conversions on tablets surpassed conversions on traditional desktops

    http://bit.ly/sNpLte In the US... Monday, July 29, 13
  5. The penetration of desktop ownership is the same today as

    it was in 2007. http://bit.ly/zE1zgp In the US... Monday, July 29, 13
  6. Mobile vs Desktop Browsing 0 500 1000 1500 2000 2007

    2008 2009 2010 2011 2012 2013 2014 2015 Mobile Users Desktop Users http://bit.ly/L5cqiO Monday, July 29, 13
  7. 0 500 1000 1500 2000 2007 2008 2009 2010 2011

    2012 2013 2014 2015 Mobile Users Desktop Users http://bit.ly/L5cqiO Not that far away Monday, July 29, 13
  8. RWD 101 ‣ Three Core Techniques - A Fluid Foundation

    - Flexible Content - Media Queries Monday, July 29, 13
  9. A Fluid Foundation Honor the proportions of the design by

    creating percentage-based layout instead of fixed-width, pixel-based layout. Monday, July 29, 13
  10. Flexible Content Once we have a layout which is based

    on proportions, the content must also respond. Monday, July 29, 13
  11. Media Queries When our content and our design are no

    longer working in harmony, we need to make a larger shift in layout. Monday, July 29, 13
  12. RWD 101 ‣ Three Core Techniques - A Fluid Foundation

    - Flexible Content - Media Queries Monday, July 29, 13
  13. Ditto! Now with RWD! Linear Workflow CONTENT UX DESIGN FRONT-END

    BACK-END LAUNCH! Me too! Monday, July 29, 13
  14. Linear Workflow Problem LAUNCH DESIGN FRONT END BACK END CONTENT

    DECISIONS MADE DECISIONS MADE DECISIONS MADE DECISIONS MADE Monday, July 29, 13
  15. http://www.zeldman.com/2007/07/02/let-there-be-web-divisions/ “...[A]lmost no one who makes websites works in their

    company or organization’s web division. That’s because almost no company or organization has a web division. And that void on the org chart is one reason we have so many bloated, unusable failures where we should be producing great user experiences.” @zeldman, 2007 Monday, July 29, 13
  16. LAUNCH DESIGN FRONT END BACK END CONTENT DECISIONS MADE DECISIONS

    MADE DECISIONS MADE DECISIONS MADE CONTENT UX FRONT-END DESIGN BACK-END Monday, July 29, 13
  17. LAUNCH DESIGN FRONT END BACK END CONTENT DECISIONS MADE DECISIONS

    MADE DECISIONS MADE DECISIONS MADE CONTENT UX FRONT-END DESIGN BACK-END UX FRONT-END DESIGN LAUNCH DESIGN FRONT END BACK END CONTENT DECISIONS MADE DECISIONS MADE DECISIONS MADE DECISIONS MADE Monday, July 29, 13
  18. ND DESIGN So, how do we advance design through a

    “1 deliverable” workflow? Monday, July 29, 13
  19. DISSECTING DESIGN ‣ Style Comparisons ‣ Style Tiles ‣ Style

    Prototypes Establish the Aesthetic Monday, July 29, 13
  20. Style Comparisons ESTABLISH THE AESTHETIC “I could create an illustration

    or a 3D rendering of what I want my new office to look like, but that doesn’t take advantage of his great ideas. It’s dictation, not collaboration. Instead, I show him a Pinterest board my wife and I created.” @danielmall http://danielmall.com/articles/the-post-psd-era/ Monday, July 29, 13
  21. DISSECTING DESIGN ‣ Static Design Tools ‣ Responsive Design Tools

    ‣ HTML/CSS Solve the Problem Monday, July 29, 13
  22. Don’t Use Static Design Tools REFINE THE SOLUTION LAUNCH DESIGN

    FRONT END BACK END CONTENT DECISIONS MADE DECISIONS MADE DECISIONS MADE DECISIONS MADE Monday, July 29, 13
  23. You don’t want to do the long tail more than

    once REFINE THE SOLUTION Monday, July 29, 13
  24. Establish Solve Refine ............. Style Prototype ....... Sketching + PSD

    + CSS ............ In-Browser Pairing Tools we use at Sparkbox Monday, July 29, 13
  25. CONTENT How do we prioritize content & functionality through a

    “one deliverable” workflow? Monday, July 29, 13
  26. Group improvisation is a challenge. Aside from the weighty technical

    problem of collective coherent thinking, there is the very human, even social need for sympathy from all members to bend for the common result. Bill Evans Monday, July 29, 13
  27. Group improvisation is a challenge. Aside from the weighty technical

    problem of collective coherent thinking, there is the very human, even social need for sympathy from all members to bend for the common result. Bill Evans Monday, July 29, 13
  28. Group improvisation is a challenge. Aside from the weighty technical

    problem of collective coherent thinking, there is the very human, even social need for sympathy from all members to bend for the common result. Bill Evans Monday, July 29, 13
  29. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  30. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  31. body { width: 1000px; } div.main { width: 700px; }

    aside { width: 280px; } It starts with the grid body { width: 100%; } div.main { width: 70%; } aside { width: 28%; } Monday, July 29, 13
  32. body { width: 1000px; } div.main { width: 700px; }

    It starts with the grid body { width: 100%; } div.main { width: 70%; } target / context = % 700 / 1000 = .7 .7 = 70% Monday, July 29, 13
  33. body { width: 1000px; } aside { width: 280px; }

    It starts with the grid body { width: 100%; } aside { width: 28%; } target / context = % 280 / 1000 = .28 .28 = 28% Monday, July 29, 13
  34. CREATING FLEXIBILITY RWD Grid Systems ‣ Foundation ‣ Bootstrap ‣

    Skeleton ‣ Responsive.gs ‣ Columnal ‣ ...this list goes on, and on, and on Monday, July 29, 13
  35. @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header {

    @include column(12); } article { @include column(12); } aside { @include column(12); } @media (min-width: 38em) { article { @include column(8); } aside { @include column(4); } } Semantic.gs Monday, July 29, 13
  36. @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header {

    @include column(12); } article { @include column(12); } aside { @include column(12); } @media (min-width: 38em) { article { @include column(8); } aside { @include column(4); } } Semantic.gs Monday, July 29, 13
  37. Semantic.gs @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header

    { @include column(12); } article { @include column(12); } aside { @include column(12); } @media (min-width: 38em) { article { @include column(8); } aside { @include column(4); } } Monday, July 29, 13
  38. Semantic.gs @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header

    { @include column(12); } article { @include column(12); } aside { @include column(12); } @media (min-width: 38em) { article { @include column(8); } aside { @include column(4); } } Monday, July 29, 13
  39. Semantic.gs @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header

    { @include column(12); } article { @include column(12); } aside { @include column(12); } @media (min-width: 38em) { article { @include column(8); } aside { @include column(4); } } Monday, July 29, 13
  40. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  41. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Monday, July 29, 13
  42. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Monday, July 29, 13
  43. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Monday, July 29, 13
  44. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Monday, July 29, 13
  45. There are many, many combinations of these basic ideas http://bit.ly/U4N5qH

    (http://bradfrost.github.com/this-is-responsive/patterns.html) Monday, July 29, 13
  46. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  47. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Monday, July 29, 13
  48. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Monday, July 29, 13
  49. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Monday, July 29, 13
  50. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Monday, July 29, 13
  51. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  52. CREATING FLEXIBILITY Image: Bandwidth As of March of 2012, 86%

    of the sites on mediaqueri.es demonstrated the same weight and load time at resolutions from 300ish to 1200ish. via @guypod http://www.guypo.com/mobile/performance-implications-of- responsive-design-book-contribution/ Monday, July 29, 13
  53. CREATING FLEXIBILITY Image: Pixel Density Most new mobile devices have

    high pixel density displays: Apple iPhone 4+: 326 PPI Amazon Kindle Fire HD 8.9: 254 PPI Nokia Lumia 920: 332 PPI BlackBerry Z10: 356 PPI Samsung Galaxy Note: 285 PPI Monday, July 29, 13
  54. CREATING FLEXIBILITY The image solution(s) ‣ SVG ‣ Icon fonts

    ‣ Pixel-density media queries ‣ Compressive ‣ Picturefill ‣ User preference Monday, July 29, 13
  55. SVG (Scalable Vector Graphics) ‣ Allows the image to be

    resolution independent. ‣ Support isn’t very good for older browsers. ‣ We can use Modernizr to detect if the browser supports SVG and provide a .png fallback for those that do not. Monday, July 29, 13
  56. Icon Fonts ‣ Fonts by default are resolution independent, Icon

    fonts are no different. ‣ http://icomoon.io/app/ allows you to create your own icon fonts ‣ They do require a bit more markup, and JS for IE 7 and lower. Monday, July 29, 13
  57. <!--html--> <a href="#" class="search-toggle"> <span aria-hidden="true" data-icon="&#xe009;"></span> <span class="screen-reader">Search</span> </a>

    Icon Font Markup /*.scss*/ [data-icon]:before { content: attr(data-icon); font-family: 'icon-font-family'; speak: none; } Monday, July 29, 13
  58. “Compressive” Images ‣ http://bit.ly/Sygdey ‣ Increase the image dimensions ‣

    Add massive compression ‣ Scale the image in the browser Monday, July 29, 13
  59. Pixel Density MQs ‣ Detect the pixel ratio of the

    device and serve a second, higher-res image. ‣ Retina devices now have to make an additional request for the retina asset. Monday, July 29, 13
  60. /*.scss*/ @media only all and (-webkit-min-device-pixel-ratio: 1.5) { .logo {

    background-image: url(/i/logo-2x.png); background-size: 100%; } } Pixel Density MQs Also need other browser prefixes Monday, July 29, 13
  61. User Preference ‣ Allow the user to choose what experience

    they would like to have on their device: “HD” or “SD”. Monday, July 29, 13
  62. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  63. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Monday, July 29, 13
  64. @BENCALLAHAN What is a Retrofit? Finding the fastest and lowest-risk

    approach to creating a better experience on an existing site for users of any size screen. RESPONSIVE RETROFITTING Monday, July 29, 13
  65. @BENCALLAHAN What is a Retrofit? 1. How to do it.

    RESPONSIVE RETROFITTING Monday, July 29, 13
  66. @BENCALLAHAN What is a Retrofit? 1. How to do it.

    2. Managing your client. RESPONSIVE RETROFITTING Monday, July 29, 13
  67. @BENCALLAHAN @klayon ...performance is important, but access is more important.

    Mobile later is better than mobile never. From “Responsive images for mobile: don’t sweat it” (http://tiny.cc/vr24gw) RESPONSIVE RETROFITTING Monday, July 29, 13
  68. @BENCALLAHAN Retrofitting Techniques: From Fixed to Fluid ➡ Demo of

    Twitter.com http://www.alistapart.com/articles/fluidgrids/ target  /  context  =  result RESPONSIVE RETROFITTING Monday, July 29, 13
  69. @BENCALLAHAN Retrofitting Techniques: From Fixed to Fluid ➡ Demo of

    Twitter.com http://www.alistapart.com/articles/fluidgrids/ target  /  context  =  result 302  /  837  =  36.08% 522  /  837  =  62.37% RESPONSIVE RETROFITTING Monday, July 29, 13
  70. @BENCALLAHAN Retrofitting Techniques: From Fixed to Fluid ➡ Demo of

    Twitter.com http://paulirish.com/2012/box-sizing-border-box-ftw/ *  {      -­‐moz-­‐box-­‐sizing:  border-­‐box;      -­‐webkit-­‐box-­‐sizing:  border-­‐box;      box-­‐sizing:  border-­‐box; } RESPONSIVE RETROFITTING Monday, July 29, 13
  71. @BENCALLAHAN Retrofitting Techniques: From Fixed to Fluid ➡ Demo of

    Twitter.com /*  some  css  */ @media  (max-­‐width:  500px)  {      /*  css  for  500px  and  lower  */ } RESPONSIVE RETROFITTING Monday, July 29, 13
  72. @BENCALLAHAN Retrofitting Techniques: Inline Image Styles ➡ Support ‣ FireFox

    5+ Win/Mac ‣ IE7+ (exception: IE8 & min-width) ‣ Chrome 14+ Win/Mac ‣ Safari 4+ Win, 5+ Mac ‣ Opera 10+ Win, 11+ Mac ‣ Mobile Safari (iOS 5) ‣ Android Browser 2.3+ RESPONSIVE RETROFITTING Monday, July 29, 13
  73. @BENCALLAHAN Retrofitting Techniques: Background Images Tim Kadlec on timkadlec.com “Media

    Query & Asset Downloading Results” ‣ display: none on parent element ‣ specify all background images inside media queries http://timkadlec.com/2012/04/media-query-asset-downloading-results/ RESPONSIVE RETROFITTING Monday, July 29, 13
  74. @BENCALLAHAN Retrofitting Techniques: Media Queries ➡ Large Resolution First ➡

    Small Resolution First, Capped RESPONSIVE RETROFITTING Monday, July 29, 13
  75. @BENCALLAHAN Retrofitting Techniques: Media Queries ➡ Large Resolution First /*

     FILE:  main.css  */ /*  all  your  original  styles  */ @media  (max-­‐width:  53em)  {    /*  styles  for  53em  and  lower  */ } @media  (max-­‐width:  37em)  {    /*  styles  for  37em  and  lower  */ } RESPONSIVE RETROFITTING Monday, July 29, 13
  76. @BENCALLAHAN Retrofitting Techniques: Media Queries ➡ Small Resolution First, Capped

    ‣ Serve the original CSS to large viewports ‣ Serve mobile-first CSS to small viewports ‣ No changes to original CSS RESPONSIVE RETROFITTING Monday, July 29, 13
  77. @BENCALLAHAN Retrofitting Techniques: Media Queries ➡ Small Resolution First, Capped

    <html  class=”no-­‐js”> <head>    <script  src=”/js/modernizr.js”></script>    <script>        yepnope({            test  :  Modernizr.mq(‘(min-­‐width:  0px)’),            yep    :  ‘base.css’,            nope  :  ‘original.css’        });      </script>    <noscript>        <link  rel="stylesheet"  href="original.css">    </noscript> </head> RESPONSIVE RETROFITTING Monday, July 29, 13
  78. @BENCALLAHAN Retrofitting Techniques: Media Queries ➡ Small Resolution First, Capped

    @media (max-width: 979px) { @import "small"; } @media (min-width: 661px) and (max-width: 979px) { @import "medium"; } @media (min-width: 980px) { @import "original"; } RESPONSIVE RETROFITTING Monday, July 29, 13
  79. @BENCALLAHAN Client Interaction: Great Need Big Companies + No Mobile

    Presence + Triple Digit Growth = Anxious Clients RESPONSIVE RETROFITTING Monday, July 29, 13
  80. @BENCALLAHAN Client Interaction: Great Need Less than Half the Cost

    + Less than Half the Time + Increased Conversions = Desperate Clients RESPONSIVE RETROFITTING Monday, July 29, 13
  81. @BENCALLAHAN Client Interaction: When It’s Right ➡ Evaluate the Project

    ‣ Solid UX at higher widths? ‣ Semantic markup? ‣ Immediate need? ‣ Real benefit for the user? RESPONSIVE RETROFITTING Monday, July 29, 13
  82. @BENCALLAHAN Client Interaction: Proceed Carefully Retrofitting is a step in

    the right direction. RESPONSIVE RETROFITTING Monday, July 29, 13
  83. @BENCALLAHAN Constantly remind them of the user. Client Interaction: Proceed

    Carefully RESPONSIVE RETROFITTING Monday, July 29, 13
  84. @BENCALLAHAN When you’re done and they ask for more... Client

    Interaction: Proceed Carefully ...push for even better experiences! RESPONSIVE RETROFITTING Monday, July 29, 13
  85. LESSONS LEARNED Testing ‣ You must test on real devices

    ‣ Do your development in a webkit browser ‣ Bulid libraries of your patterns Monday, July 29, 13
  86. LESSONS LEARNED Pricing ‣ As much as 100% more, initially

    ‣ Likely to be 50% more, soon after ‣ Probably never less than 25% more Monday, July 29, 13
  87. LESSONS LEARNED Pricing ‣ As much as 100% more, initially

    ‣ Likely to be 50% more, soon after ‣ Probably never less than 25% more COMPARED TO WHAT? Monday, July 29, 13
  88. LESSONS LEARNED Pricing ‣ Testing (labs & time) ‣ Fewer

    patterns ‣ Project management ‣ Learning curve ‣ Maintenance ‣ Content strategy Monday, July 29, 13
  89. LESSONS LEARNED Performance ‣ Optimize or cut out images ‣

    Decrease the number of requests ‣ Gzip if you can ‣ Concat and minify CSS/JS ‣ Load CSS at the top ‣ Load JS at the bottom ‣ Follow @souders on Twitter Monday, July 29, 13
  90. LESSONS LEARNED Barriers ‣ Organization barriers block collaboration ‣ Must

    have buy in from upper management ‣ Must have buy in from those doing the work ‣ It’s not easy, we’re still figuring it out Monday, July 29, 13
  91. Simplicity “Simplicity isn’t just a visual style. It’s not just

    minimalisim or the absence of clutter...You have deeply understand the essence of a product in order to be able to get rid of the parts that are not essential.” Jony Ive Monday, July 29, 13
  92. The Responsive Mindset “The truly responsive design web designer wasn’t

    born until after the launch of the iPhone. We haven’t seen his or her work yet.” Andy Clarke http://the-pastry-box-project.net/andy-clarke/2012-april-8/ Monday, July 29, 13
  93. There are many problems left to solve. We’ll solve them

    much faster if we solve them together. Monday, July 29, 13