SlideShare une entreprise Scribd logo
1  sur  111
Télécharger pour lire hors ligne
Responsive
    &
Responsible

Scott Jehl   filament group
We design engaging sites and
filament group   applications that are simple to
                use and accessible to all.
“An escalator can never
                break: it can only become
                stairs. ”

Mitch Hedberg
Responsive Design
A natural subset of Progressive Enhancement.
Responsible
 Delightful and inclusive.
Inclusive                      Delightful

 It works in my                    It feels intuitive.
    browser.




                                       It’s fun to use!
 It allows me to
complete my task


                   It’s damned fast!
Make it work
     everywhere.
...and work especially well in newer browsers!
There are, in fact,

Many ways
   to skin an app.
“it depends.”
- Every speaker at this conference.
Should it be responsive?
• Commonality across experiences
• Developer Skillset
• Time up-front vs. maintenance
• Interest in a challenge
PE, done right, is hard.
        Make no mistake!
A proposition:

A layered approach
  can be rich, without being exclusive.
Talk = cheap.
We built something.
    Let’s tear it apart, shall we?
A One-Web Case Study
Design-velopment Team
      @mirandamulligan


      @filamentgroup


      @beep


      @upstatement
Responsive.
 But is it responsible?
Areas of Responsibility


Accessibility   Performance


Usability       Sustainability
Responsive... ble baseline

• “Content” first
• Mobile-first images
• Mobile-friendly layout
Asset Baseline
• Basic CSS file
• Basic JS file
• Qualified Enhanced CSS file
Experience Divisions
 Defensive Development = Qualified Upgrades
Basic CSS
“Basic” = safe defaults
• Tweaks to browser typography
• Horizontal rules
• Text alignment
• Display: Inline / Block
• No complex layout or positioning
“Basic”
Enhanced Experience
The @media qualifier
“If you’re awesome,
                 or you’re Internet Explorer,
                 you get enhanced.”

Ethan Marcotte
@media-fortified design.


<link href="enhanced.css" media="only all">
All in your <head>

<link rel=...” href=”basic.css” id=”basic”>
<!--[if gte IE 6]><link href="enhanced.css"
rel="stylesheet"><![endif]-->

<!--[if !IE]><!--><link href="enhanced.css"
media="only all"><!--<![endif]-->

<script src=”basic.js”></script>
The Concatenator
Server-side Concatenation

<link href=”css/
file1.css,file2.css,file3.css”
..>


          Minify + Gzip
Enhanced CSS

/* styles for everyone go here.. */


@media all and (min-width: 500px){ .. }
@media all and (min-width: 620px){ .. }
@media all and (min-width: 950px){ .. }
Inheritance Prevention

@media all and (min-width: 500px)
and (max-width: 700px){
    /* styles constrained to 500-700px */
}
Left




Right



 Left
Display: table + table-cell
Ems all the way down.


    Ems allow for components to adapt
     differently in different containers
Basic.js: “just enough”

•   ResponsiveImages.js
•   Respond.js
•   Modernizr / extensions / HTML5 Shim
•   The Boston Globe JS Framework
Also.
Responsive Images
<img
       src=”foo.r.jpg”
              data-fullsrc=”foo.lrg.jpg”
/>
Edge Cases
Edge Cases
Respond.js


         Now available as part of




https://github.com/scottjehl/Respond
Also: matchMedia polyfill
  github.com/paulirish/matchMedia.js



 window.matchMedia( “only all” );
Globe JS Framework
The globe, um... global.


    globe = {};
Feature flags from Modernizr

globe.support.touch


globe.support.applicationcache


respond.mediaQueriesSupported
Internet Explorer Flags
<!--[if lt IE 7 ]> <html lang="en"
class="ie ie6"> <![endif]-->




globe.browser.ie6 =
    document.documentElement
    .className.indexOf( “ie6” ) >= 0;
Again, with the @media
globe.enhanced =
    respond.mediaQueriesSupported
       || globe.browser.ie6
       || globe.browser.ie7
       || globe.browser.ie8;


            Conditional-comment driven
JS Experience Divide
if( !globe.enhanced ){
    //last stop for old browsers!
    return;
}
else{
    //remove Basic CSS
    //bring on the enhancements
}
And one caveat...

No Enhanced JS for BB5
      great browser, too slow.
No JS? That’s okay.
On removing Basic.css...

  head.removeChild( basicCSS );



• Convenient when basic.css does
  not easily cascade.
• A convenience that can’t be
  guaranteed.
Enhancing Further
Loading Assets
Enhanced page weight
  Different for every browser. Highly optimized.
The assets you receive depend on

width, section, features
          ~ hand-crafted delivery ~
Defining Assets to Load


//Arrays of JS and CSS files
globe.jsToLoad    = [ “jquery.js” ];
globe.cssToLoad = [];


                 jQuery is dynamically-loaded too!
Feature-based Loading


if( globe.support.touch ){
    jsToLoad.push( “touchEvents.js” );
}
Section-specific Loading


if( globe.hasClass( “gallery”, body ) ){
     jsToLoad.push( “galleries.js” );
}
Device Size Decisions


if( window.screen.width > 500 ){
    cssToLoad.push( “fonts.css” );
}
            screen, not window
Our width usage rule of thumb:

screen           for assets
window           for design
Why Screen, not viewport?
 • Fixed per device
 • Assets delivered to device’s
   potential, not just current state.

 • Orientation-change makes resize
   relevant again.
Pack & Load
globe.load.script(

     jsToLoad.join(",")

);



globe.load.style(

     cssToLoad.join(",")

);
Again, concat.

“js/file1.js,file2.js,file3.js”



          Minify + Gzip
Responsive Behavior
Collapsible Sections
We value all input...
On the desktop...



            photo: flickrich
...and on the device


Touch & Mouse
Events




Mouse Events
Normalized Events
• vclick
• vmousedown
• vmouseover
• vmouseup
• vmousecancel
Click - or - Gesture
Drag pagination
http://filamentgroup.com/lab/jquery_mobile_pagination_plugin/
#!hashbang
Single-Page Apps
 Less JS execution, faster page loads
Degrees of #!%$hashbang

Not great:                    Less... not great:
<a href=”#foo.html”>Foo</a>   <a href=”foo.html”>Foo</a>




         http://example.com/#!foo.html
Great:
history.replaceState

http://example.com/#!foo.html




 http://example.com/foo.html
...in code.
window.addEventListener(
  “hashchange”,
  function(){

     history.replaceState(
        {},
        document.title,
        location.hash.replace("#!","" )
     );

  }, false );
Many ways to “Save”
Hidden Touch Interface
Even save without JS




                 Simple Form
PE + offline is possible!
 Extends the ability for a site to meet you where you are
Accessibility
enhancements
Keep it accessible
Keys + WAI ARIA
audible interface
pairs with mobile, resolution-independent
One-Web Challenges
Content Negotiation
Landing pages are heavy
    What if we treat them like navigation?
Anchor-Include Pattern

<a href=”path/to/weather.html”
data-after=”path/to/weather-fragment.html”>
T</a>




https://gist.github.com/983328
Ideal Delivery


  In page source




 Delivered via Ajax
Ads.
Ads are not awesome.
• Third-party, potential for conflicts
• They block content loading
• Potentially overtake page
• Pixel dimensions, contractually
• Filled with document.write
Best. Line. Ever.


document.write( “...<noscript>..” );
How we “solve” ads:

   <iframe>
Dynamically injected, naturally.
Resize + Hide + Append
Where to append?
CSS:


@media all and (min-width: 500px){
  .a .ad { display: none; }
}
JavaScript:


//on window resize:
if( !$( “.ad” ).is( “:visible” ) ){
  $( “.ad” ).appendTo( “.b” );
}
Edge Caching
   Not an edge-case.
In conclusion...

 We have the tools
to build sites that are rich without being exclusive.
What about “apps?”
FlipPics

http://bit.ly/pBJciO
thanks everyone.
      @scottjehl

Contenu connexe

Tendances

Tendances (20)

MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB Ops Manager + Kubernetes
MongoDB Ops Manager + KubernetesMongoDB Ops Manager + Kubernetes
MongoDB Ops Manager + Kubernetes
 
MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...
MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...
MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...
 
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep DiveMongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
10 - MongoDB
10 - MongoDB10 - MongoDB
10 - MongoDB
 
A Free New World: Atlas Free Tier and How It Was Born
A Free New World: Atlas Free Tier and How It Was Born A Free New World: Atlas Free Tier and How It Was Born
A Free New World: Atlas Free Tier and How It Was Born
 
MongoDB Evenings DC: Get MEAN and Lean with Docker and Kubernetes
MongoDB Evenings DC: Get MEAN and Lean with Docker and KubernetesMongoDB Evenings DC: Get MEAN and Lean with Docker and Kubernetes
MongoDB Evenings DC: Get MEAN and Lean with Docker and Kubernetes
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDBMongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
Transitioning from SQL to MongoDB
Transitioning from SQL to MongoDBTransitioning from SQL to MongoDB
Transitioning from SQL to MongoDB
 
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
AWS Lambda, Step Functions & MongoDB Atlas TutorialAWS Lambda, Step Functions & MongoDB Atlas Tutorial
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
 

Similaire à Responsive & Responsible: Implementing Responsive Design at Scale

Web app and more
Web app and moreWeb app and more
Web app and more
faming su
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
Atos_Worldline
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
Daum DNA
 

Similaire à Responsive & Responsible: Implementing Responsive Design at Scale (20)

Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Responsive Enhancement
Responsive EnhancementResponsive Enhancement
Responsive Enhancement
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.
 
Rwd slidedeck
Rwd slidedeckRwd slidedeck
Rwd slidedeck
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Responsive content
Responsive contentResponsive content
Responsive content
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Responsive design and retina displays
Responsive design and retina displaysResponsive design and retina displays
Responsive design and retina displays
 
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
 
HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)
 
Pinkoi Mobile Web
Pinkoi Mobile WebPinkoi Mobile Web
Pinkoi Mobile Web
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Device
 
Building Web Interfaces
Building Web InterfacesBuilding Web Interfaces
Building Web Interfaces
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Responsive & Responsible: Implementing Responsive Design at Scale