Bumps in the Road to Responsive

A presentation at Design4Drupal in June 2013 in Boston, MA, USA by Michael Miles

Slide 1

Slide 1

BUMPS IN THE ROAD Addressing the Challenges of Responsive Web Design

Slide 2

Slide 2

WHO WE ARE • Michael Miles (@mikemiles86) • Salem Ghoweri (@salem_ghoweri) • Genuine Interactive (@WeAreGenuine)

Slide 3

Slide 3

AS RESPONSIVE WEB DESIGN (RWD) IS MATURING WE ARE BEGINNING TO IDENTIFY AND UNDERSTAND THE ROADBLOCKS

Slide 4

Slide 4

WE ARE HERE TO SHARE WHAT WE’VE LEARNED

Slide 5

Slide 5

RWD CHALLENGES • many designers still think in terms of pixels • traditional design software only supports static layouts • confusion about what’s appropriate for which tools • where to start? start from scratch? use community theme? • page bloat (multiple versions of images, tons of javascript and css)

Slide 6

Slide 6

IN THE BEGINNING OF THE WEB…

Slide 7

Slide 7

• Everyone used the same up-to-date Modern browser

Slide 8

Slide 8

• On the same sized, perfectly calibrated monitor

Slide 9

Slide 9

Slide 10

Slide 10

Slide 11

Slide 11

“Ever” -no one

Slide 12

Slide 12

ASSUMPTIONS PERIOD: .COM BUBBLE - IPHONE • “The web is just a page in a browser” • Defined • Only design areas. needed one design http://nataliemilton.com/wp-content/uploads/2013/03/960px-900.png

Slide 13

Slide 13

ASSUMPTIONS PERIOD: IPHONE - IPAD • Mobile web browsing • Separate, different for users. • Need two designs experiences

Slide 14

Slide 14

U.S. SMARTPHONE ADOPTION 80 60 40 20 0 2008 2009 2010 2011 2012 2013 2014 2015

Slide 15

Slide 15

iPhone 4S iPhone 5 Nexus 4 Galaxy S 3 Galaxy S 4 Droid DNA HTC One Galaxy Note 2 LG Optimus Galaxy Mega TODAY, THINGS ARE COMPLICATED. Galaxy Mega Nexus 7 Galaxy Note Galaxy Tab 3 iPad Nexus 10 Galaxy Tab 3 iPad Mini

Slide 16

Slide 16

ASSUMPTIONS PERIOD: IPAD - TODAY • There is only one web • There is only one design • Users expect one experience

Slide 17

Slide 17

Slide 18

Slide 18

A PAGE IS NOT A PAGE Can’t make assumptions Fixed sizes: Gone Must think differently

Slide 19

Slide 19

HOW DO I DESIGN RESPONSIVELY?

Slide 20

Slide 20

Slide 21

Slide 21

• Elements will shift • Define columns • Keep it simple

Slide 22

Slide 22

MIT EECS eesc.mit.edu

Slide 23

Slide 23

FROM FIXED TO FLUID Designers: • Think in terms of percentages • Make element proportional to parents • Discuss with developers

Slide 24

Slide 24

SHARED VALUE INITIATIVE sharedvalue.org

Slide 25

Slide 25

FLUID FLEXIBLE GRID • Does • Easy not care about device to implement • Create clear, creative designs

Slide 26

Slide 26

TOOLS IN AN AGE OF RESPONSIVE

Slide 27

Slide 27

VS

Slide 28

Slide 28

DESIGNING IN PHOTOSHOP • Static mockups don’t translate into flexible layouts • Impractical • Difficult to mockup infinite number of layout variations to communicate behavior, gestures, animations, etc.

Slide 29

Slide 29

YOU CAN’T DESIGN FOR THE UNKNOWN

Slide 30

Slide 30

DESIGNING IN THE BROWSER • Not everyone is comfortable coding • Problematic to build what hasn’t been explicitly defined • Unknown factor: setting expectations and client sign-off are difficult You lose details that might not easily translate to the browser!

Slide 31

Slide 31

• Adobe Edge Reflow

Slide 32

Slide 32

Slide 33

Slide 33

THE “PERFECT” RWD DESIGNER TOOL DOESN’T EXIST YET & MIGHT NEVER EXIST

Slide 34

Slide 34

DON’T WAIT FOR PERFECT; USE WHAT WORKS FOR YOU

Slide 35

Slide 35

ADDITIONAL SOLUTIONS

Slide 36

Slide 36

Style Tiles

Slide 37

Slide 37

Style Guide

Slide 38

Slide 38

Interactive Prototype

Slide 39

Slide 39

THEMING Front-end Development & Drupal

Slide 40

Slide 40

WHERE TO START? • Project has a timeline and budget • Limited • Need amount of time to start to know your options

Slide 41

Slide 41

TWO ROADS TO TRAVEL Community Theme Custom Theme

Slide 42

Slide 42

FIRST WORLD PROBLEMS

Slide 43

Slide 43

THREE BEST OPTIONS (in our experience) Adaptive Themes Omega Zen

Slide 44

Slide 44

ADAPTIVE THEMES drupal.org/project/adaptivetheme PROS • Modern techniques (SASS, Compass, etc) • Plugin • Plays system well with others CONS • Advanced settings • Generate CSS files (6-8)

Slide 45

Slide 45

OMEGA drupal.org/project/omega PROS • Optimize • Drupal • Drush core CSS 8 CSS Standards Integration CONS • Advanced settings • Unique “Zones” paradigm

Slide 46

Slide 46

ZEN drupal.org/project/zen PROS • Flexible • SASS CONS Fluid Grid • Very or vanilla CSS • More • Clean Templates basic time consuming

Slide 47

Slide 47

CUSTOM THEME PROS • Fits your workflow • You control the code • Customized to fit projects CONS • Very time consuming to build correctly • No community support

Slide 48

Slide 48

WHICH TO CHOOSE? Budget Flexibility & Time

Slide 49

Slide 49

COMBATTING PAGE BLOAT • Having a single code base with RWD is a double-edged sword • Common practice is to hide and show device specific content (display: none) • Remember: mobile users expect fast browsing experience Browsers still download hidden inline images!

Slide 50

Slide 50

THE SOLUTION: SEND LESS CODE!

Slide 51

Slide 51

drupal.org/project/conditional_styles ; Set the conditional stylesheets that are processed by IE. stylesheets-conditional[lt IE 7][all][] = ie6-and-below.css stylesheets-conditional[IE 9][all][] = ie9.css stylesheets-conditional[IE][print][] = ie-print.css

Slide 52

Slide 52

THE SOLUTION: SEND LESS CODE! • Conditional Stylesheets Module • Modularize CSS with SASS & Compass • Load, fire your JavaScript conditionally (RequireJS, EnquireJS, Modernizr) +

Slide 53

Slide 53

THE SOLUTION: SEND LESS CODE! • Conditional Stylesheets Module • Modularize CSS with SASS & Compass • Load, fire your JavaScript conditionally (RequireJS, EnquireJS, Modernizr)

Slide 54

Slide 54

IMAGES. IMAGES EVERYWHERE.

Slide 55

Slide 55

IMAGES. IMAGES EVERYWHERE. • Images account for ~60% of page weight • Resolution independence is one of the largest challenges facing RWD • Many techniques exist, browser vendor solutions in-progress (Picturefill, srcset) Retina is here to stay.

Slide 56

Slide 56

SOLUTION #1: TACKLE EVERYTHING BUT INLINE <IMG>

Slide 57

Slide 57

ICONS & SPRITES Font-icons such as Icomoon or Font Awesome

Slide 58

Slide 58

SVG Scalable Vector Graphics (SVGs) for vector graphics, textures

Slide 59

Slide 59

CSS3 Background image gradients, textures, box-shadow, etc.

Slide 60

Slide 60

CSS3 CSS Hat plugin for Photoshop

Slide 61

Slide 61

CSS3 colorzilla.com/gradient-editor

Slide 62

Slide 62

SOLUTION #2: DELIVER HIGH-RES INLINE IMAGES, OPTIMIZED LIKE HELL

Slide 63

Slide 63

DELIVER SUPER-OPTIMIZED RETINA <IMG> Retina: 45KB 1024 x 768 Non-retina: 95KB 400 x 300 filamentgroup.com/lab/rwd_img_compression/

Slide 64

Slide 64

SOLUTION 3: SHIM INLINE RESPONSIVE IMAGES (FOR NOW)

Slide 65

Slide 65

Adaptive Images Module JS-set cookie determines which image version is served

Slide 66

Slide 66

PictureFill Module future <picture> element today via JS  <span  data-­‐picture  data-­‐alt=”A  giant  stone  face  at  The  Bayon  temple  in  Angkor  Thom,   Cambodia”>                <span  data-­‐src=”small.jpg”></span>                <span  data-­‐src=”medium.jpg”          data-­‐media=”(min-­‐width:  400px)”></span>                <span  data-­‐src=”large.jpg”            data-­‐media=”(min-­‐width:  800px)”></span>                <span  data-­‐src=”extralarge.jpg”  data-­‐media=”(min-­‐width:  1000px)”></span>                <!-­‐-­‐  Fallback  content  for  non-­‐JS  browsers.  Same  img  src  as  the  initial,   unqualified  source  element.  -­‐-­‐>                <noscript>                        <img  src=”external/imgs/small.jpg”  alt=”A  giant  stone  face  at  The  Bayon  temple   in  Angkor  Thom,  Cambodia”>                </noscript>        </span>

Slide 67

Slide 67

DOWN THE ROAD

Slide 68

Slide 68

DRUPAL 8 MOBILE INITIATIVE groups.drupal.org/mobile/drupal-8 • All core themes are HTML5 and responsive • Front-end performance improvements (device detection, conditional loading, responsive images) • Documentation & Guidelines

Slide 69

Slide 69

TAKEAWAYS • think percentages, not pixels • mockup in BOTH photoshop & browser, or use tool like Reflow • code your own theme if experienced, have time, and need lots of flexibility • otherwise use Adaptive Theme, Omega, or Zen • reduce page bloat with Compass, Sass., and conditional JS loading

Slide 70

Slide 70

?

Slide 71

Slide 71

Slide 72

Slide 72

THANK YOU!