Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Responsive and Mobile Sites

Responsive and Mobile Sites

David Kryzaniak

March 08, 2013
Tweet

Other Decks in Programming

Transcript

  1. #AppletonWP RESPONSIVE & MOBILE ...AND HOW TO APPLY EACH TO

    WORDPRESS By: David Kryzaniak (@dave_kz)
  2. HAI! I'M DAVID... Programming Ninja at Blue Door Consulting I

    haz a inter-blag (http://dave.kz/) Twitters: @dave_kz Graduated from UWGB (2012)
  3. THE YEAR WAS 1992... The internets were just starting to

    emerge. We used "Flyer-Based Design" 'cuz the internet is just like print. Gotta' watch out for that fold... in the screen.
  4. LIFE WAS GOOD Design for 800x600 monitors. That's like everyone...

    Most website could induce seizures thanks to <blink>
  5. BUT THEN... Monitors are getting bigger. Let's start designing for

    960px width. That'll cover just about everyone!
  6. HOUSTON, WE HAVE A PROBLEM... 61% leave a site if

    it isn't mobile-ready 79% search for another site 50% look outside an established relationship source: Google Blog
  7. USER AGENT DETECTION MOZILLA/5.0 (WINDOWS NT 6.1; WOW64) APPLEWEBKIT/537.22 (KHTML,

    LIKE GECKO) CHROME/25.0.1364.152 SAFARI/537.22 OR $ _ S E R V E R [ ' H T T P _ U S E R _ A G E N T ' ] n a v i g a t o r . u s e r A g e n t
  8. IF A USER AGENT STRING CONTAINS "IOS" IT MUST BE

    AN IPHONE SO REDIRECT THEM TO M.CONTOSO.COM
  9. MEDIA QUERIES WHAT IF WE SET BREAK POINTS IN OUR

    CODE SO THAT OUR CONTENT FITS ON THE SCREEN BETTER?
  10. PSEUDO CODE: "If the screen size is anything smaller than

    or equal to 480 pixels wide, apply these styles"
  11. MOST IMPORTANT STEP . . . < h e a

    d > < m e t a n a m e = " v i e w p o r t " c o n t e n t = " w i d t h = d e v i c e - w i d t h " / >
  12. STYLE.CSS: @ m e d i a o n l

    y s c r e e n a n d ( m a x - d e v i c e - w i d t h : 4 8 0 p x ) { / * N o r m a l C S S H e r e * / # c o n t e n t { f l o a t : r i g h t ; } }
  13. HEADER.PHP: < l i n k h r e f

    = " c s s / m o b i l e . c s s " r e l = " s t y l e s h e e t " t y p e = " t e x t / c s s " m e d i a = " o n l y s c r e e n a n d ( m a x - w i d t h : 4 8 0 p x ) " / >
  14. IT'S ALL ABOUT THE BENJAMINS UX, BABY. Don't confuse your

    users User Agents are always changing
  15. I ALREADY HAVE A THEME THAT I LOVE... 1. Child

    Theme 2. JetPack: CSS Editor
  16. IF I'M STARTING FROM SCRATCH... Design for Desktop First? ("Graceful

    Degradation") Design for Mobile First? ("Progressive Enhancement")