SlideShare una empresa de Scribd logo
1 de 79
Descargar para leer sin conexión
What is responsive?
And do I need it?
Carsten Sandtner  IPC 2015  @casarock
Carsten
Sandtner
Head of Development
@mediaman GmbH
Web Developer since 1998
@casarock
History!
https://flic.kr/p/9iMKjU
First responsive
Webpage!
The first website!
Print Design!
https://flic.kr/p/8xbEBF
Design for one resolution
Bring print to the web (1:1)
Pixelperfect
dummy.gif
Floating boxes
https://flic.kr/p/4MFRpB
Finally a solution?
„depends“
=>
https://css-tricks.com/all-about-floats/
1994
Media Queries
HåkonWiumLie
1997
Media Queries: HTML4
considers to include them
2001
Media Queries:
Working draft
mobile
„revolution“
2008
2010
Responsive Web Design
EricMarcotte//Photoby:MartinKraft[CCBY-SA3.0]
http://alistapart.com/article/responsive-web-design
Combination of:
media queries
flexible widths
flexible images
RWD
2010
2012
Media Queries: W3C
Recommendation
Flexbox
https://flic.kr/p/nnnhq3
„The CSS3 Flexible Box, or flexbox, is a
layout mode providing for the
arrangement of elements on a page
such that the elements behave
predictably when the page layout must
accommodate different screen sizes
and different display devices.“
MDN: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes
display: box;
~2009
Flexbox (first version)
display: flexbox;
~2011
Flexbox (second version)
display: flex;
> 2011
Flexbox (specification!)
RWD - in a nutshell
https://flic.kr/p/bYxKaN
Liquid:
fluid layout
Adaptive:
pre-defined layout widths
media queries
Definitions
liquid vs. adaptive
Definitions
responsive
http://blog.froont.com/9-basic-principles-of-responsive-web-design/
Combination
„Optimal rendering across devices“Goal
https://flic.kr/p/anLcHu
https://www.youtube.com/watch?v=SpRBvtm_wrQ
What could possibly go
wrong?
Image Sizes
too Big
Megabytes of data!
Even for mobile.
Images look a little fuzzy in high
resolutions.
Image Sizes
too small
Solution?
<img src="fallback.jpg"
srcset="small.jpg 640w 1x,
small-hd.jpg 640w 2x,
large.jpg 1x,
large-hd.jpg 2x"
alt="…">
HTML/CSS
srcset
<picture alt="description">
<source src="small.jpg">
<source src="medium.jpg"
media="(min-width: 40em)">
<source src="large.jpg"
media="(min-width: 80em)">
</picture>
HTML/CSS
picture
Support…
Browser Support
srcset vs. picture
http://caniuse.com
Meanwhile
https://flic.kr/p/fqofd6
Deliver same Content
Why?!
Content
Mobile users want compact content
Why should I deliver hidden
content then?
Content
same same but different
Rearrange Content on different
View Ports?
Content
structure
.some-element {
display: flex;
flex-direction: row;
order: 1;
}
Flexbox FTW!
Browser Support
flexbox
http://caniuse.com
Why load and parse unused
Javascripts and CSS?
Content
Javascripts/CSS
<!DOCTYPE HTML>
<html lang="en-US">
<head>
…
<link rel=“stylesheet" media=“screen
and (min-width: 600px)"
href=“small.css">
<link rel=“stylesheet" media=“screen
and (min-width: 2048px)“
href=“biggest.css">
…
</head>
<body>
…
</body>
</html>
Conditional loading?
CSS
Back to …
https://flic.kr/p/fqofd6
Don’t even think about parallax…
Don’t even think about parallax on
mobile!
Effects
Javascript
https://flic.kr/p/cvvPLq
<script>
if (document.documentElement.clientWidth > 640) {
document.write('<script src="//ads.com/banner.js"></script>');
document.write('<script src="livechat.js"></script>');
}
</script>
Conditional loading?
<script data-mq="(min-width: 640px)"
data-src="//ads.com/banner.js"></script>
<script data-mq="(min-width: 640px)"
data-src="livechat.js" ></script>
<script>
var scripts = document.getElementsByTagName("script");
for(var i=0;i<scripts.length; i++) {
// Test if the Media Query matches
var mq = scripts[i].getAttribute("data-mq");
if (mq && window.matchMedia(mq).matches) {
// If so, append the new (async) element.
var s = document.createElement("script");
s.type = 'text/javascript';
s.src = scripts[i].getAttribute("data-src");
document.body.appendChild(s);
}
}
</script>
Better
Conditional loading?
https://www.safaribooksonline.com/library/view/responsive-fast/9781491912935/ch04.html
Desktop vs. mobile
https://flic.kr/p/bmJtgf
Mobile first?
Use Case!
Consider
Same content across devices?
Page with a lot of visuals?
Target group?
Target screen size?
Content rich sites
m.domains?
Pro
lightweight
mobile optimized
Con
SEO
„One URL per Page“
redirects
m.domain
Should I….
Client site feature
detection
https://flic.kr/p/ac3oaX
Feature detection
Conditional loading helpers
Modernizr
features
<script>
if (Modernizr.webgl){
doFancyStuff();
} else {
doSlowFancyStuff();
}
</script>
Feature
detection
<script>
Modernizr.load({
test: Modernizr.geolocation,
yep : ['geo.js', 'superfancy.css']
nope: 'geo-polyfill.js'
});
</script>
Conditional
loading
It helps a lot, but you still detect
everything at your clients browser!
Modernizr
Swiss army knife?
RWD starts at your Server
https://flic.kr/p/ac3oaX
Device-Description-Repository
Image optimization
Preprocessing HTML
Server
Viewport
Interaction model (touch?)
Hardware (Sensors)
Device-Description-
Repository
more than screen sizes…
Some Images are
scaleable
some not
Don’t load more than you’re going to show!
Image optimization
Why?
„optimized“ HTML across Screens
Less logic, less Javascript!
Hidden content not necessary
Preprocessing HTML
Serversite rendering
https://flic.kr/p/ac3oaX
reloaded!
Pro
less bloated HTML
only needed scripts will get loaded
Contra
higher server load
device detection is not reliable!
Server-Site Rendering
Best of both
https://flic.kr/p/69ZiLn
Responsive Design +
Server Side Components
1. Get a DDR
2. Write Server-Side Code using
DDR (e.g. conditional loading
etc.)
3. Enhance rendered HTML on
Client-Side
RESS
In a nutshell
1. Get a DDR
2. Detect features on Client-
Side
3. Write Server-Side Code using
DDR (e.g. conditional loading
etc.)
4. Set Cookies, reload.
RESS
In a nutshell
Websites should be loaded FAST
Websites should have a nice UX
Content should be optimized!
Content should be meaningful!
Why such a hassle?
Conclusion
https://flic.kr/p/7Cv2gu
Know your use case
Involve your server
RWD is NOT the holy grail!
sometimes a mobile site makes sense
Don’t forget the user!
Conclusion
Links
https://bradfrost.github.io/this-is-responsive/
http://www.liquidapsive.com/
http://alistapart.com/article/responsive-web-design
https://www.youtube.com/watch?v=XhCXINNvmv8
http://modernizr.com/
Questions?
https://flic.kr/p/qTw4b4
Contact me:
@casarock
hallo@appsbu.de

Más contenido relacionado

Similar a What is responsive - and do I need it?

Bruce lawson-over-the-air
Bruce lawson-over-the-airBruce lawson-over-the-air
Bruce lawson-over-the-airbrucelawson
 
Developing for Mobile Web
Developing for Mobile WebDeveloping for Mobile Web
Developing for Mobile WebBarbara Bermes
 
Responsive Design - WordUp Edinburgh 2011
Responsive Design - WordUp Edinburgh 2011Responsive Design - WordUp Edinburgh 2011
Responsive Design - WordUp Edinburgh 2011Epitome Solutions Ltd
 
CMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentCMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentSarang Ananda Rao
 
Transmission2 25.11.2009
Transmission2 25.11.2009Transmission2 25.11.2009
Transmission2 25.11.2009Patrick Lauke
 
resume_2016_low_rez
resume_2016_low_rezresume_2016_low_rez
resume_2016_low_rezJames Gray
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
Openkapow At Mashup Camp 5
Openkapow At Mashup Camp 5Openkapow At Mashup Camp 5
Openkapow At Mashup Camp 5Andreas Krohn
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Webmikeleeme
 
Building Mobile Websites with Joomla
Building Mobile Websites with JoomlaBuilding Mobile Websites with Joomla
Building Mobile Websites with JoomlaTom Deryckere
 
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 BolognaResponsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 Bolognaalfredo furnò
 
Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012Tom Hermans
 
Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Christian Heilmann
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oiljameswillweb
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web DevelopmentRachel Andrew
 

Similar a What is responsive - and do I need it? (20)

Bruce lawson-over-the-air
Bruce lawson-over-the-airBruce lawson-over-the-air
Bruce lawson-over-the-air
 
Developing for Mobile Web
Developing for Mobile WebDeveloping for Mobile Web
Developing for Mobile Web
 
Responsive Design - WordUp Edinburgh 2011
Responsive Design - WordUp Edinburgh 2011Responsive Design - WordUp Edinburgh 2011
Responsive Design - WordUp Edinburgh 2011
 
Always on! ... or not?
Always on! ... or not?Always on! ... or not?
Always on! ... or not?
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
CMS & Chrome Extension Development
CMS & Chrome Extension DevelopmentCMS & Chrome Extension Development
CMS & Chrome Extension Development
 
Transmission2 25.11.2009
Transmission2 25.11.2009Transmission2 25.11.2009
Transmission2 25.11.2009
 
resume_2016_low_rez
resume_2016_low_rezresume_2016_low_rez
resume_2016_low_rez
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Openkapow At Mashup Camp 5
Openkapow At Mashup Camp 5Openkapow At Mashup Camp 5
Openkapow At Mashup Camp 5
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Web
 
Building Mobile Websites with Joomla
Building Mobile Websites with JoomlaBuilding Mobile Websites with Joomla
Building Mobile Websites with Joomla
 
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 BolognaResponsive Design con TYPO3 - T3Camp Italia 2012 Bologna
Responsive Design con TYPO3 - T3Camp Italia 2012 Bologna
 
Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012
 
A Mobile Solution for #TheUnderdog
A Mobile Solution for #TheUnderdogA Mobile Solution for #TheUnderdog
A Mobile Solution for #TheUnderdog
 
Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010Enjoying the full stack - Frontend 2010
Enjoying the full stack - Frontend 2010
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web Development
 

Más de Carsten Sandtner

WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016Carsten Sandtner
 
Evolution der Web Entwicklung
Evolution der Web EntwicklungEvolution der Web Entwicklung
Evolution der Web EntwicklungCarsten Sandtner
 
HTML5 Games for Web & Mobile
HTML5 Games for Web & MobileHTML5 Games for Web & Mobile
HTML5 Games for Web & MobileCarsten Sandtner
 
Web APIs - Mobiletech Conference 2015
Web APIs - Mobiletech Conference 2015Web APIs - Mobiletech Conference 2015
Web APIs - Mobiletech Conference 2015Carsten Sandtner
 
Web APIs – expand what the Web can do
Web APIs – expand what the Web can doWeb APIs – expand what the Web can do
Web APIs – expand what the Web can doCarsten Sandtner
 
Firefox OS - A (mobile) Web Developers dream - DWX14
Firefox OS - A (mobile) Web Developers dream - DWX14Firefox OS - A (mobile) Web Developers dream - DWX14
Firefox OS - A (mobile) Web Developers dream - DWX14Carsten Sandtner
 
Firefox OS - A (web) developers dream - muxCamp 2014
Firefox OS - A (web) developers dream - muxCamp 2014Firefox OS - A (web) developers dream - muxCamp 2014
Firefox OS - A (web) developers dream - muxCamp 2014Carsten Sandtner
 
Mozilla Brick - Frontend Rhein-Main June 2014
Mozilla Brick - Frontend Rhein-Main June 2014Mozilla Brick - Frontend Rhein-Main June 2014
Mozilla Brick - Frontend Rhein-Main June 2014Carsten Sandtner
 
Traceur - Javascript.next - Now! RheinmainJS April 14th
Traceur - Javascript.next - Now! RheinmainJS April 14thTraceur - Javascript.next - Now! RheinmainJS April 14th
Traceur - Javascript.next - Now! RheinmainJS April 14thCarsten Sandtner
 

Más de Carsten Sandtner (14)

State of Web APIs 2017
State of Web APIs 2017State of Web APIs 2017
State of Web APIs 2017
 
Headless in the CMS
Headless in the CMSHeadless in the CMS
Headless in the CMS
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016
 
Evolution der Web Entwicklung
Evolution der Web EntwicklungEvolution der Web Entwicklung
Evolution der Web Entwicklung
 
WebVR - JAX 2016
WebVR -  JAX 2016WebVR -  JAX 2016
WebVR - JAX 2016
 
HTML5 Games for Web & Mobile
HTML5 Games for Web & MobileHTML5 Games for Web & Mobile
HTML5 Games for Web & Mobile
 
Web apis JAX 2015 - Mainz
Web apis JAX 2015 - MainzWeb apis JAX 2015 - Mainz
Web apis JAX 2015 - Mainz
 
Web APIs - Mobiletech Conference 2015
Web APIs - Mobiletech Conference 2015Web APIs - Mobiletech Conference 2015
Web APIs - Mobiletech Conference 2015
 
Web APIs – expand what the Web can do
Web APIs – expand what the Web can doWeb APIs – expand what the Web can do
Web APIs – expand what the Web can do
 
Firefox OS - A (mobile) Web Developers dream - DWX14
Firefox OS - A (mobile) Web Developers dream - DWX14Firefox OS - A (mobile) Web Developers dream - DWX14
Firefox OS - A (mobile) Web Developers dream - DWX14
 
Firefox OS - A (web) developers dream - muxCamp 2014
Firefox OS - A (web) developers dream - muxCamp 2014Firefox OS - A (web) developers dream - muxCamp 2014
Firefox OS - A (web) developers dream - muxCamp 2014
 
Mozilla Brick - Frontend Rhein-Main June 2014
Mozilla Brick - Frontend Rhein-Main June 2014Mozilla Brick - Frontend Rhein-Main June 2014
Mozilla Brick - Frontend Rhein-Main June 2014
 
Traceur - Javascript.next - Now! RheinmainJS April 14th
Traceur - Javascript.next - Now! RheinmainJS April 14thTraceur - Javascript.next - Now! RheinmainJS April 14th
Traceur - Javascript.next - Now! RheinmainJS April 14th
 

What is responsive - and do I need it?