An Introduction to Responsive Design

69
An Introduction to Responsive Design Liam Richardson Front End Developer – Sigma Consulting Solutions Ltd. @wearesigma / @meevil

description

These are the accompanying slides from a workshop / lecture delivered in both November 2013 to a group of students from the University of Central Lancashire, and in January 2014 to a group of students from Manchester Metropolitan University, on the topic of responsive design. This is version 2 of this slideshow, which includes added information and slides from Liam's visit to MMU. The task list from the workshop can be found here: http://www.richardsonweb.co.uk/responsive_tasks.pdf

Transcript of An Introduction to Responsive Design

Page 1: An Introduction to Responsive Design

An Introduction to Responsive Design

Liam RichardsonFront End Developer – Sigma Consulting Solutions Ltd.@wearesigma / @meevil

Page 2: An Introduction to Responsive Design

Today’s workshop

• Learn valuable tips and tricks that will help speed up web development in general

• Learn about the fundamentals of responsive design

• Learn the differences between Responsive and Adaptive design• Learn how to approach a responsive project• Learn how to adapt pre-existing knowledge• Learn why we make websites responsive in the first place• Learn about mobile first design• Learn what the future holds In store

Page 3: An Introduction to Responsive Design

8 Essential Lessons

Page 4: An Introduction to Responsive Design

What is responsive web design?

Page 5: An Introduction to Responsive Design

Lesson 1

RESPONSIVE WEBSITES ARE SITES THAT SCALE GRACEFULLY

Page 6: An Introduction to Responsive Design

Responsive VS. Adaptive

Page 7: An Introduction to Responsive Design

Adaptive - Pros

Desktop

Tablet

Mobile

Page 8: An Introduction to Responsive Design

Adaptive - Cons

Page 9: An Introduction to Responsive Design

Responsive FTW

Desktop

Tablet

Mobile

Page 10: An Introduction to Responsive Design

Media Queries - A Developer’s Best Friend

@media only screen and (max-device-width: 480px) {

body{background-color: red;}

}

Page 11: An Introduction to Responsive Design

Media Queries - A Developer’s Best Friend

Is the screen smaller than 960px?Show the tablet version.

Is the screen smaller than 768px?Show the mobile version.

Media queries change how content is displayed depending on the size of thedevice’s viewport

Page 12: An Introduction to Responsive Design

Introducing Foundation

Page 13: An Introduction to Responsive Design

Foundation’s Got You Covered

Page 14: An Introduction to Responsive Design

left-columnleft-column right-columnright-column

wrapper

Page 15: An Introduction to Responsive Design

<div class=“wrapper"></div>

Containers - Before

.header{width: 960px;margin: 0px auto;padding: 10px;

}

Page 16: An Introduction to Responsive Design

<div class=“row"></div>

Foundation’s Got You Covered

Page 17: An Introduction to Responsive Design

left-columnleft-column right-columnright-column

wrapper

Page 18: An Introduction to Responsive Design

Multiple Columns - Before

<div class=“left-column"></div>

<div class=“right-column"></div>

.left-column, .right-column{float: left;width: 480px;

}

Page 19: An Introduction to Responsive Design

Foundation’s Got You Covered

<div class="row">

<div class="large-6 columns">...</div>

<div class="large-6 columns">...</div>

</div>

Page 20: An Introduction to Responsive Design

Foundation – The Basics

• Everything must be wrapped up in a row• Rows contain columns• Rows can contain up to 12 columns

Page 21: An Introduction to Responsive Design

Row

4 columns 4 columns 4 columns

Rows can contain a maximum of 12 columns

Page 22: An Introduction to Responsive Design

Foundation – Three Column Layout

<div class="row">

<div class="large-4 columns">...</div>

<div class="large-4 columns">...</div>

<div class="large-4 columns">...</div>

</div>

Page 23: An Introduction to Responsive Design

Row

3 columns

3 columns

3 columns

3 columns

Page 24: An Introduction to Responsive Design

Foundation – Four Column Layout

<div class="row">

<div class="large-3 columns">...</div>

<div class="large-3 columns">...</div>

<div class="large-3 columns">...</div>

<div class="large-3 columns">...</div>

</div>

Page 25: An Introduction to Responsive Design

Row

4 columns 4 columns 4 columns

But what happens on mobile?

Page 26: An Introduction to Responsive Design

Row

4 columns

Becomes 100%

Foundation’s columns are responsive straight out of the box.

4 columns

Becomes 100%

Page 27: An Introduction to Responsive Design
Page 28: An Introduction to Responsive Design
Page 29: An Introduction to Responsive Design
Page 30: An Introduction to Responsive Design

Lesson 2

FRAMEWORKS LET YOU CREATE RESPONSIVE WEBSITES QUICKLY AND EASILY

Page 31: An Introduction to Responsive Design

.*, .*:before, .*:after{box-sizing: border-box;}

CSS nerds <3 box-sizing

Page 32: An Introduction to Responsive Design
Page 33: An Introduction to Responsive Design

Why Go Responsive?

Page 34: An Introduction to Responsive Design

Mobile internet usage now equates for 10% of total internet usage worldwide(and is expected to surpass that of desktop web usage by 2016)

Page 35: An Introduction to Responsive Design

Smartphones outsold the combined global market of laptop, desktop, and notebook computers in 2012, two years earlier than originally predicted.

Page 36: An Introduction to Responsive Design

62% of people who live in the UK own a smartphone

Page 37: An Introduction to Responsive Design

74% of UK smartphone owners use their phone to access the internet every day

Page 38: An Introduction to Responsive Design

A third of all online shopping related activity now comes from a mobile device

Page 39: An Introduction to Responsive Design

Lesson 3

THE MOBILE WEB GROWS MORE POPULAR BY THE DAY

Page 40: An Introduction to Responsive Design

Apple Fan Boys Rejoice

Page 41: An Introduction to Responsive Design

80%

Page 42: An Introduction to Responsive Design

Not Everyone Has An iPhone 5s

Page 43: An Introduction to Responsive Design

Gingerbread – The IE7 of the Mobile World

Page 44: An Introduction to Responsive Design
Page 45: An Introduction to Responsive Design

Mobile Website? Mobile Experience!

Page 46: An Introduction to Responsive Design

Lesson 4

USERS ARE WILLING TO ACCEPT LIMITED FUNCTIONALITY, BUT NOT LIMITED CONTENT

Page 47: An Introduction to Responsive Design

When Do You Browse The Internet On Your Phone?

Page 48: An Introduction to Responsive Design

• 80% use them during miscellaneous downtime throughout the day

• 74% use them while waiting in lines or waiting for appointments

• 69% use them while shopping

• 64% use them at work

• 62% use them while watching TV (a different study claims 84%)

• 47% use them during their commute

Mobile first – Luke Wroblewski

Page 49: An Introduction to Responsive Design

“When reflecting on a lot of mobile usage patterns, I like to imagine people as

one eyeball and one thumb.

”Mobile first – Luke Wroblewski

Page 50: An Introduction to Responsive Design

Lesson 5

USERS DO NOT USE MOBILES IN THE SAME WAY THEY USE DESKTOPS

Page 51: An Introduction to Responsive Design

jQuery sliderjQuery slider

My fancy websiteNews Gallery About us Contact us

Article 1Some text, a brief description of the article…

Article 1Some text, a brief description of the article…

Info

News

Images

More info

Twitter

We just ate ice cream #tasty

Page 52: An Introduction to Responsive Design

My fancy website

Article 1Some text, a brief description of the article…

News Gallery About us Contact

jQuery sliderjQuery slider

Info

News

Images

Page 53: An Introduction to Responsive Design

GRACEFUL DEGRADATIONRemoving features and / or content as the screen size becomes smaller

Page 54: An Introduction to Responsive Design

My fancy website

Article 1Some text, a brief description of the article…

Article 2Some text, a brief description of the article…

☰ Menu

Article 2Some text, a brief description of the article…

Page 55: An Introduction to Responsive Design

Progressive Enhancement

HTC Hero

Desktop PCiPhone 5s

Page 56: An Introduction to Responsive Design
Page 57: An Introduction to Responsive Design

Progressive enhancement >

Graceful degradation

Page 58: An Introduction to Responsive Design

Lesson 7

DESIGN MOBILE FIRST

Page 59: An Introduction to Responsive Design

What Does The Future Hold?

Page 60: An Introduction to Responsive Design
Page 61: An Introduction to Responsive Design

Flexbox is the next big thing

display: flex;

Page 62: An Introduction to Responsive Design

Desktop

Mobile

Page 63: An Introduction to Responsive Design

HTML Gets On Board

<picture>

   <source media="(min-width: 64em)" src="high-res.jpg">   <source media="(min-width: 37.5em)" src="med-res.jpg">   <source src="low-res.jpg">   <img src="fallback.jpg" alt="This picture loads on non-supporting

browsers.">   <p>Accessible text.</p>

</picture>

Page 64: An Introduction to Responsive Design

One Final Lesson

Page 65: An Introduction to Responsive Design

Lesson 8

THE ONLY CERTAINTY IS THAT RESPONSIVE DESIGN IS HERE TO STAY

FIND THE SOLUTION THAT WORKS BEST FOR YOU

Page 66: An Introduction to Responsive Design

What have we learned?

• Learned tips and tricks that will (hopefully) help speed up web development in general

• Learned about the fundamentals of responsive design

• Learned the differences between Responsive and Adaptive design• Learned how to approach a responsive project• Learned how to adapt pre-existing knowledge• Learned why we make websites responsive in the first place• Learned about the benefits of mobile first design• Learned what the future has in store

Page 67: An Introduction to Responsive Design

Further Reading

Page 68: An Introduction to Responsive Design

Any Questions?

Large-6 columns

Page 69: An Introduction to Responsive Design

Thank you!

@meevil

@wearesigma