SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Building Responsive
 Websites and Apps
 with Drupal
 Dallas Drupal Days 2011




2011.07.09 - Dallas Drupal Days
http://dallasdrupal.org/sessions/building-responsive-websites-and-apps-
drupal
What is Responsive?
‣   Responsive layouts are the original design on the
    web: http://naked.dustindiaz.com/
‣   As screens got bigger, we got pickier about the
    look of a site on the desktop monitor
What is Responsive?
 ‣   Now we deal with these:




Credits: Aaron Stanush
What is Responsive?
 ‣   Now we deal with these:




Credits: Aaron Stanush
What is Responsive?
 ‣   Not to mention these:




Credits: http://j.mp/rethink-mobile
So many browsers




Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
So many browsers
 ‣   Do you really have time to test for and cater to:




Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
So many browsers
 ‣   Do you really have time to test for and cater to:
       ‣   Chrome, Firefox, Safari, Opera, Internet
           Explorer, Symbian, iPhone, iPad, Android
           phones, Android tablets, RIM (Blackberry),
           Windows CE, Windows mobile, Windows Phone
           7, Linux, bada, MeeGo, Brew OS




Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
So many browsers
 ‣   Do you really have time to test for and cater to:
       ‣   Chrome, Firefox, Safari, Opera, Internet
           Explorer, Symbian, iPhone, iPad, Android
           phones, Android tablets, RIM (Blackberry),
           Windows CE, Windows mobile, Windows Phone
           7, Linux, bada, MeeGo, Brew OS
       ‣   ...boo


Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
Forget about...
Forget about...
‣   User-agent detection + Separate mobile theme
Forget about...
‣   User-agent detection + Separate mobile theme
‣   Separate subdomain / path + redirection
Forget about...
‣   User-agent detection + Separate mobile theme
‣   Separate subdomain / path + redirection
‣   External services
Forget about...
‣   User-agent detection + Separate mobile theme
‣   Separate subdomain / path + redirection
‣   External services
‣   These are alternatives, each with strengths and
    weaknesses. We don’t care about them today :)
Go Responsive
Go Responsive
‣   Use the front-end the way it wants to be used —
    as a versatile presentation layer
Go Responsive
‣   Use the front-end the way it wants to be used —
    as a versatile presentation layer
‣   The layout of a website can shift and adapt to
    changes in screen size and device capability
Go Responsive
‣   Use the front-end the way it wants to be used —
    as a versatile presentation layer
‣   The layout of a website can shift and adapt to
    changes in screen size and device capability
‣   CSS3 Media Queries
    JavaScript tools that adapt real-time
    Feature detection
Example




Credits: http://mediaqueri.es
Example




Credits: http://mediaqueri.es
CSS Media Queries




<plug> or check out http://fourkitchens.com </
plug>
CSS Media Queries
 ‣   The spec:        http://www.w3.org/TR/css3-mediaqueries/




<plug> or check out http://fourkitchens.com </
plug>
CSS Media Queries
 ‣   The spec:        http://www.w3.org/TR/css3-mediaqueries/

 ‣   The buzz:         http://www.alistapart.com/articles/responsive-web-design/




<plug> or check out http://fourkitchens.com </
plug>
CSS Media Queries
 ‣   The spec:        http://www.w3.org/TR/css3-mediaqueries/

 ‣   The buzz:         http://www.alistapart.com/articles/responsive-web-design/

 ‣   The hotness:           http://mediaqueri.es




<plug> or check out http://fourkitchens.com </
plug>
Basic Example
<link rel=”stylesheet” href=”this.css”>
Basic Example
<link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”>
Basic Example
 <link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”>




 /* This CSS will always apply - global styles */
 body {padding: 10px; }
 #container {width: 100%; margin: 0; }




Do not use these in conjunction!
Basic Example
 <link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”>




 /* This CSS will always apply - global styles */
 body {padding: 10px; }
 #container {width: 100%; margin: 0; }

 /* This CSS will only apply when the window is 960px or greater */
 @media screen and (min-width: 960px) {
   body {padding: 0; }
   #container {width: 960px; margin: 0 auto; }
 }




Do not use these in conjunction!
cool, but...
cool, but...
‣   IE 8 and below do not recognize media queries
    (weep not, more on this later)
cool, but...
‣   IE 8 and below do not recognize media queries
    (weep not, more on this later)

‣   Don’t just pop open your existing stylesheets, wrap
    them in queries, and call it a day
cool, but...
‣   IE 8 and below do not recognize media queries
    (weep not, more on this later)

‣   Don’t just pop open your existing stylesheets, wrap
    them in queries, and call it a day
‣   We need to mentally remove the line between
    mobile and desktop...
cool, but...
‣   IE 8 and below do not recognize media queries
    (weep not, more on this later)

‣   Don’t just pop open your existing stylesheets, wrap
    them in queries, and call it a day
‣   We need to mentally remove the line between
    mobile and desktop...
‣   ...but don’t freak out.
    They’re just differently sized screens.
Mobile First Approach




http://j.mp/rethink-mobile
Mobile First Approach
 ‣   aka Progressive Enhancement




http://j.mp/rethink-mobile
Mobile First Approach
 ‣   aka Progressive Enhancement
 ‣   Read, re-read, and bookmark (game changer)
     http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu




http://j.mp/rethink-mobile
Mobile First Approach
 ‣   aka Progressive Enhancement
 ‣   Read, re-read, and bookmark (game changer)
     http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu




http://j.mp/rethink-mobile
Progressive CSS




http://j.mp/rethink-mobile
Progressive CSS
 ‣   No media query support is a media query




http://j.mp/rethink-mobile
Progressive CSS
 ‣   No media query support is a media query
 ‣   Target the least capable browser first




http://j.mp/rethink-mobile
Progressive CSS
 ‣   No media query support is a media query
 ‣   Target the least capable browser first
 ‣   Query for more functional browsers




http://j.mp/rethink-mobile
Progressive CSS
 ‣   No media query support is a media query
 ‣   Target the least capable browser first
 ‣   Query for more functional browsers
 ‣   More compatible than when you start with desktop
     styles and filter “down” to mobile version




http://j.mp/rethink-mobile
Feature Detection




http://www.modernizr.com/
Feature Detection
‣   Not just limited to screen size




http://www.modernizr.com/
Feature Detection
‣   Not just limited to screen size
‣   Modernizr tests for the specific features you need




http://www.modernizr.com/
Feature Detection
‣   Not just limited to screen size
‣   Modernizr tests for the specific features you need
‣   More reliable than user-agent detection




http://www.modernizr.com/
Feature Detection
‣   Not just limited to screen size
‣   Modernizr tests for the specific features you need
‣   More reliable than user-agent detection
‣   Modular and lightweight, pick your tests:
    http://www.modernizr.com/download/




http://www.modernizr.com/
Drupal Modules
Drupal Modules
‣   Semantic Views: http://drupal.org/project/semanticviews
    Allows you to clean up your Views output sans templates
Drupal Modules
‣   Semantic Views: http://drupal.org/project/semanticviews
    Allows you to clean up your Views output sans templates

‣   Responder: http://drupal.org/sandbox/rupl/1104416
    Force module stylesheets into mobile-first approach
Drupal Themes
‣   Sadly, this is lacking at the moment.
‣   We haven’t yet found solid patterns that can be
    encapsulated into a theme.
‣   Look for responsive designs to pop up in distros
    before there’s a go-to solution in Drupal proper
Useful Libraries
Useful Libraries
‣   Respond.js - For I       ncapabl   E browsers
    https://github.com/scottjehl/Respond
Useful Libraries
‣   Respond.js - For I       ncapabl   E browsers
    https://github.com/scottjehl/Respond

‣   Responsive-Images - Bandwidth savings for smaller
    screens
    https://github.com/filamentgroup/Responsive-Images
Useful Libraries
‣   Respond.js - For I       ncapabl   E browsers
    https://github.com/scottjehl/Respond

‣   Responsive-Images - Bandwidth savings for smaller
    screens
    https://github.com/filamentgroup/Responsive-Images

‣   Adapt.js - JavaScript alternative to media queries.
    Built upon 960 Grid System
    https://github.com/nathansmith/adapt
Front-end Performance




http://www.webperformancetoday.com/2011/04/20/
desktop-vs-mobile-web-page-load-speed/
Front-end Performance
‣   Up to 97% of perceived mobile response time
    depends on the front-end... really




http://www.webperformancetoday.com/2011/04/20/
desktop-vs-mobile-web-page-load-speed/
Front-end Performance
‣   Up to 97% of perceived mobile response time
    depends on the front-end... really
‣   Your super-stack might serve requests quickly, but
    if you don’t request quickly, it still seems slow.




http://www.webperformancetoday.com/2011/04/20/
desktop-vs-mobile-web-page-load-speed/
Front-end Performance
Front-end Performance
‣   Cache HTML, internal and external if possible
Front-end Performance
‣   Cache HTML, internal and external if possible
‣   Optimize CSS/JS
Front-end Performance
‣   Cache HTML, internal and external if possible
‣   Optimize CSS/JS
‣   Move $scripts to the bottom of your templates
Front-end Performance
‣   Cache HTML, internal and external if possible
‣   Optimize CSS/JS
‣   Move $scripts to the bottom of your templates
‣   Use responsive images, data URIs, and/or sprites
Check your Work
Check your Work
Check your Work


‣   YSlow
    http://developer.yahoo.com/yslow/
Check your Work


‣   YSlow
    http://developer.yahoo.com/yslow/

‣   Page Speed
    http://code.google.com/speed/page-speed/docs/extension.html
Thank You!
 chris@fourkitchens.com
 twitter.com/rupl
 http://drupal.org/user/411999



2011.07.09 - Dallas Drupal Days
http://dallasdrupal.org/sessions/building-responsive-websites-and-apps-drupal
All content in this presentation, except where noted otherwise, is Creative Commons Attribution-
ShareAlike 3.0 licensed and copyright 2011 Four Kitchens, LLC.

Weitere ähnliche Inhalte

Andere mochten auch

Mobile Consumer Report 2013 por Nielsen
Mobile Consumer Report 2013 por NielsenMobile Consumer Report 2013 por Nielsen
Mobile Consumer Report 2013 por NielsenIAB México
 
解读信息设计
解读信息设计解读信息设计
解读信息设计dasiyjun
 
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12Boston Library Consortium (BLC) annual meeting keynote 2007-04-12
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12Casey Bisson
 
Where do we go from here? Linking community organizing, people living with HI...
Where do we go from here? Linking community organizing, people living with HI...Where do we go from here? Linking community organizing, people living with HI...
Where do we go from here? Linking community organizing, people living with HI...Alex McClelland
 
186 Ellesmere
186 Ellesmere186 Ellesmere
186 Ellesmereleeekim
 
WordCamp NYC Authentication 2009-11-13
WordCamp NYC Authentication 2009-11-13WordCamp NYC Authentication 2009-11-13
WordCamp NYC Authentication 2009-11-13Casey Bisson
 
Accenture Social Media PoV - 55m conversations in 55 days
Accenture Social Media PoV - 55m conversations in 55 days Accenture Social Media PoV - 55m conversations in 55 days
Accenture Social Media PoV - 55m conversations in 55 days Mac Karlekar
 
Trenul Vietii(2)
Trenul Vietii(2)Trenul Vietii(2)
Trenul Vietii(2)guest891867
 
Study skills powerpoint
Study skills powerpointStudy skills powerpoint
Study skills powerpointAnna Calvi
 
פורום סמנכלי משא הזמנה למפגש שני מועד מעודכן Doc
פורום סמנכלי משא   הזמנה למפגש שני   מועד מעודכן Docפורום סמנכלי משא   הזמנה למפגש שני   מועד מעודכן Doc
פורום סמנכלי משא הזמנה למפגש שני מועד מעודכן DocVPHR
 
Pucca
PuccaPucca
Puccaada
 

Andere mochten auch (17)

Mobile Consumer Report 2013 por Nielsen
Mobile Consumer Report 2013 por NielsenMobile Consumer Report 2013 por Nielsen
Mobile Consumer Report 2013 por Nielsen
 
F I L E
F I L EF I L E
F I L E
 
Writing In Science
Writing In ScienceWriting In Science
Writing In Science
 
解读信息设计
解读信息设计解读信息设计
解读信息设计
 
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12Boston Library Consortium (BLC) annual meeting keynote 2007-04-12
Boston Library Consortium (BLC) annual meeting keynote 2007-04-12
 
Where do we go from here? Linking community organizing, people living with HI...
Where do we go from here? Linking community organizing, people living with HI...Where do we go from here? Linking community organizing, people living with HI...
Where do we go from here? Linking community organizing, people living with HI...
 
186 Ellesmere
186 Ellesmere186 Ellesmere
186 Ellesmere
 
WordCamp NYC Authentication 2009-11-13
WordCamp NYC Authentication 2009-11-13WordCamp NYC Authentication 2009-11-13
WordCamp NYC Authentication 2009-11-13
 
Morumotto
MorumottoMorumotto
Morumotto
 
Accenture Social Media PoV - 55m conversations in 55 days
Accenture Social Media PoV - 55m conversations in 55 days Accenture Social Media PoV - 55m conversations in 55 days
Accenture Social Media PoV - 55m conversations in 55 days
 
Trenul Vietii(2)
Trenul Vietii(2)Trenul Vietii(2)
Trenul Vietii(2)
 
Study skills powerpoint
Study skills powerpointStudy skills powerpoint
Study skills powerpoint
 
פורום סמנכלי משא הזמנה למפגש שני מועד מעודכן Doc
פורום סמנכלי משא   הזמנה למפגש שני   מועד מעודכן Docפורום סמנכלי משא   הזמנה למפגש שני   מועד מעודכן Doc
פורום סמנכלי משא הזמנה למפגש שני מועד מעודכן Doc
 
Pucca
PuccaPucca
Pucca
 
September 2011 Ur-Energy Corporate Presentation
September 2011 Ur-Energy Corporate PresentationSeptember 2011 Ur-Energy Corporate Presentation
September 2011 Ur-Energy Corporate Presentation
 
Aladin
AladinAladin
Aladin
 
2009 2010
2009 20102009 2010
2009 2010
 

Kürzlich hochgeladen

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Kürzlich hochgeladen (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Building Responsive Websites in Drupal

  • 1. Building Responsive Websites and Apps with Drupal Dallas Drupal Days 2011 2011.07.09 - Dallas Drupal Days http://dallasdrupal.org/sessions/building-responsive-websites-and-apps- drupal
  • 2. What is Responsive? ‣ Responsive layouts are the original design on the web: http://naked.dustindiaz.com/ ‣ As screens got bigger, we got pickier about the look of a site on the desktop monitor
  • 3. What is Responsive? ‣ Now we deal with these: Credits: Aaron Stanush
  • 4. What is Responsive? ‣ Now we deal with these: Credits: Aaron Stanush
  • 5. What is Responsive? ‣ Not to mention these: Credits: http://j.mp/rethink-mobile
  • 6. So many browsers Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
  • 7. So many browsers ‣ Do you really have time to test for and cater to: Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
  • 8. So many browsers ‣ Do you really have time to test for and cater to: ‣ Chrome, Firefox, Safari, Opera, Internet Explorer, Symbian, iPhone, iPad, Android phones, Android tablets, RIM (Blackberry), Windows CE, Windows mobile, Windows Phone 7, Linux, bada, MeeGo, Brew OS Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
  • 9. So many browsers ‣ Do you really have time to test for and cater to: ‣ Chrome, Firefox, Safari, Opera, Internet Explorer, Symbian, iPhone, iPad, Android phones, Android tablets, RIM (Blackberry), Windows CE, Windows mobile, Windows Phone 7, Linux, bada, MeeGo, Brew OS ‣ ...boo Credits: http://en.wikipedia.org/wiki/Mobile_operating_system
  • 11. Forget about... ‣ User-agent detection + Separate mobile theme
  • 12. Forget about... ‣ User-agent detection + Separate mobile theme ‣ Separate subdomain / path + redirection
  • 13. Forget about... ‣ User-agent detection + Separate mobile theme ‣ Separate subdomain / path + redirection ‣ External services
  • 14. Forget about... ‣ User-agent detection + Separate mobile theme ‣ Separate subdomain / path + redirection ‣ External services ‣ These are alternatives, each with strengths and weaknesses. We don’t care about them today :)
  • 16. Go Responsive ‣ Use the front-end the way it wants to be used — as a versatile presentation layer
  • 17. Go Responsive ‣ Use the front-end the way it wants to be used — as a versatile presentation layer ‣ The layout of a website can shift and adapt to changes in screen size and device capability
  • 18. Go Responsive ‣ Use the front-end the way it wants to be used — as a versatile presentation layer ‣ The layout of a website can shift and adapt to changes in screen size and device capability ‣ CSS3 Media Queries JavaScript tools that adapt real-time Feature detection
  • 21. CSS Media Queries <plug> or check out http://fourkitchens.com </ plug>
  • 22. CSS Media Queries ‣ The spec: http://www.w3.org/TR/css3-mediaqueries/ <plug> or check out http://fourkitchens.com </ plug>
  • 23. CSS Media Queries ‣ The spec: http://www.w3.org/TR/css3-mediaqueries/ ‣ The buzz: http://www.alistapart.com/articles/responsive-web-design/ <plug> or check out http://fourkitchens.com </ plug>
  • 24. CSS Media Queries ‣ The spec: http://www.w3.org/TR/css3-mediaqueries/ ‣ The buzz: http://www.alistapart.com/articles/responsive-web-design/ ‣ The hotness: http://mediaqueri.es <plug> or check out http://fourkitchens.com </ plug>
  • 26. Basic Example <link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”>
  • 27. Basic Example <link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”> /* This CSS will always apply - global styles */ body {padding: 10px; } #container {width: 100%; margin: 0; } Do not use these in conjunction!
  • 28. Basic Example <link rel=”stylesheet” href=”this.css” media=”(min-width: 960px)”> /* This CSS will always apply - global styles */ body {padding: 10px; } #container {width: 100%; margin: 0; } /* This CSS will only apply when the window is 960px or greater */ @media screen and (min-width: 960px) { body {padding: 0; } #container {width: 960px; margin: 0 auto; } } Do not use these in conjunction!
  • 30. cool, but... ‣ IE 8 and below do not recognize media queries (weep not, more on this later)
  • 31. cool, but... ‣ IE 8 and below do not recognize media queries (weep not, more on this later) ‣ Don’t just pop open your existing stylesheets, wrap them in queries, and call it a day
  • 32. cool, but... ‣ IE 8 and below do not recognize media queries (weep not, more on this later) ‣ Don’t just pop open your existing stylesheets, wrap them in queries, and call it a day ‣ We need to mentally remove the line between mobile and desktop...
  • 33. cool, but... ‣ IE 8 and below do not recognize media queries (weep not, more on this later) ‣ Don’t just pop open your existing stylesheets, wrap them in queries, and call it a day ‣ We need to mentally remove the line between mobile and desktop... ‣ ...but don’t freak out. They’re just differently sized screens.
  • 35. Mobile First Approach ‣ aka Progressive Enhancement http://j.mp/rethink-mobile
  • 36. Mobile First Approach ‣ aka Progressive Enhancement ‣ Read, re-read, and bookmark (game changer) http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu http://j.mp/rethink-mobile
  • 37. Mobile First Approach ‣ aka Progressive Enhancement ‣ Read, re-read, and bookmark (game changer) http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu http://j.mp/rethink-mobile
  • 39. Progressive CSS ‣ No media query support is a media query http://j.mp/rethink-mobile
  • 40. Progressive CSS ‣ No media query support is a media query ‣ Target the least capable browser first http://j.mp/rethink-mobile
  • 41. Progressive CSS ‣ No media query support is a media query ‣ Target the least capable browser first ‣ Query for more functional browsers http://j.mp/rethink-mobile
  • 42. Progressive CSS ‣ No media query support is a media query ‣ Target the least capable browser first ‣ Query for more functional browsers ‣ More compatible than when you start with desktop styles and filter “down” to mobile version http://j.mp/rethink-mobile
  • 44. Feature Detection ‣ Not just limited to screen size http://www.modernizr.com/
  • 45. Feature Detection ‣ Not just limited to screen size ‣ Modernizr tests for the specific features you need http://www.modernizr.com/
  • 46. Feature Detection ‣ Not just limited to screen size ‣ Modernizr tests for the specific features you need ‣ More reliable than user-agent detection http://www.modernizr.com/
  • 47. Feature Detection ‣ Not just limited to screen size ‣ Modernizr tests for the specific features you need ‣ More reliable than user-agent detection ‣ Modular and lightweight, pick your tests: http://www.modernizr.com/download/ http://www.modernizr.com/
  • 49. Drupal Modules ‣ Semantic Views: http://drupal.org/project/semanticviews Allows you to clean up your Views output sans templates
  • 50. Drupal Modules ‣ Semantic Views: http://drupal.org/project/semanticviews Allows you to clean up your Views output sans templates ‣ Responder: http://drupal.org/sandbox/rupl/1104416 Force module stylesheets into mobile-first approach
  • 51. Drupal Themes ‣ Sadly, this is lacking at the moment. ‣ We haven’t yet found solid patterns that can be encapsulated into a theme. ‣ Look for responsive designs to pop up in distros before there’s a go-to solution in Drupal proper
  • 53. Useful Libraries ‣ Respond.js - For I ncapabl E browsers https://github.com/scottjehl/Respond
  • 54. Useful Libraries ‣ Respond.js - For I ncapabl E browsers https://github.com/scottjehl/Respond ‣ Responsive-Images - Bandwidth savings for smaller screens https://github.com/filamentgroup/Responsive-Images
  • 55. Useful Libraries ‣ Respond.js - For I ncapabl E browsers https://github.com/scottjehl/Respond ‣ Responsive-Images - Bandwidth savings for smaller screens https://github.com/filamentgroup/Responsive-Images ‣ Adapt.js - JavaScript alternative to media queries. Built upon 960 Grid System https://github.com/nathansmith/adapt
  • 57. Front-end Performance ‣ Up to 97% of perceived mobile response time depends on the front-end... really http://www.webperformancetoday.com/2011/04/20/ desktop-vs-mobile-web-page-load-speed/
  • 58. Front-end Performance ‣ Up to 97% of perceived mobile response time depends on the front-end... really ‣ Your super-stack might serve requests quickly, but if you don’t request quickly, it still seems slow. http://www.webperformancetoday.com/2011/04/20/ desktop-vs-mobile-web-page-load-speed/
  • 60. Front-end Performance ‣ Cache HTML, internal and external if possible
  • 61. Front-end Performance ‣ Cache HTML, internal and external if possible ‣ Optimize CSS/JS
  • 62. Front-end Performance ‣ Cache HTML, internal and external if possible ‣ Optimize CSS/JS ‣ Move $scripts to the bottom of your templates
  • 63. Front-end Performance ‣ Cache HTML, internal and external if possible ‣ Optimize CSS/JS ‣ Move $scripts to the bottom of your templates ‣ Use responsive images, data URIs, and/or sprites
  • 66. Check your Work ‣ YSlow http://developer.yahoo.com/yslow/
  • 67. Check your Work ‣ YSlow http://developer.yahoo.com/yslow/ ‣ Page Speed http://code.google.com/speed/page-speed/docs/extension.html
  • 68. Thank You! chris@fourkitchens.com twitter.com/rupl http://drupal.org/user/411999 2011.07.09 - Dallas Drupal Days http://dallasdrupal.org/sessions/building-responsive-websites-and-apps-drupal
  • 69. All content in this presentation, except where noted otherwise, is Creative Commons Attribution- ShareAlike 3.0 licensed and copyright 2011 Four Kitchens, LLC.

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n