responsive design

35
RESPONSIVE DESIGN Brandon Sullivan Weber Shandwick | Minneapolis

Upload: brandon-sullivan

Post on 01-Nov-2014

824 views

Category:

Design


2 download

DESCRIPTION

Using elements of work by LukeW, Brad Frost and Ethan Marcotte, this is the default presentation I give to those unfamiliar with RWD

TRANSCRIPT

Page 1: Responsive design

RESPONSIVE DESIGN

Brandon SullivanWeber Shandwick | Minneapolis

Page 2: Responsive design

WHAT IS RESPONSIVE DESIGN?

GEEK SPEAK WARNING: A design intended to adapt to multiple layout formats with the intention to empower the user at their selected device

• Allows you to reach all devices through a single URL

• Removes the need for separate mobile sites (ex. m.facebook.com, m.engadget.com)

• Updates to a site can be made in one place

• Provides a more consistent user experience across all devices

Page 3: Responsive design

MAKING A CASE FOR MOBILE WEB ON ALL DEVICES

Page 4: Responsive design

MAKING A CASE FOR MOBILE WEB ON ALL DEVICES

Page 5: Responsive design

MAKING A CASE FOR MOBILE WEB ON ALL DEVICES• The projected demand for tablets by the end of 2012

~100 million devices

• Tablets are accelerating the adoption of the mobile internet

• Tablet users are spending less time on existing PCs – down 20% since 2008

• Heavy mobile data users are projected to triple to 1 billion by 2013

Page 6: Responsive design

MAKING A CASE FOR MOBILE WEB ON ALL DEVICES• Smartphone web users have increased 45% since 2010

• The number of 3G subscriber base grew 35% year-on-year

• By the end of 2011, smartphone sales have surpassed worldwide PC sales

Page 7: Responsive design

MAKING A CASE FOR MOBILE WEB ON ALL DEVICES• We are no longer talking about growth in years but in

quarters

• Hard to keep up

• Smartphones better, faster, and smarter and more users

• Still an exercise of patience

• Browsing full web sites on mobile is a pain• Sites are generally too heavy to download to mobile

Page 8: Responsive design

BIG DEAL. IS IT REALLY THAT IMPORTANT?

Page 9: Responsive design

371K babies are born each day

378K iPhones are sold across the world each day

NO, REALLY. IT IS.

Page 10: Responsive design

• ~562k iOS devices sold per day (iPhone, iPad and iPod touch)

• iOS, Android, Nokia, Blackberry total: 1.45 million new devices every day

LOTS OF DEVICES.

Page 11: Responsive design

WHO ARE THESE USERS?

WHAT ARE THEY DOING ON THE MOBILE WEB?

Page 12: Responsive design

Assumptions

• Users are distracted• Users are hurried

KEYWORD: CONTEXT

Page 13: Responsive design

Know your audience

• Significant amount of casual mobile users

• Staples: • 35% of tablet users use in the bathroom• 78% of tablet users use in bed

KEYWORD: CONTEXT

Page 14: Responsive design

Cost

• Mobile app development is expensive• Managing multiple versions of sites is expensive.

(ex. m.facebook.com, m.engadget.com)

• Responsive web development is far less expensive.• Most cost goes into planning instead of development• Sites built to web standards already support a responsive

workflow• Content only needs to be updated on one spot instead of

across platforms (apps and mobile sites)

SO WHY RESPONSIVE DESIGN?

Page 15: Responsive design

The experience

• Full sites on mobile are clunky

• Optimizing the content for the device

SO WHY RESPONSIVE DESIGN?

VS

Page 16: Responsive design

GET STARTED1. Mobile First

• “How does this content or feature benefit the mobile user?” • Focus on core features and content

• Enrich desktop experience by providing focus• Progressive enhancement, not punishing the lowest common

denominator(think base model car vs. full outfit)

2. The responsive waterfall approach

• planning, design, development, delivery• Desktop design mockups, wireframes, and style guides can

inform beautifully

3. The process should be iterative & collaborative.

• Designers and developers come together!• Display can be refined for mobile during development to enhance

the user experience

Page 17: Responsive design

DESIGN1. Start with your

desktop design

Page 18: Responsive design

DESIGN1. Start with your

desktop design

2. Work in some mobile wireframes

Page 19: Responsive design

DESIGN1. Start with your

desktop design

2. Work in some mobile wireframes

3. Collaborate on final solutions

Page 20: Responsive design

NOW LET’S TALK CODE

Page 21: Responsive design

5 ELEMENTS TO MAKING RWD WORK1. Clean, semantic code structure

2. Pixels % and ems

3. The magic equation: Target ÷ context = result

4. Setting the right<meta> tags

5. Media queries

Page 22: Responsive design

SEMANTIC CODE STRUCTURE

What the layout looks like How the code lays out

Use CSS to position elements visually. Use HTML to position them semantically

Page 23: Responsive design

% VS EMS: WHEN TO USE WHICH

Use % for:

- Layouts

- Boxes- Box padding- Box margin

Use ems for:

- Text and flowing content

- Font-size- Line-height (leading)- Content padding- Content margin

- Horizontally oriented - Vertically oriented

Page 24: Responsive design

THE EQUATION

Target ÷ context = result

- Weans you off that pixel habit

- May result in long ugly numbers (ex. 0.4583333333333em)

- Browsers convert to local pixel value- For total accuracy, round numbers with caution- More information = better result- That precision > dramatically less layout-based bugs in browser

testing

Example: http://staging.thefutureiselectric.com/

Page 25: Responsive design

Browsers have defaults, and it sucks.

When resetting your browser defaults using a CSS Reset, include:

body { font-size:100%; }

• Sets the browser default font size at 16px

• 1em = 16px

• All em calculations are relative

FONTS: SETTING A BASELINE

Page 26: Responsive design

24px font size in your PSD?

Target ÷ context = result

24 ÷ 16 = 1.5

Font-size: 1.5em

FONTS: CONVERTING FROM DESIGN FILES

Page 27: Responsive design

11px font size in your PSD?

Target ÷ context = result

11 ÷ 16 = 0.4583333333333

Font-size: 0.45833em

FONTS: CONVERTING FROM DESIGN FILES

Page 28: Responsive design

LAYOUT

Target ÷ context = result

width of element ÷ width of container = percentage value

- Include margins and paddings in your calculations!

- Be wary of the context

http://elsullivano.com/etc/RWD/GM_example.pdf

Page 29: Responsive design

img, embed, object, video { max-width: 100%; }

Item can only be as wide as its container.

Good for all browsers back to IE7.

(For IE6 support, read Ch. 3 of RWD by Ethan Marcotte)

How do you mean?

FLEXIBLE IMAGES

Page 30: Responsive design

FLEXIBLE IMAGES

<article>

<figure>

<img>

</figure>

<div class=“content”></div>

</article>

article { width:100%; }figure {

float: left;margin-right: 2%;padding: 2.5%;width: 20%;

}

img { max-width: 100%;

}.content {

width: 77%; }

Page 31: Responsive design

MEDIA QUERIES: SET UP

Mobile browsers

- Fit the whole page onscreen (960px scaled to 320px)

- Use this in the <head> to set it to a 1:1 scale

<meta name="viewport" content="initial-scale=1.0, width=device-width" />

This activates what we’ll use for our media queries.

Page 32: Responsive design

THE QUERY

@media screen and (max-width: 768px) {

/* your styles here */

}

- Styles everything from iPad width and smaller.

- Include queries at the end of your main stylesheet.

- Longer, but with less calls to the server (money saver!)- Style only what changes in the query (put the cascade back in CSS)

Page 33: Responsive design

POPULAR RESPONSIVE DESIGN LAYOUTS

Mostly Fluid Column Drop

Page 34: Responsive design

POPULAR RESPONSIVE DESIGN LAYOUTS

Layout Shifter Off Canvas

Page 35: Responsive design

RESOURCESFluid Grid Calculator

http://csswizardry.com/fluid-grids/

Media Queries Debugger

http://johanbrook.com/design/css/debugging-css-media-queries/

Books

Responsive Web Design, by Ethan Marcotte

Mobile First, by Luke W

Sketching/wireframes

http://jeremypalford.com/arch-journal/responsive-web-design-sketch-sheets

RWD testing

http://mattkersley.com/responsive/

Frameworks/boilerplates

http://getskeleton.com/

http://semantic.gs/

http://goldilocksapproach.com/

http://stuffandnonsense.co.uk/projects/320andup/

Font size conversion

http://fittextjs.com/

@RWD

@lukew