SlideShare uma empresa Scribd logo
1 de 62
Presented by
Keys to Responsive Design
Wednesday, May 29, 13
Presented by
I’m Tim.
Wednesday, May 29, 13
Responsive Web Design
I wrote this book.
Amazon
Barnes & Noble
Safari Books
...most places, really.
informIT.com
WRIGHT2740
Wednesday, May 29, 13
Responsive Web Design
What we’ll be going over
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
01Best PracticesThey’re WAY more exciting than they sound!
Wednesday, May 29, 13
Responsive Web Design
Progressive Enhancement
Wednesday, May 29, 13
Responsive Web Design
Progressive Enhancement
Wednesday, May 29, 13
Responsive Web Design
The BIG secret!
normal CSS
normal CSS
normal CSS
breakpoint (media query)
breakpoint (media query)Stuff at the
bottom
Overwrites
stuff at the
top
Wednesday, May 29, 13
Being good at
responsive design has
little to do with CSS
Wednesday, May 29, 13
Responsive Web Design
Rules of Responsive Design
• Don’t call it “mobile”
• Treat it as 1 site
• Don’t target devices
• Don’t remove content for small screens
• Think in terms of features (touch vs. no touch)
• Always remember bandwidth
• Consider the strategy from the start
• Recognize when it isn’t the answer.
Wednesday, May 29, 13
Responsive Web Design
02Media Queries & breakpointsHoly sh*t, stop using iPhone dimensions...
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
The Media Query
@media screen and ( max-width: 800px ) {
/* CSS for this breakpoint */
}
media type media feature
normal CSS
Wednesday, May 29, 13
Responsive Web Design
The Media “Type”
• all
• screen
• print
• braille
• handheld
• projections
• tv
• aural (speech and sound synthesis)
Wednesday, May 29, 13
Responsive Web Design
The Media “Feature”
• min/max-width
• min/max-height
• orientation
• aspect-ratio (browser window)
• device-aspect-ratio (4/3,16/9)
• color-index
• resolution & min-resolution (dpi * dpcm)
• device pixel ratio
Wednesday, May 29, 13
Responsive Web Design
Aspect ratio
Height/Width
Orientation
Resolution (dpi)
Touch enabled (-moz-)
Wednesday, May 29, 13
Responsive Web Design
Aspect ratio
Height/Width
Orientation
Resolution (dpi)
Touch enabled (-moz-)
Wednesday, May 29, 13
Responsive Web Design
Aspect ratio
Height/Width
Orientation
Resolution (dpi)
Touch enabled
Wednesday, May 29, 13
Responsive Web Design
Aspect ratio
Height/Width
Orientation
Resolution (dpi)
Touch enabled (-moz-)
Wednesday, May 29, 13
Responsive Web Design
Aspect ratio
Height/Width
Orientation
Resolution (dpi)
Touch enabled (-moz-)
Wednesday, May 29, 13
Responsive Web Design
Setting Breakpoints
Wednesday, May 29, 13
Responsive Design
doesn’t care that the
iPhone is 320 pixels
wide...
...and neither should you
Wednesday, May 29, 13
Responsive Web Design
Making it work on everywhere
Wednesday, May 29, 13
Responsive Web Design
Viewport tag content
width=device-width // define the viewport size
initial-scale=1.0 // starting zoom level
maximum-scale=1.0 // control zooming (0-10)
user-scalable=0 // prevent zooming / input:focus scrolling
Wednesday, May 29, 13
Responsive Web Design
Recommended Tag
<meta name=”viewport” content=”width=device-width, initial-scale=1.0”>
Wednesday, May 29, 13
Responsive Web Design
Breakpoints & Media Queries
Live example
Wednesday, May 29, 13
Responsive Web Design
Browser Support
caniuse.com
Wednesday, May 29, 13
Responsive Web Design
03Design patternsOther people do things this way...
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
Navigation
• The “Do nothing” approach
• Stacked navigation method
• Footer anchor
• Select menu
• Toggle
• Left navigation flyout
• The “Hide and Cry”
Credit: Brad Frost
Wednesday, May 29, 13
Responsive Web Design
Navigation
The “Do Nothing” Approach
Wednesday, May 29, 13
Responsive Web Design
Navigation
The “Stacked Navigation” method
Wednesday, May 29, 13
Responsive Web Design
Navigation
Footer Anchor
Image Credit: Brad Frost
Wednesday, May 29, 13
Responsive Web Design
Navigation
Select Menu
Image Credit: Brad Frost
Wednesday, May 29, 13
Responsive Web Design
Navigation
Toggle
Wednesday, May 29, 13
Responsive Web Design
Navigation
Left Nav Flyout
Wednesday, May 29, 13
Responsive Web Design
Navigation
The “Hide and Cry”
Wednesday, May 29, 13
Responsive Web Design
Navigation
Live example
Wednesday, May 29, 13
Responsive Web Design
04Responsive ImagesLoading a image for a small screen? Eh.
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
Responsive Images
• max-width: 100%
• Picturefill
• Bandwidth testing
Wednesday, May 29, 13
Responsive Web Design
Lazy man’s images
img {
max-width: 100%;
}
Wednesday, May 29, 13
Responsive Web Design
Picturefill
<div data-picture data-alt=”A Fat Brown Dog”>
<div data-src=”small.jpg” data-media=”(max-width:600px)”></div>
<div data-src=”hd.jpg” data-media=”(min-device-pixel-ratio: 2.0)”></div>
<noscript>
<img src=”fat-dog.jpg” alt=”A Fat Brown Dog”>
</noscript>
</div>
Wednesday, May 29, 13
Responsive Web Design
Picturefill
Live example
Wednesday, May 29, 13
Responsive Web Design
Bandwidth Testing
navigator.mozConnection.bandwidth
if(Manage.connection === “good”) {
// you have ample bandwidth
}
https://github.com/timwright12/js-asset-management
Wednesday, May 29, 13
Responsive Web Design
05Responsive JavaScriptGulp...
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
Responsive JavaScript
body:before {
content: “widescreen”;
position: absolute;
top: -9999px;
left: -9999px;
}
@media screen and (max-width:600px) {
content: “smallscreen”;
}
Wednesday, May 29, 13
Responsive Web Design
Responsive JavaScript
// set the initial screen size
var size = window.getComputedStyle(document.body,':before').getPropertyValue('content');
// check the breakpoint on resize
window.addEventListener(“resize”, function(){
size = window.getComputedStyle(document.body,':before').getPropertyValue('content');
if (size.indexOf(“smallscreen”) != -1) {
// do small screen JS
} else {
// do large screen JS
}
}, false);
Wednesday, May 29, 13
Responsive Web Design
Responsive JavaScript
Basic example
Wednesday, May 29, 13
Responsive Web Design
Responsive JavaScript
Over the top example
Wednesday, May 29, 13
Responsive Web Design
06Responsive Design & the ServerLean on me... when you’re not strooooong... and I’ll be your friend...
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
RESS
?
Yes, do
something
mobile
No.
Wednesday, May 29, 13
Responsive Web Design
RESS
In the browser On the server
• Screen size
• Orientation
• Design changes (CSS)
• Is mobile?
• Structural changes (HTML)
Wednesday, May 29, 13
Wednesday, May 29, 13
Wednesday, May 29, 13
Responsive Web Design
RESS
?
Insert call button
& use native
datepicker
Async load jQuery UI &
date picker base CSS
YES!
NO!
Wednesday, May 29, 13
Responsive Web Design
RESS
What is the window size? Is touch available?
• Answered with media
queries
• No - Do nothing
• Yes - Async load touch
interactions (swiping)
Wednesday, May 29, 13
Responsive Web Design
What we went over
• Progressive Enhancement
• Best Practices
• Setting Breakpoints
• Design Patterns
• Responsive Media
• Responsive JavaScript
• RESS (RWD with Server-side Components)
Wednesday, May 29, 13
Responsive Web Design
Books
Responsive Web Design
by Ethan Marcotte
Wednesday, May 29, 13
Responsive Web Design
Articles
• Responsive Web Design
http://www.alistapart.com/articles/responsive-web-design/
• Guidelines for Responsive Design
http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/
• Design Process in a Responsive Age
http://uxdesign.smashingmagazine.com/2012/05/30/design-process-responsive-age/
• Adaptive vs. Responsive Design
http://uxdesign.smashingmagazine.com/2012/11/08/ux-design-qa-with-christian-holst/
• Responsive Design is more than breakpoints
http://inspectelement.com/articles/responsive-web-design-is-so-more-than-just-a-few-
breakpoints/
Wednesday, May 29, 13
Responsive Web Design
Tools & Plugins
• Picturefill
https://github.com/scottjehl/picturefill
• FitVids
http://fitvidsjs.com/
• RespondJS
https://github.com/scottjehl/Respond
• Testing a Responsive Site
http://mattkersley.com/responsive/
• Multi-device layout patterns
http://www.lukew.com/ff/entry.asp?1514
Wednesday, May 29, 13
Responsive Web Design
Folks on Twitter
• Responsive Design, @rwd
• Mat Marquis, @wilto
• Chris Coyier, @chriscoyier
• Brad Frost, @brad_frost
• Luke Wroblewski, @lukew
Wednesday, May 29, 13
Responsive Web Design
A Podcast
Web:
freshtilledsoil.com/thedirt
Twitter:
@thedirtshow
@freshtilledsoil
Wednesday, May 29, 13
Responsive Web Design
Slides
ftsdesign.com/labs/rwd-tnw/slides.pdf
Wednesday, May 29, 13
Responsive Web Design
Questions/Comments
E-mail: tim.wright@freshtilledsoil.com
Twitter: @csskarma
Fresh Tilled Labs: freshtilledsoil.com/habitat/labs
Wednesday, May 29, 13

Mais conteúdo relacionado

Destaque

Mobile, Media & Touch
Mobile, Media & TouchMobile, Media & Touch
Mobile, Media & Touch
Tim Wright
 
Design process
Design processDesign process
Design process
Tim Wright
 
Color & Typography
Color & TypographyColor & Typography
Color & Typography
Tim Wright
 

Destaque (13)

Creating Contextual Applications with Maslow & The Device API
Creating Contextual Applications with Maslow & The Device APICreating Contextual Applications with Maslow & The Device API
Creating Contextual Applications with Maslow & The Device API
 
Bringing Environmental Design to the Web
Bringing Environmental Design to the WebBringing Environmental Design to the Web
Bringing Environmental Design to the Web
 
Implementing a Scalable Mobile Strategy
Implementing a Scalable Mobile StrategyImplementing a Scalable Mobile Strategy
Implementing a Scalable Mobile Strategy
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Mobile, Media & Touch
Mobile, Media & TouchMobile, Media & Touch
Mobile, Media & Touch
 
USC dot EDU: A Responsive Design Case Study
USC dot EDU: A Responsive Design Case StudyUSC dot EDU: A Responsive Design Case Study
USC dot EDU: A Responsive Design Case Study
 
Design process
Design processDesign process
Design process
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
Color & Typography
Color & TypographyColor & Typography
Color & Typography
 
Building an Atomic Design System
Building an Atomic Design SystemBuilding an Atomic Design System
Building an Atomic Design System
 
Form design
Form designForm design
Form design
 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5
 
HTML 5: The Future of the Web
HTML 5: The Future of the WebHTML 5: The Future of the Web
HTML 5: The Future of the Web
 

Semelhante a Keys to Responsive Design

Responsive Design Talk @ Toronto Dev Derby March
Responsive Design Talk @ Toronto Dev Derby MarchResponsive Design Talk @ Toronto Dev Derby March
Responsive Design Talk @ Toronto Dev Derby March
themystic_ca
 
Responsive design lunch and learn
Responsive design lunch and learnResponsive design lunch and learn
Responsive design lunch and learn
Ricardo Queiroz
 
Prairie Dev Con West - 2012-03-15 - Responsive Web Design
Prairie Dev Con West - 2012-03-15 - Responsive Web DesignPrairie Dev Con West - 2012-03-15 - Responsive Web Design
Prairie Dev Con West - 2012-03-15 - Responsive Web Design
Frédéric Harper
 
Why should we build our website responsive
Why should we build our website responsiveWhy should we build our website responsive
Why should we build our website responsive
Omkarsoft Bangalore
 

Semelhante a Keys to Responsive Design (20)

Keys to Responsive Design
Keys to Responsive DesignKeys to Responsive Design
Keys to Responsive Design
 
Design responsively
Design responsivelyDesign responsively
Design responsively
 
Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18
 
How to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteHow to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive Website
 
3 Ways to Go Mobile First with Responsive Design
3 Ways to Go Mobile First with Responsive Design3 Ways to Go Mobile First with Responsive Design
3 Ways to Go Mobile First with Responsive Design
 
Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2Responsive Design in iMIS Part 2
Responsive Design in iMIS Part 2
 
Responsive Design Talk @ Toronto Dev Derby March
Responsive Design Talk @ Toronto Dev Derby MarchResponsive Design Talk @ Toronto Dev Derby March
Responsive Design Talk @ Toronto Dev Derby March
 
Responsive Design Lessons
Responsive Design LessonsResponsive Design Lessons
Responsive Design Lessons
 
Responsive web design ppt
Responsive web design pptResponsive web design ppt
Responsive web design ppt
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Progressive Enhancement
Progressive EnhancementProgressive Enhancement
Progressive Enhancement
 
Responsive design lunch and learn
Responsive design lunch and learnResponsive design lunch and learn
Responsive design lunch and learn
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
Prairie Dev Con West - 2012-03-15 - Responsive Web Design
Prairie Dev Con West - 2012-03-15 - Responsive Web DesignPrairie Dev Con West - 2012-03-15 - Responsive Web Design
Prairie Dev Con West - 2012-03-15 - Responsive Web Design
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Making Your Site Printable: Booster Conference
Making Your Site Printable: Booster ConferenceMaking Your Site Printable: Booster Conference
Making Your Site Printable: Booster Conference
 
Why should we build our website responsive
Why should we build our website responsiveWhy should we build our website responsive
Why should we build our website responsive
 
Get responsive in 30 minutes (WordCamp Sofia)
Get responsive in 30 minutes (WordCamp Sofia)Get responsive in 30 minutes (WordCamp Sofia)
Get responsive in 30 minutes (WordCamp Sofia)
 
Building Responsive Websites with Drupal
Building Responsive Websites with DrupalBuilding Responsive Websites with Drupal
Building Responsive Websites with Drupal
 
Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012
Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012
Creating a Responsive Drupal Theme: Presentation from DrupalCamp Montreal 2012
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Keys to Responsive Design