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

Build Responsively, 2013, Artifact, Austin, TX

Build Responsively, 2013, Artifact, Austin, TX

The deck from Sparkbox's Build Responsively workshop at Artifact Conference in Austin, Texas.

Ben Callahan

May 15, 2013
Tweet

More Decks by Ben Callahan

Other Decks in Design

Transcript

  1. The penetration of desktop & laptop ownership is the same

    today as it was in 2007. http://bit.ly/zE1zgp In the US... Tuesday, May 28, 13
  2. 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 Tuesday, May 28, 13
  3. Not that far away 0 500 1000 1500 2000 2007

    2008 2009 2010 2011 2012 2013 2014 2015 Mobile Users Desktop Users http://bit.ly/L5cqiO Tuesday, May 28, 13
  4. RWD 101 ‣ Three Core Techniques - A Fluid Foundation

    - Flexible Content - Media Queries Tuesday, May 28, 13
  5. A Fluid Foundation Honor the proportions of the design by

    creating percentage-based layout instead of fixed-width, pixel-based layout. Tuesday, May 28, 13
  6. Flexible Content Once we have a layout which is based

    on proportions, the content must also respond. Tuesday, May 28, 13
  7. Media Queries When our content and our design are no

    longer working in harmony, we need to make a larger shift in layout. Tuesday, May 28, 13
  8. RWD 101 ‣ Three Core Techniques - A Fluid Foundation

    - Flexible Content - Media Queries Tuesday, May 28, 13
  9. A SHIFT IN MINDSET Traditional Linear Workflow DESIGN FRONT-END BACK-END

    LAUNCH! TH IN K A B O U T U SER S Tuesday, May 28, 13
  10. A SHIFT IN MINDSET Traditional Linear Workflow DESIGN FRONT-END BACK-END

    LAUNCH! TH IN K A B O U T U SER S TH R O W IN C O N TEN T Tuesday, May 28, 13
  11. A SHIFT IN MINDSET Slightly Better Linear Workflow CONTENT UX

    DESIGN FRONT-END BACK-END LAUNCH! Tuesday, May 28, 13
  12. A SHIFT IN MINDSET Linear Workflow CONTENT UX DESIGN FRONT-END

    BACK-END LAUNCH Now with RWD! Tuesday, May 28, 13
  13. Now with RWD! A SHIFT IN MINDSET Linear Workflow CONTENT

    UX DESIGN FRONT-END BACK-END LAUNCH Me too! Ditto! Tuesday, May 28, 13
  14. Jakob Nielsen Says... ‣ Build a separate mobile site ‣

    Cut features ‣ Cut content http://www.nngroup.com/articles/mobile-site-vs-full-site/ Tuesday, May 28, 13
  15. Jakob Nielsen Says... ‣ Build a separate mobile site ‣

    Cut features ‣ Cut content http://www.nngroup.com/articles/mobile-site-vs-full-site/ PLEASE, NO. Tuesday, May 28, 13
  16. Phased Release BACK-END FRONT-END DESIGN C O NTENT UX DELIVERABLE

    DELIVERABLE DELIVERABLE DELIVERABLE DELIVERABLE DELIVERABLE RELEASE RELEASE Tuesday, May 28, 13
  17. A SHIFT IN MINDSET A Responsive Workflow ‣ Pros -

    Natural Decisions - Encourages Collaboration - Encourages Iteration - Better Results Tuesday, May 28, 13
  18. A SHIFT IN MINDSET A Responsive Workflow ‣ Cons -

    Requires Change - May Conflict with Organizational Structure - Dependent on Team Make-up Tuesday, May 28, 13
  19. A SHIFT IN PROCESS A Process Myth Each client deliverable

    needs to look more like a final, beautiful end-product than the previous one. Tuesday, May 28, 13
  20. A SHIFT IN PROCESS Which Results In Pushing toward nearly-designed

    wireframes quickly and completely designed comps soon after. (This sets up all sorts of unrealistic client expectations.) Tuesday, May 28, 13
  21. A SHIFT IN PROCESS A Better Approach Deliverables that best

    serve the organization and prioritization of content and function across multiple resolutions. (Not deliverables made just to impress clients.) Tuesday, May 28, 13
  22. A SHIFT IN PROCESS Our Deliverables ‣ Research Deliverables ‣

    Content Deliverables ‣ Priority Deliverables ‣ Style Deliverables ‣ Functional Deliverables Tuesday, May 28, 13
  23. A SHIFT IN PROCESS Let’s Focus On... ‣ Research Deliverables

    ‣ Content Deliverables ‣ Priority Deliverables ‣ Style Deliverables ‣ Functional Deliverables Tuesday, May 28, 13
  24. A SHIFT IN PROCESS Priority Deliverables ‣ Content Priority Prototypes

    - Takes the place of a traditional wireframe. - As much real content as you can. - Linear in nature, priority implied. - Possibly created in HTML, viewed in a browser. - Generated by content/UX people. Tuesday, May 28, 13
  25. A SHIFT IN PROCESS Priority Deliverables ‣ Content Priority Examples

    - Non HTML examples • Smashing Article: Design Process In The Responsive Age - HTML example • building.seesparkbox.com Tuesday, May 28, 13
  26. A SHIFT IN PROCESS Style Deliverables ‣ Style Prototype -

    Like Style Tiles, but in the browser (styletil.es). - Very fast to build. - Accurate web typography. - Easy to show web interaction. - Client reviews in their browser of preference. Tuesday, May 28, 13
  27. A SHIFT IN PROCESS Style Deliverables ‣ Style Prototype Examples

    - building.seesparkbox.com • new Sparkbox web style prototype - dressresponsively.com • dress responsively style prototype Tuesday, May 28, 13
  28. SECTION HEADER Other Style Deliverables ‣ Element Collages (Dan Mall)

    ‣ Style Tiles (Samantha Warren) ‣ Photoshop Comps (Everyone) Tuesday, May 28, 13
  29. A SHIFT IN PROCESS Use What The Project Needs ‣

    Research Deliverables ‣ Content Deliverables ‣ Priority Deliverables ‣ Style Deliverables ‣ Functional Deliverables Tuesday, May 28, 13
  30. Discussion ‣ What happens next in this process? ‣ How

    are you doing RWD design deliverables now? ‣ What are you struggling with? Tuesday, May 28, 13
  31. SERVING RWD STYLES Major Approaches ‣ Single CSS File ‣

    Multiple CSS Files ‣ Breakpoint Based Partials ‣ Module Based Partials Tuesday, May 28, 13
  32. Before any of this stuff will work, you need to

    do this: <!-- html --> <meta name="viewport" content="width=device-width; initial-scale=1.0;"> Tuesday, May 28, 13
  33. And, you should also do this: /* CSS */ @-webkit-viewport

    { width:device-width; } @-moz-viewport { width:device-width; } @-ms-viewport { width:device-width; } @-o-viewport { width:device-width; } @viewport { width:device-width; } Tuesday, May 28, 13
  34. SERVING RWD STYLES Major Approaches ‣ Single CSS File ‣

    Multiple CSS Files ‣ Breakpoint Based Partials ‣ Module Based Partials Tuesday, May 28, 13
  35. Single CSS File HTML <link> CSS Start with styles applied

    to all Styles scoped to a media query Styles scoped to another media query Tuesday, May 28, 13
  36. /* styles.css */ aside { color: #333; width: 100%; }

    Single CSS File Tuesday, May 28, 13
  37. /* styles.css */ aside { color: #333; width: 100%; }

    /* if the viewport width is 40em or greater */ Single CSS File Tuesday, May 28, 13
  38. <!-- In your HTML --> <link media=”(min-width: 30em)” ... <link

    media=”screen and (max-width: 80em)” ... /* In your CSS */ @media (min-width: 30em) { ... } @media screen and (max-width: 80em) { ... } Media Queries Tuesday, May 28, 13
  39. <!-- In your HTML --> <link media=”(min-width: 30em)” ... <link

    media=”screen and (max-width: 80em)” ... /* In your CSS */ @media (min-width: 30em) { ... } @media screen and (max-width: 80em) { ... } Media Types Tuesday, May 28, 13
  40. Media Types all braille, embossed, speech handheld, projection, screen, tv

    print tty http://www.w3.org/TR/CSS21/media.html#media-types Tuesday, May 28, 13
  41. <!-- In your HTML --> <link media=”(min-width: 30em)” ... <link

    media=”screen and (max-width: 80em)” ... /* In your CSS */ @media (orientation: portrait) { ... } @media screen and (color) { ... } Media Features Tuesday, May 28, 13
  42. Media Features width, height device-width, device-height orientation aspect-ratio, device-aspect-ratio color,

    color-index, monochrome resolution, scan, grid http://www.w3.org/TR/css3-mediaqueries Tuesday, May 28, 13
  43. Single CSS File HTML <link> CSS Start with styles applied

    to all Styles scoped to a media query Styles scoped to another media query Tuesday, May 28, 13
  44. Small Viewport Width First HTML <link> CSS Smallest styles Wider

    styles (mq) Even wider styles (mq) Super wide styles (mq) Tuesday, May 28, 13
  45. Large Viewport Width First HTML <link> CSS Widest styles Wide

    styles (mq) Narrow styles (mq) Very narrow styles (mq) Tuesday, May 28, 13
  46. /* styles.css */ aside { color: #333; width: 100%; }

    /* if the viewport width is 40em or greater */ Single CSS File Tuesday, May 28, 13
  47. /* styles.css */ aside { color: #333; width: 100%; }

    /* if the viewport width is 40em or greater */ @media (min-width: 40em) { aside { width: 50%; } } Single CSS File Tuesday, May 28, 13
  48. /* styles.css */ aside { color: #333; width: 100%; }

    /* if the viewport width is 40em or greater */ @media (min-width: 40em) { aside { width: 50%; } } Single CSS File Tuesday, May 28, 13
  49. /* styles.css */ aside { color: #333; width: 100%; }

    /* if the viewport width is 40em or greater */ @media (min-width: 40em) { aside { width: 50%; } } /* if the viewport width is 60em or greater */ @media (min-width: 60em) { aside { width: 30%; } } Single CSS File Tuesday, May 28, 13
  50. Single CSS File /* styles.css */ aside { color: #333;

    width: 100%; } /* if the viewport width is 40em or greater */ @media (min-width: 40em) { aside { width: 50%; } } /* if the viewport width is 60em or greater */ @media (min-width: 60em) { aside { width: 30%; } } Small Viewport Width First Tuesday, May 28, 13
  51. /* styles.css */ aside { color: #333; width: 30%; }

    /* if the viewport width is 60em or less */ @media (max-width: 60em) { aside { width: 50%; } } /* if the viewport width is 40em or less */ @media (min-width: 40em) { aside { width: 100%; } } Single CSS File Large Viewport Width First Tuesday, May 28, 13
  52. SERVING RWD STYLES Single CSS File ‣ Simple to implement

    ‣ Single request ‣ Doesn’t require a preprocessor ‣ Requires JS to serve large layout to old IE if starting with small layouts ‣ Large sites can be difficult to maintain because of the size of the single file Tuesday, May 28, 13
  53. SERVING RWD STYLES Major Approaches ‣ Single CSS File ‣

    Multiple CSS Files ‣ Breakpoint Based Partials ‣ Module Based Partials Tuesday, May 28, 13
  54. Multiple CSS Files HTML <link> If this browser is less

    than IE9... and it’s not IE Mobile... and viewport width is at least 40em... <link> global.css all styles linear layout layout.css only styles for layout http://adactio.com/journal/4494/ Tuesday, May 28, 13
  55. Multiple CSS Files index.html <link href=”global.css” rel=”stylesheet”> <link href=”layout.css” media=”(min-width:

    40em)” rel=”stylesheet”> <!--[if (lt IE 9) & (!IEMobile)]> <link href=”layout.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  56. Multiple CSS Files index.html <link href=”global.css” rel=”stylesheet”> <link href=”layout.css” media=”(min-width:

    40em)” rel=”stylesheet”> <!--[if (lt IE 9) & (!IEMobile)]> <link href=”layout.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  57. Multiple CSS Files index.html <link href=”global.css” rel=”stylesheet”> <link href=”layout.css” media=”(min-width:

    40em)” rel=”stylesheet”> <!--[if (lt IE 9) & (!IEMobile)]> <link href=”layout.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  58. Multiple CSS Files index.html <link href=”global.css” rel=”stylesheet”> <link href=”layout.css” media=”(min-width:

    40em)” rel=”stylesheet”> <!--[if (lt IE 9) & (!IEMobile)]> <link href=”layout.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  59. Multiple CSS Files index.html <link href=”global.css” rel=”stylesheet”> <link href=”layout.css” media=”(min-width:

    40em)” rel=”stylesheet”> <!--[if (lt IE 9) & (!IEMobile)]> <link href=”layout.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  60. Multiple CSS Files global.css aside { color: #333; width: 100%;

    } layout.css aside { width: 50%; } @media (min-width: 60em) { aside { width: 30%; } } Tuesday, May 28, 13
  61. Multiple CSS Files global.css aside { color: #333; width: 100%;

    } layout.css aside { width: 50%; } @media (min-width: 60em) { aside { width: 30%; } } Tuesday, May 28, 13
  62. SERVING RWD STYLES Multiple CSS Files ‣ Doesn’t require a

    preprocessor ‣ At least two requests ‣ Requires you to separate layout from other styles ‣ Allows you to start with small layouts and serve a single large layout to old IE without JS - Requests go up if you use multiple MQs Tuesday, May 28, 13
  63. SERVING RWD STYLES Major Approaches ‣ Single CSS File ‣

    Multiple CSS Files ‣ Breakpoint Based Partials ‣ Module Based Partials Tuesday, May 28, 13
  64. Breakpoint Based Partials HTML <link> If this browser is less

    than IE9... and it’s not IE Mobile... <link> base.css all styles/MQ blocks no-mq.css MQ styles from base without the MQs http://nicolasgallagher.com/mobile-first-css-sass-and-ie/ Tuesday, May 28, 13
  65. Breakpoint Based Partials index.html <link href=”base.css” rel=”stylesheet”> <!--[if (lt IE

    9) & (!IEMobile)]> <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> Tuesday, May 28, 13
  66. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  67. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  68. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  69. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  70. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  71. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  72. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  73. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  74. Similarities ‣ All accept CSS syntax, plus their own specific

    syntax. ‣ All improve CSS by adding variables, importing, mixins, and nesting ‣ All three seek to make CSS authoring a better and more efficient process Tuesday, May 28, 13
  75. LESS ‣ Runs on Node.js ‣ Very similar syntax to

    SASS ‣ http://lesscss.org/ Tuesday, May 28, 13
  76. Variables are specified with @ symbol /* .less */ @top-variable:

    20px; ! #header-shadow { ! position: absolute; ! ! top: @top-variable; ! } LESS syntax Tuesday, May 28, 13
  77. Stylus ‣ Runs on Node.js ‣ Has a flexible syntax

    - You can omit semi-colons, colons, and braces ‣ http://learnboost.github.com/ stylus/ Tuesday, May 28, 13
  78. /* .styl */ top-variable = 20px ! #main-header ! position

    absolute ! ! top top-variable #footer { ! background: blue ! ! border 1px solid #00f; } Notice the terse, forgiving syntax. Stylus Syntax Tuesday, May 28, 13
  79. SASS ‣ Runs on Ruby ‣ Has two syntax flavors

    - .scss & .sass ‣ http://sass-lang.com/ Tuesday, May 28, 13
  80. $main-color: blue /* .scss */ #main { color: $main-color; font-size:

    0.3em; } /* .sass */ #main color: $main-color font-size: 0.3em SASS Sytax Tuesday, May 28, 13
  81. /* .scss */ .food-list { list-style: none; li { font-size:

    1rem; a { color: red; } } } Nesting /* .css */ .food-list { list-style: none; } .food-list li { font-size: 1rem; } .food-list li a { color: red; } Tuesday, May 28, 13
  82. Nesting can be abused. /* This is bad. Don’t do

    it. */ html body #main div.primary .big-header { font-size: 2em; } ! Tuesday, May 28, 13
  83. Nesting can be abused. /* This is bad. Don’t do

    it. */ html body #main div.primary .big-header { font-size: 2em; } ! Tuesday, May 28, 13
  84. /*.scss*/ @mixin border-radius( $value : 10px ) { ! -webkit-border-radius:

    $value; ! -moz-border-radius: $value; ! ! ! border-radius: $value; } Mixins .btn{ @include border-radius(25px); } Tuesday, May 28, 13
  85. Mixins ‣ SASS and Stylus both support basic programming like

    loops, if/ else, etc. in mixins. ‣ LESS only offers “guarded mixins.” Tuesday, May 28, 13
  86. Compass & Bourbon ‣ Compass and Bourbon are mixin libraries

    for SASS ‣ Takes care of vendor prefixes with mixins ‣ Compass has an ecosystem of plugins built on top of Compass. ‣ With config.rb, Compass lets you check the preprocessor config into source control. Tuesday, May 28, 13
  87. Importing ‣ Allows you to break up your styles across

    files. - variables, mixins, reset, all separated. ‣ Better than a standard css import Tuesday, May 28, 13
  88. this file will compile to base.css /* base.scss */ @import

    "compass"; @import "variables"; @import "reset"; @import "mixins"; @import "header"; @import "hero"; @import "whatever"; Importing Tuesday, May 28, 13
  89. Extends ‣ Extends allow you to reuse styles between various

    selectors. ‣ DRY Principle applied to CSS Tuesday, May 28, 13
  90. .btn { color: red; border-radius: 25px; } .btn-small { @extend

    .btn; font-size: .5rem; } Extends .btn, .btn-small { color: red; border-radius: 25px; } .btn-small { font-size: .5rem; } Tuesday, May 28, 13
  91. .btn { color: red; border-radius: 25px; } .btn-small { @extend

    .btn; font-size: .5rem; } Extends .btn, .btn-small { color: red; border-radius: 25px; } .btn-small { font-size: .5rem; } Tuesday, May 28, 13
  92. Source Maps ‣ Using pre-processors does present some new challenges.

    ‣ Line-numbers are no longer representative of where the code is. Tuesday, May 28, 13
  93. Source Maps ‣ Source maps let Chrome know the source

    of the generated CSS. Tuesday, May 28, 13
  94. Setup Chrome for SASS Source Maps Support ‣ head over

    to chrome://flags - Enable Developer Tools Experiments Tuesday, May 28, 13
  95. Setup Chrome for SASS Source Maps Support ‣ Enable Support

    for SASS in the Dev Tools options Tuesday, May 28, 13
  96. The last step is to turn on debug info in

    our CSS /* config.rb */ sass_options = { :debug_info => true } or /* command line */ sass --watch -g scss/:css/ Setup Chrome for SASS Source Maps Support Tuesday, May 28, 13
  97. Breakpoint Based Partials base.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { width: 50%; } aside { width: 30%; } Tuesday, May 28, 13
  98. _40em.scss aside { width: 50%; } Breakpoint Based Partials base.scss

    @import “smallest”; @media (min-width: 40em) { @import “40em”; } @media (min-width: 60em) { @import “60em”; } no-mq.scss @import “40em”; @import “60em”; _60em.scss aside { width: 30%; } _smallest.scss aside { color: #333; width: 100%;} Tuesday, May 28, 13
  99. SERVING RWD STYLES Breakpoint Based Partials ‣ Allows you to

    start with small layouts and serve large layout to old IE without JS ‣ Only 1 or 2 requests ‣ Requires preprocessor ‣ Maintenance can be complex Tuesday, May 28, 13
  100. SERVING RWD STYLES Major Approaches ‣ Single CSS File ‣

    Multiple CSS Files ‣ Breakpoint Based Partials ‣ Module Based Partials Tuesday, May 28, 13
  101. HTML If < IE9 and not IE Mobile <link> If

    >= IE9 or IE Mobile <link> Module Based Partials no-mq.css All styles with no MQs mq.css All styles with MQs http://seesparkbox.com/foundry/there_is_no_breakpoint Tuesday, May 28, 13
  102. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  103. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  104. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  105. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  106. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  107. Module Based Partials index.html <!--[if (lt IE 9) & (!IEMobile)]>

    <link href=”no-mq.css” rel=”stylesheet”> <![endif]--> <!--[if (gte IE 9) | (IEMobile)]><!--> <link href=”mq.css” rel=”stylesheet”> <!--<![endif]--> Tuesday, May 28, 13
  108. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  109. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  110. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  111. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  112. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  113. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  114. Module Based Partials mq.css aside { color: #333; width: 100%;

    } @media (min-width: 40em) { aside { width: 50%; } } @media (min-width: 60em) { aside { width: 30%; } } no-mq.css aside { color: #333; width: 100%; width: 50%; width: 30%; } Tuesday, May 28, 13
  115. Module Based Partials mq.scss @import “compass”; @import “sb-media”; @import “aside”;

    @import “nav”; @import “footer”; ... no-mq.scss @import “compass”; @import “sb-media”; $sb-no-mq-support: true; @import “aside”; @import “nav”; @import “footer”; ... Tuesday, May 28, 13
  116. Module Based Partials mq.scss @import “compass”; @import “sb-media”; @import “aside”;

    @import “nav”; @import “footer”; ... no-mq.scss @import “compass”; @import “sb-media”; $sb-no-mq-support: true; @import “aside”; @import “nav”; @import “footer”; ... Tuesday, May 28, 13
  117. Module Based Partials mq.scss @import “compass”; @import “sb-media”; @import “aside”;

    @import “nav”; @import “footer”; ... no-mq.scss @import “compass”; @import “sb-media”; $sb-no-mq-support: true; @import “aside”; @import “nav”; @import “footer”; ... Tuesday, May 28, 13
  118. Module Based Partials mq.scss @import “compass”; @import “sb-media”; @import “aside”;

    @import “nav”; @import “footer”; ... no-mq.scss @import “compass”; @import “sb-media”; $sb-no-mq-support: true; @import “aside”; @import “nav”; @import “footer”; ... Tuesday, May 28, 13
  119. Module Based Partials _aside.scss aside { color: #333; width: 100%;

    @include sb-media(“min-width: 40em”) { width: 50%; } @include sb-media(“min-width: 60em”) { width: 30%; } } Tuesday, May 28, 13
  120. Module Based Partials _aside.scss aside { color: #333; width: 100%;

    @include sb-media(“min-width: 40em”) { width: 50%; } @include sb-media(“min-width: 60em”) { width: 30%; } } Tuesday, May 28, 13
  121. Module Based Partials _aside.scss aside { color: #333; width: 100%;

    @include sb-media(“min-width: 40em”) { width: 50%; } @include sb-media(“min-width: 60em”) { width: 30%; } } $sb-no-mq-support: true; Tuesday, May 28, 13
  122. Module Based Partials $default-­‐feature:  'min-­‐width:  '; $sb-­‐no-­‐mq-­‐support:  false  !default; @mixin

     sb-­‐media($query)  {    @if  type-­‐of(  $query  )  ==  'number'  {        $query:  $default-­‐feature  +  $query;    }    @if  $sb-­‐no-­‐mq-­‐support{        @content;    }  @else  {        @media  (  $query  )  {            @content;        }    } } https://github.com/sparkbox/SB-Media Tuesday, May 28, 13
  123. SERVING RWD STYLES Module Based Partials ‣ Single Request ‣

    Easy Maintenance ‣ Allows you to start with small layouts and serve large layout to old IE without JS ‣ Single request for all ‣ Requires Preprocessor Tuesday, May 28, 13
  124. There is no Breakpoint aside { // general styles //

    major shift at 40em // major shift at 60em ... } aside { // general styles // major shift at 40em // minor tweak at 42em // minor tweak at 53.5em // minor tweak at 56em // major shift at 60em // minor tweak at 72.2em // minor tweak at 74em ... } Tuesday, May 28, 13
  125. There is no Breakpoint aside { // general styles //

    major shift at 40em // major shift at 60em ... } aside { // general styles // major shift at 40em // minor tweak at 42em // minor tweak at 53.5em // minor tweak at 56em // major shift at 60em // minor tweak at 72.2em // minor tweak at 74em ... } Tuesday, May 28, 13
  126. Discussion ‣ How are you serving RWD styles today? ‣

    How do you “support” older IE? Tuesday, May 28, 13
  127. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  128. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  129. 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%; } Tuesday, May 28, 13
  130. 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% Tuesday, May 28, 13
  131. body { width: 1000px; } aside { width: 280px; }

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

    Skeleton ‣ Responsive.gs ‣ Columnal ‣ ...this list goes on, and on, and on Tuesday, May 28, 13
  133. @column-width: 60; @gutter-width: 20; @columns: 12; @total-width: 100%; header {

    .column(12); } article { .column(12); } aside { .column(12); } @media (min-width: 38em) { article { .column(8); } aside { .column(4); } } Semantic.gs Tuesday, May 28, 13
  134. @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 Tuesday, May 28, 13
  135. 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); } } Tuesday, May 28, 13
  136. 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); } } Tuesday, May 28, 13
  137. 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); } } Tuesday, May 28, 13
  138. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  139. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Tuesday, May 28, 13
  140. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Tuesday, May 28, 13
  141. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Tuesday, May 28, 13
  142. CREATING FLEXIBILITY Responsive Layout Patterns ‣ Source order stacking ‣

    Content choreography ‣ Off canvas Tuesday, May 28, 13
  143. There are many, many combinations of these basic ideas http://bit.ly/U4N5qH

    (http://bradfrost.github.com/this-is-responsive/patterns.html) Tuesday, May 28, 13
  144. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  145. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Tuesday, May 28, 13
  146. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Tuesday, May 28, 13
  147. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Tuesday, May 28, 13
  148. CREATING FLEXIBILITY Responsive Typography ‣ Small screen != small font-size

    ‣ Consider contrast ‣ If text has links, give adequate room to touch them Tuesday, May 28, 13
  149. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  150. 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/ Tuesday, May 28, 13
  151. 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 Tuesday, May 28, 13
  152. CREATING FLEXIBILITY The image solution(s) ‣ SVG ‣ Icon fonts

    ‣ Pixel-density media queries ‣ Compressive ‣ Picturefill ‣ User preference Tuesday, May 28, 13
  153. 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. Tuesday, May 28, 13
  154. 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. Tuesday, May 28, 13
  155. <!--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; } Tuesday, May 28, 13
  156. “Compressive” Images ‣ http://bit.ly/Sygdey ‣ Increase the image dimensions ‣

    Add massive compression ‣ Scale the image in the browser Tuesday, May 28, 13
  157. 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. Tuesday, May 28, 13
  158. /*.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 Tuesday, May 28, 13
  159. User Preference ‣ Allow the user to choose what experience

    they would like to have on their device: “HD” or “SD”. Tuesday, May 28, 13
  160. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  161. CREATING FLEXIBILITY What Needs to Flex ‣ Grids ‣ Layout

    ‣ Typography ‣ Images ‣ Tables ‣ Video Tuesday, May 28, 13
  162. Discussion ‣ What content types have we not addressed? ‣

    What specific challenges are you facing in creating flexibility? Tuesday, May 28, 13
  163. NAVIGATION AND RWD Major Issues ‣ Site Depth and Breadth

    ‣ Screen Real Estate ‣ Cross-width Consistency ‣ Interaction Patterns Tuesday, May 28, 13
  164. NAVIGATION AND RWD Major Issues ‣ Site Depth and Breadth

    ‣ Screen Real Estate ‣ Cross-width Consistency ‣ Interaction Patterns Tuesday, May 28, 13
  165. Simple Nav Examples ‣ Simple Row ‣ Jump to Content

    ‣ Jump to Footer ‣ Top Stacked Off Canvas Tuesday, May 28, 13
  166. Simple Nav Examples ‣ Simple Row ‣ Jump to Content

    ‣ Jump to Footer ‣ Top Stacked Off Canvas http://seesparkbox.com Tuesday, May 28, 13
  167. Simple Nav Examples ‣ Simple Row ‣ Jump to Content

    ‣ Jump to Footer ‣ Top Stacked Off Canvas http://forgeideas.com Tuesday, May 28, 13
  168. Simple Nav Examples ‣ Simple Row ‣ Jump to Content

    ‣ Jump to Footer ‣ Top Stacked Off Canvas http://contentsmagazine.com Tuesday, May 28, 13
  169. Simple Nav Examples ‣ Simple Row ‣ Jump to Content

    ‣ Jump to Footer ‣ Top Stacked Off Canvas http://2012.dconstruct.org/ Tuesday, May 28, 13
  170. Most sites have to work a bit harder to accommodate

    their content. Tuesday, May 28, 13
  171. Complex Nav Causes ‣ Large volume of content - Legacy

    content - Dynamic content ‣ Broad architecture - Lots of content types/categories ‣ Deep architecture - Lots of children and nesting Tuesday, May 28, 13
  172. Complex Nav Causes ‣ Large volume of content - Legacy

    content - Dynamic content ‣ Broad architecture - Lots of content types/categories ‣ Deep architecture - Lots of children and nesting DON’T GIVE UP. Tuesday, May 28, 13
  173. Before accommodating all the things, it’s not a cop- out

    to question the things. Tuesday, May 28, 13
  174. Complex Nav Causes ‣ Poor Information Architecture - Unnecessarily broad

    or deep due to inefficiency or poor planning ‣ Poor Content Strategy - Unnecessarily large due to a lack of governance, ownership, or intentionality POSSIBLE ROOT Tuesday, May 28, 13
  175. NAVIGATION AND RWD Major Issues ‣ Site Depth and Breadth

    ‣ Screen Real Estate ‣ Cross-width Consistency ‣ Interaction Patterns Tuesday, May 28, 13
  176. NAVIGATION AND RWD Major Issues ‣ Site Depth and Breadth

    ‣ Screen Real Estate ‣ Cross-width Consistency ‣ Interaction Patterns Tuesday, May 28, 13
  177. NAVIGATION AND RWD Major Issues ‣ Site Depth and Breadth

    ‣ Screen Real Estate ‣ Cross-width Consistency ‣ Interaction Patterns Tuesday, May 28, 13
  178. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... http://bradfrost.github.com/this-is-responsive/patterns.html Tuesday, May 28, 13
  179. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  180. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  181. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  182. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  183. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  184. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  185. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  186. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  187. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  188. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  189. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  190. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  191. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  192. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  193. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  194. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  195. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  196. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  197. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  198. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  199. Patterns Galore ‣ Toggle ‣ Footer Anchor ‣ Select Menu

    ‣ Multi-Toggle ‣ Off Canvas ‣ Breadcrumbs ‣ More... Tuesday, May 28, 13
  200. Discussion ‣ How are you handling navigation in your RWD

    projects? ‣ Have you been able to push back on IA? Tuesday, May 28, 13
  201. LESSONS LEARNED Testing ‣ You must test on real devices

    ‣ Do your development in a webkit browser ‣ Bulid libraries of your patterns Tuesday, May 28, 13
  202. LESSONS LEARNED Pricing ‣ As much as 100% more, initially

    ‣ Likely to be 50% more, soon after ‣ Probably never less than 25% more Tuesday, May 28, 13
  203. 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? Tuesday, May 28, 13
  204. LESSONS LEARNED Pricing ‣ Testing (labs & time) ‣ Fewer

    patterns ‣ Project management ‣ Learning curve ‣ Maintenance ‣ Content strategy Tuesday, May 28, 13
  205. 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 Tuesday, May 28, 13
  206. 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 Tuesday, May 28, 13
  207. 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/ Tuesday, May 28, 13
  208. There are many problems left to solve. We’ll solve them

    much faster if we solve them together. Tuesday, May 28, 13
  209. There are many problems left to solve. We’ll solve them

    much faster if we Tuesday, May 28, 13