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

Responsive Web Design Workshop

Responsive Web Design Workshop

An introduction to responsive web design, with lots of examples, tools and frameworks.

My deck from a Responsive Web Design Workshop which included two walkthroughs on responsive web designs (not included in the deck because, well, you had to be there!)

http://mulley.ie/blog/2013/05/responsive-web-design-training-course/

Stewart Curry

June 25, 2013
Tweet

More Decks by Stewart Curry

Other Decks in Design

Transcript

  1. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Who is This Guy?

    Web Designer for 15 years or so Table-based layouts & spacer gifs CSS changed all that RWD is how the web was meant to be woop.ie - iteration, modules, themes, templates
  2. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Caveat "[I do

    not] carry such information in my mind since it is readily available in books." Albert Einstein, when asked what the speed of sound was
  3. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  4. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Responsive web design

    We can design for an optimal viewing experience, but embed standards-based technologies into our designs to make them not only more flexible, but more adaptive to the media that renders them / ETHAN MARCOTTE
  5. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Definition Responsive web

    design means designing your website so that it responds to your users environment based on screen- size, platform and orientation.
  6. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Definition It looks

    di erent and things jiggle around, scale, re-order, appear, and disappear so it works well in your browser size or whatever device you’re using to view it...
  7. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Advantages • Easier to

    Manage no mobile version, faster to update, single URL for Google, less to manage • One site, many devices • Respects your visitors The best experience for their device
  8. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Key Components • Fluid,

    proportion-based grids % widths and em units, not fixed pixels • Flexible images width/height not fixed • CSS3 Media Queries @media rule
  9. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 New Thinking • Work

    on everything Design for many sizes at once • Clean design reduce clutter, essential content only • Design from the content out Let content decide breakpoints
  10. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 New Thinking • Design

    is how it works Not how it looks • Less Graphic files CSS gradients, font icons • Keep learning Responsive images? Polyfills?
  11. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 *actually* from a non-linear,

    non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stu . “ ”
  12. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  13. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Key Components • Fluid,

    proportion-based grids % widths and em units, not fixed pixels • Flexible images width/height not fixed • CSS3 Media Queries @media rule
  14. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Fluid Grids .row {

    padding-left: 2%; } .col { float: left; margin:0 2% 0 0; } .col:last-child { margin: 0; } .span-1 { width: 23%; } .span-2 { width: 48%; }
  15. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Flexible Images Blue bottle

    food truck street art, direct trade cosby sweater ethical hoodie hashtag american apparel. Wayfarers selvage pour-over swag, etsy next level meh Austin polaroid beard wolf irony squid PBR. DIY synth post-ironic 8-bit polaroid typewriter, vice cliche fixie pug retro direct trade lomo. Tonx fap wes anderson, cred pinterest street art retro fashion axe.
  16. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Flexible Images Blue bottle

    food truck street art, direct trade cosby sweater ethical hoodie hashtag american apparel. Wayfarers selvage pour-over swag, etsy next level meh Austin polaroid beard wolf irony squid PBR. DIY synth post-ironic 8-bit polaroid typewriter, vice cliche fixie pug retro direct trade lomo. Tonx fap wes anderson, cred pinterest street art retro fashion axe.
  17. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Flexible Images Blue bottle

    food truck street art, direct trade cosby sweater ethical hoodie hashtag american apparel. Wayfarers selvage pour-over swag, etsy next level meh Austin polaroid beard wolf irony squid PBR. DIY synth post-ironic 8-bit polaroid typewriter, vice cliche fixie pug retro direct trade lomo. Tonx fap wes anderson, cred pinterest street art retro fashion axe.
  18. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Flexible Images img {

    max-width: 100%;} < img src="kitten.jpg" /> <!-- [if lte IE 6]> img { width: 100%;} + AlphaImageLoader
  19. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries External <

    link rel="stylesheet" media="screen and ( max-width: 500px )" href="mobile.css" > < link rel="stylesheet" media="screen and ( max-width: 800px )" href="tablet.css" > < link rel="stylesheet" media="screen and ( min-width: 1000px )" href="desktop.css" >
  20. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries Same file

    @media screen and ( max-width: 500px ) @media screen and ( min-width: 800px ) @media screen and ( min-width: 500px ) and ( max-width: 800px )
  21. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries Devices @media

    ( -webkit-min-device-pixel-ratio: 2 ) , ( min-resolution: 192dpi ) @media only screen and ( min-device-width: 768px ) and ( max-device-width: 1024px ) @media only screen and ( min-device-width: 768px ) and ( max-device-width: 1024px ) and ( orientation: landscape )
  22. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries @media screen

    and ( min-width: 500px ) and ( max-width: 800px ) { /* CSS declarations */ }
  23. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries @media screen

    and ( min-width: 500px ) and ( max-width: 800px ) { /* CSS declarations */ } This is for screen only (desktops, smartphones, not print)
  24. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries @media screen

    and ( min-width: 500px ) and ( max-width: 800px ) { /* CSS declarations */ } The width of the window must be AT LEAST 500px
  25. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries @media screen

    and ( min-width: 500px ) and ( max-width: 800px ) { /* CSS declarations */ } The width of the window must ALSO be NO MORE THAN 800px
  26. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Media Queries @media screen

    and ( min-width: 500px ) and ( max-width: 800px ) { img { border: 5px solid # f; } } Images will have a white border when the window is from 500px to 800px wide
  27. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  28. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Design Pattern a

    design pattern is a general reusable solution to a commonly occurring problem within a given context in software design
  29. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Toggle Navigation Home About

    Location Services Contact Us Home About Location Services Contact Us Menu. Menu.
  30. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Footer Navigation Home About

    Location Services Contact Us Menu. Home About Location Services Contact Us
  31. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Stacked Top Links Navigation

    Home About Location Services Contact Us Home About Location Services Contact Us
  32. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Left Nav Flyout Home

    About Location Services Contact Us Menu Echo Park chambray 90's fap cardigan keffiyeh, trust fund retro Truffaut next level. Lomo forage pop-up Neutra, fashion axe sustainable keffiyeh helvetica DIY. Fashion axe Neutra craft beer four loko helvetica. American apparel sustainable kale chips Etsy, photo booth VHS shabby chic. Home About Location Services Contact Us Home About Location Services Contact Us Menu Echo Park chambray 90's fap cardigan keffiyeh, trust fund retro Truffaut next level. Lomo forage pop-up Neutra, fashion axe sustainable keffiyeh helvetica DIY. Fashion axe Neutra craft beer four loko helvetica. American apparel sustainable kale chips Etsy, photo booth VHS shabby chic.
  33. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Priority+ Navigation Home About

    Location Services Contact Us Home Location More
  34. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Priority+ Navigation Home About

    ▼ Location ▼ Services ▼ Contact Us Service 1 Service 2 Service 3 Home About + Location + Services - Service 1 Service 2 Service 3 Contact Us
  35. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Source Order (table display)

    Home About Location Services Contact Us Home About Location Services Contact Us Lorem ipsum dolor sit amet Consectetur adipiscing elit. Sed vel vehicula justo, et vestibulum erat. Maecenas sagittis volutpat molestie. Integer tortor mi, egestas et tristique quis, tempus nec diam Lorem ipsum dolor sit amet Consectetur adipiscing elit. Sed vel vehicula justo, et vestibulum erat. Maecenas sagittis volutpat molestie. Integer tortor mi, egestas et 2nd in source 1st in source 2nd in source 1st in source
  36. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Flexbox #logo #menu #content

    #leftnav #footer 1 2 3 4 5 #logo #menu #content #leftnav #footer 1 2 3 4 5 1 2 3 4 5
  37. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  38. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  39. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 IE Only Stylesheet <!--[if

    lt IE 9]> < link rel="stylesheet" media="screen" href="ie.css" > <![endif]-->
  40. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Conditional Classes <!--[if lt

    IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9"> <![endif]--> <!--[if gt IE 8]> <!--> <html class=""> <!--<![endif]-->
  41. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Detect Features http://modernizr.com/ Modernizr

    is a small JavaScript library that detects the availability of native implementations for next-generation web technologies, i.e. features that stem from the HTML5 and CSS3 specifications... ...what Modernizr does is, very simply, tell you whether the current browser has this feature natively implemented or not.
  42. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Shims, Shivs & Polyfills

    HTML5 Shim https://code.google.com/p/html5shim/ CSS3 Media Queries Shim https://code.google.com/p/css3- mediaqueries-js/ https://github.com/Modernizr/Modernizr/ wiki/HTML5-Cross-Browser-Polyfills
  43. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 target ÷ context =

    result required font size container’s font size desired font size
  44. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Set base size body

    { font-size : 100%; } Base font size: 16px; 1em = 16px http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/
  45. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 24 ÷ 16 =

    1.5 required font size (em) container’s font size (px) desired font size (px)
  46. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  47. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Approaches • Mobile First

    and add styles and breakpoints • Adaptive Web Design predefined screensizes • Multiple Grids di erent grids for di erent breakpoints (gridsetapp for example)
  48. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Approaches • Small is

    Special Unique case for <480px (ish) • Device Detection widths, assumptions, scripts, resolutions • Frameworks pre-built grids and modules
  49. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Start with the small

    screen first, then expand until it looks like shit. TIME FOR A BREAKPOINT! “ ” @stephenhay
  50. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Retina Backgrounds .box {

    background: url ('images/box-bg.png') no-repeat top left; } @media screen and ( -webkit-min-device-pixel-ratio: 2 ) , ( min- resolution: 192dpi ) { .box { background: url ('images/[email protected]') no-repeat top left; background-size: 200px 200px; } }
  51. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Multiple Images • Clown

    Car Technique (svg file, swap images as backgrounds) • Picture Polyfill https://github.com/scottjehl/picturefill • 8 guidelines and 1 rule http://blog.cloudfour.com/8-guidelines- and-1-rule-for-responsive-images/
  52. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  53. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  54. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 TOPICS • What is

    RWD? • How it works • Design Patterns in RWD • Some good examples • Walkthrough making a responsive website • Some di erent approaches • Some useful frameworks • Some useful tools • Designing for RWD
  55. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Mockups? • Time consuming

    too many variations • Untested get on devices sooner rather than later • Waterfall be agile!
  56. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Mood boards When

    trying to convey a design idea, moods, feelings and flu y stu like that are hard to communicate ... designers will often use a mood board: a collection of textures, images and text related to a design theme as a reference point. http://www.creativebloq.com/graphic-design/mood-boards-812470
  57. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Style tiles An

    interior designer doesn't design three di erent rooms for a client at the first kick-o meeting, so why do Web designers design three di erent webpage mockups?
  58. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Style tiles Style

    Tiles are a design deliverable consisting of fonts, colors and interface elements that communicate the essence of a visual brand for the web.
  59. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 “ Prototype Build an

    interface everyone can start looking at, using, clicking through, and "feeling" before you start worrying about back-end code. Get yourself in front of the customer experience as much as possible. / JASON FRIED
  60. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Prototype • Download Zurb

    or Bootstrap • Test & find out what doesn’t work • Make a Wireframe • Make a PSD • Make HTML pages • Integrate • Test & find out what doesn’t work or
  61. @IRISHSTU #RWD WORKSHOP 25 JUNE 2013 Dip your toes •

    Design in the browser • Start with mobile • Add a breakpoint around 500px • Add a breakpoint around 800px • Keep it simple!