58
Responsive design Out of the box and down the rabbit hole

Responsive Design: Out of the Box and Down the Rabbit Hole

Embed Size (px)

DESCRIPTION

When building a responsive website in Drupal, you may hear about starter themes that are responsive "out of the box". What you learn is that responsive design is such a deep and complex field that "out of the box" doesn't really exist. Let's begin to explore the deep rabbit hole that is responsive web design. From a designer and front end developer perspective.

Citation preview

Page 1: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive designOut of the box and down the rabbit hole

Page 2: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

Who am I?

Dan Moriarty

Electric Citizen

@minneapolisdan

Page 3: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designABOUT MY APPROACH

I only currently use a normal and fluid grid, using Omega Theme. TO DO: wide grid

Few grid columns = better? 12 max, 6 is better

TO DO: Start with base CSS that covers mobile, and then add styles based on min-width, enhancing experience for those with bigger screens.

Don’t start from desktop and then scale down (something I’ve been guilty of)

Page 4: Responsive Design: Out of the Box and Down the Rabbit Hole

The secret is out

Responsive Design is amazing awesome, fantastically wonderful, and super trendy

We all have seen these squishy, stretchy, fluid, flexible sites

2013, “Year of Responsive Design”*

http://mashable.com/2012/12/11/responsive-web-design/ 

Page 5: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

“Do you do responsive design?”

No?? Then you are an idiot!

Page 6: Responsive Design: Out of the Box and Down the Rabbit Hole

http://mediaqueri.es/

Ethan Marcotte

Responsive web designout of the box : down the rabbit hole

Page 7: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

Adaptive vs Responsive?

Page 8: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

It’s all about watching sites stretch and squish, right?

Page 10: Responsive Design: Out of the Box and Down the Rabbit Hole

Starter themes

Disclaimer Time!

Page 11: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

What do these Out of the Box solutions offer?

Page 12: Responsive Design: Out of the Box and Down the Rabbit Hole

Out of the box

Media Queries

960 Grid, Narrow Grid, Fluid Grid, Wide Grid

Breakpoints for iPhones, iPads, etc

Page 13: Responsive Design: Out of the Box and Down the Rabbit Hole

starter themes

Really great, but...

Page 14: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

* AFAIK

There is no such thing as Out of the Box

Responsive Websites!!*

Page 15: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

Why Not?

Page 16: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive web designout of the box : down the rabbit hole

Custom grid anyone?

Grids within grids

More than default breakpoints

Custom designs don’t always fit neatly into the box

Handling tables, lists, forms, images, iframes, maps, video

Font sizing

Page 17: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: grids

960.gs has been great. But not the answer for everything.

Page 18: Responsive Design: Out of the Box and Down the Rabbit Hole

http://www.1080.gs/

1000px grid - 6 colshttp://elliotjaystocks.com/blog/a-better-photoshop-grid-for-responsive-web-design/

responsive web design: custom grids

Page 19: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: custom grids

Page 20: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: grids

Out of the Box has you covered for a preset 12 or 16 col grid

But even if you don’t choose a custom grid, what happens when you put grids inside of grids?

Mo’ Grids, Mo’ Problems

Page 21: Responsive Design: Out of the Box and Down the Rabbit Hole

You’re familiar with this kindof layout?

Grids within grids

Page 22: Responsive Design: Out of the Box and Down the Rabbit Hole

24col, 960 grid:6col=230px

Switch to flexible grid and 6col = 23%

Grids within grids

Page 23: Responsive Design: Out of the Box and Down the Rabbit Hole

When sidebars shift and containers widen, these are still 23%

Grids within grids

Page 24: Responsive Design: Out of the Box and Down the Rabbit Hole

Now we want that grid-2 to be more like a grid-4 or grid-8

Grids within grids

Page 25: Responsive Design: Out of the Box and Down the Rabbit Hole

How is this currently handled?

I write a lot of overrides at different breakpoints.

But wouldn’t it be nice if I didn’t have to do that (as much)?

Grids within grids

Page 26: Responsive Design: Out of the Box and Down the Rabbit Hole

grids within grids

How to Resolve Grids within Grids?

Semantic Grids, Zen Grids, Susy

Take the grid-x out of the code

Page 27: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: grids

But wait, does that mean...

Page 28: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: grids

Now you need SASS or LESS

Not out of the box

at all

Page 29: Responsive Design: Out of the Box and Down the Rabbit Hole

custom breakpoints

iPad = 768px-1024px

iPhone = 320-480px

But there are other breakpoints to consider!

Page 30: Responsive Design: Out of the Box and Down the Rabbit Hole

trouble items: how to solve

Slideshows

Tables

iFrames with Videos and Maps

Image Maps

iOS Orientation

Page 31: Responsive Design: Out of the Box and Down the Rabbit Hole

trouble items: slideshows

Always Use Flexslider, Forget Views Slideshow

Get away from inline widths and heights

www.woothemes.com/flexslider

drupal.org/project/flexslider

Page 32: Responsive Design: Out of the Box and Down the Rabbit Hole

trouble items: tables

Avoid tables when possible, only for tabular data (semantic)

Several options to responsiveness

There’s a module for that!

drupal.org/project/responsive_tables

maxbronsema.com/blog/2013/02/26/zurb-responsive-tables-within-drupal/ with drupal.org/project/flexifilter

Page 33: Responsive Design: Out of the Box and Down the Rabbit Hole

trouble items: tables

Avoid tables when possible, only for tabular data (semantic)

Several options to responsiveness

There’s a module for that

Page 37: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive “Views”

View and Grids (aka Tables)

Views and HTML Lists (better but...)

/*News Stories, list */.item-list ul.news-stories li { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #CCCCCC; display: inline-block; float: left; margin: 5px 2% 10px 0; max-height: 280px; overflow: hidden; padding: 15px 10px 5px; width: 32%;}

Page 38: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive “Views”

Views Responsive Grid Module

Uses Grid Settings - your views grid follows same responsive rules as grid

Page 39: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive type

Typography should change with the device being used

Change line-heights, font sizes

Hover declarations are worthless

REM and other ideas

Page 40: Responsive Design: Out of the Box and Down the Rabbit Hole

Responsive nav

responsivenavigation.net

Page 42: Responsive Design: Out of the Box and Down the Rabbit Hole

box model:your new best friend

IE7 and earlier model VS

Everyone else: Padding+Border+Content=Width http://www.eclipsewebmedia.com/css-box-model-explained/

Page 43: Responsive Design: Out of the Box and Down the Rabbit Hole

box model:your new best friend

With Fluid Grids, trying to track widths of content+padding+borders at a Percentage Value that’s changing = YUCK!

www.paulirish.com/2012/box-sizing-border-box-ftw

/* apply a natural box layout model to all elements */* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

Page 44: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: out of the box?

Destroy the box!

Page 45: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: down the rabbit hole

Shall we go on?

Page 46: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web design: filesize+performance

Page 47: Responsive Design: Out of the Box and Down the Rabbit Hole

performancemeasuring download speeds

Testing download speeds on mobile devices: mobitest.akamai.com/m/index.cgi

How to reduce filesize?

Page 48: Responsive Design: Out of the Box and Down the Rabbit Hole

performancereduce filesize

Image Size

Scripts

Reduce markup

Page 49: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: images

Adaptive Images, adaptive-images.comhttps://drupal.org/project/aishttps://drupal.org/project/adaptive_image

Page 50: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: images

<picture>

<source media="(min-width: 40em)" srcset="big.jpg 1x, big-hd.jpg 2x">

<source srcset="small.jpg 1x, small-hd.jpg 2x">

<img src="fallback.jpg" alt="">

</picture>

Page 51: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: images

SVG Format?

Font Icons

Data URIs

Content Delivery Network?

Page 52: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: scripts

jQuery is great, but it’s big! Over 200k

jQuery mobile is also fairly large

What’s the alternative?

http://jquerybyexample.blogspot.com/2013/05/jquery-library-file-size-over-years.html

Page 54: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: reduce markup

Drupal Fences module

Page 55: Responsive Design: Out of the Box and Down the Rabbit Hole

performance: content

Adjusting page content based on device being used? AKA “the Internet Fridge”

Page 56: Responsive Design: Out of the Box and Down the Rabbit Hole

responsive web designstill evolving rapidly

“If Responsive Web Design is truly an answer to a mobile society, it has to do more than stretch and pull”

Page 57: Responsive Design: Out of the Box and Down the Rabbit Hole

resources

mobilewebbestpractices.com

mobile.smashingmagazine.com/2013/05/29/the-state-of-responsive-web-design/

bradfrostweb.com/blog/tag/rwd/

www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu

http://zengrids.com/

http://susy.oddbird.net/

http://html.adobe.com/edge/inspect/http://browserstack.com

Page 58: Responsive Design: Out of the Box and Down the Rabbit Hole

Dan Moriarty, Electric Citizen@minneapolisdan