BUMPS IN THE ROAD Addressing the Challenges of Responsive Web Design
Slide 2
WHO WE ARE
•
Michael Miles (@mikemiles86)
•
Salem Ghoweri (@salem_ghoweri)
•
Genuine Interactive (@WeAreGenuine)
Slide 3
AS RESPONSIVE WEB DESIGN (RWD) IS MATURING WE ARE BEGINNING TO
IDENTIFY AND UNDERSTAND THE ROADBLOCKS
Slide 4
WE ARE HERE TO SHARE WHAT WE’VE LEARNED
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
IN THE BEGINNING OF THE WEB…
Slide 7
•
Everyone used the same up-to-date Modern browser
Slide 8
•
On the same sized, perfectly calibrated monitor
Slide 9
Slide 10
Slide 11
“Ever” -no one
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
ASSUMPTIONS PERIOD:
IPHONE - IPAD
• Mobile
web browsing
• Separate, different
for users. • Need
two designs
experiences
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
ASSUMPTIONS PERIOD:
IPAD - TODAY
• There
is only one web
• There
is only one design
• Users
expect one experience
Slide 17
Slide 18
A PAGE IS NOT A PAGE Can’t make assumptions
Fixed sizes: Gone
Must think differently
Slide 19
HOW DO I DESIGN RESPONSIVELY?
Slide 20
Slide 21
•
Elements will shift
•
Define columns
•
Keep it simple
Slide 22
MIT EECS eesc.mit.edu
Slide 23
FROM FIXED TO FLUID Designers: • Think
in terms of percentages
• Make
element proportional to parents
• Discuss
with developers
Slide 24
SHARED VALUE INITIATIVE sharedvalue.org
Slide 25
FLUID FLEXIBLE GRID
• Does • Easy
not care about device
to implement
• Create
clear, creative designs
Slide 26
TOOLS IN AN AGE OF RESPONSIVE
Slide 27
VS
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
YOU CAN’T DESIGN FOR THE UNKNOWN
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
•
Adobe Edge Reflow
Slide 32
Slide 33
THE “PERFECT” RWD DESIGNER TOOL DOESN’T EXIST YET & MIGHT NEVER EXIST
Slide 34
DON’T WAIT FOR PERFECT; USE WHAT WORKS FOR YOU
Slide 35
ADDITIONAL SOLUTIONS
Slide 36
Style Tiles
Slide 37
Style Guide
Slide 38
Interactive Prototype
Slide 39
THEMING Front-end Development & Drupal
Slide 40
WHERE TO START? • Project
has a timeline and
budget • Limited • Need
amount of time to start
to know your options
Slide 41
TWO ROADS TO TRAVEL
Community Theme
Custom Theme
Slide 42
FIRST WORLD PROBLEMS
Slide 43
THREE BEST OPTIONS (in our experience)
Adaptive Themes
Omega
Zen
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)
ZEN drupal.org/project/zen
PROS • Flexible • SASS
CONS
Fluid Grid
• Very
or vanilla CSS
• More
• Clean Templates
basic time consuming
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
WHICH TO CHOOSE?
Budget
Flexibility & Time
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
THE SOLUTION:
SEND LESS CODE!
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
THE SOLUTION:
SEND LESS CODE! • Conditional
Stylesheets Module
• Modularize
CSS with SASS &
Compass • Load, fire
your JavaScript conditionally (RequireJS, EnquireJS, Modernizr)
+
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
IMAGES. IMAGES EVERYWHERE.
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
SOLUTION #1: TACKLE EVERYTHING BUT INLINE <IMG>
Slide 57
ICONS & SPRITES Font-icons such as Icomoon or Font Awesome
Slide 58
SVG Scalable Vector Graphics (SVGs) for vector graphics, textures
Slide 59
CSS3 Background image gradients, textures, box-shadow, etc.
Slide 60
CSS3 CSS Hat plugin for Photoshop
Slide 61
CSS3 colorzilla.com/gradient-editor
Slide 62
SOLUTION #2: DELIVER HIGH-RES INLINE IMAGES,
OPTIMIZED LIKE HELL
Slide 63
DELIVER SUPER-OPTIMIZED RETINA <IMG>
Retina: 45KB 1024 x 768
Non-retina: 95KB 400 x 300
filamentgroup.com/lab/rwd_img_compression/
Adaptive Images Module JS-set cookie determines which image version is served
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
DOWN THE ROAD
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
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