Top Banner
http://flic.kr/p/6iMxyT Can Media Queries Save Us All? Presented by Tim Kadlec - @tkadlec Friday, May 27, 2011
43

Can Media Queries Save Us All?

Jan 28, 2015

Download

Technology

Tim Kadlec

Presented May 27, 2011 at WebVisions in Portland, OR.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Can Media Queries Save Us All?

http://flic.kr/p/6iMxyT

Can Media Queries Save Us All?

Presented by Tim Kadlec - @tkadlec

Friday, May 27, 2011

Page 2: Can Media Queries Save Us All?

http://flic.kr/p/7DzC2S

No**at least not by themselves

Friday, May 27, 2011

Page 3: Can Media Queries Save Us All?

http://flic.kr/p/6Jnxr1

So what’s the problem?

Friday, May 27, 2011

Page 4: Can Media Queries Save Us All?

http://flic.kr/p/7c8Nkq

She is.

Friday, May 27, 2011

Page 5: Can Media Queries Save Us All?

http://flic.kr/p/7QPvjg

So is this person... So is the cat

Friday, May 27, 2011

Page 6: Can Media Queries Save Us All?

One of the interesting estimates is that there are about 35 billion devices connected to the Internet. Soon, there will be so many that we’ll stop counting.

- Eric Schmidt

Friday, May 27, 2011

Page 7: Can Media Queries Save Us All?

http://flic.kr/p/8PGKvr

Friday, May 27, 2011

Page 8: Can Media Queries Save Us All?

http://flic.kr/p/coTdy

Option #1: Ignore

Friday, May 27, 2011

Page 9: Can Media Queries Save Us All?

http://flic.kr/p/8rWoUd

Option #2: Separate Sites

Friday, May 27, 2011

Page 10: Can Media Queries Save Us All?

http://flic.kr/p/9i3TMD

Slight Detour...

Friday, May 27, 2011

Page 11: Can Media Queries Save Us All?

http://flic.kr/p/7Er6af

How do we define mobile?

Friday, May 27, 2011

Page 12: Can Media Queries Save Us All?

Text

Friday, May 27, 2011

Page 13: Can Media Queries Save Us All?

Is this a mobile device?

Friday, May 27, 2011

Page 14: Can Media Queries Save Us All?

Is this mobile use?

Friday, May 27, 2011

Page 15: Can Media Queries Save Us All?

Text

Form != Function

Friday, May 27, 2011

Page 16: Can Media Queries Save Us All?

Option #2: Separate Sites

Friday, May 27, 2011

Page 17: Can Media Queries Save Us All?

http://flic.kr/p/2LZPkH

Option #3: Adapt

Friday, May 27, 2011

Page 18: Can Media Queries Save Us All?

Text

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

Friday, May 27, 2011

Page 19: Can Media Queries Save Us All?

Friday, May 27, 2011

Page 20: Can Media Queries Save Us All?

Device Classification

• By device type (feature phones, smart phones, desktop, tv, tablets)

• By capabilities ((X)HTML, CSS, Javascript)

• By UI mode (touch, pointer)

• By resolution

• Holistic approach

Friday, May 27, 2011

Page 21: Can Media Queries Save Us All?

http://flic.kr/p/99UEu4

Don’t Get Too Granular

Friday, May 27, 2011

Page 22: Can Media Queries Save Us All?

/* base styles - optimized for desktop */

@media (max-width: 600px) {....}

@media (max-width: 400px) {....}

@media (min-width: 1300px) {....}

Friday, May 27, 2011

Page 23: Can Media Queries Save Us All?

“The absence of support for @media queries is in fact the first @media query”

http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu

Hi!

Friday, May 27, 2011

Page 24: Can Media Queries Save Us All?

Start with this

Friday, May 27, 2011

Page 25: Can Media Queries Save Us All?

/* base styles - optimized for small screens */

@media (min-width: 400px) {....}

@media (min-width: 600px) {....}

@media (min-width: 1300px) {....}

Friday, May 27, 2011

Page 27: Can Media Queries Save Us All?

/* base styles - optimized for small screens */

@media (min-width: 400px) {....}/*/mediaquery*/

@media (min-width: 600px) {....}/*/mediaquery*/

@media (min-width: 1300px) {....}/*/mediaquery*/

Friday, May 27, 2011

Page 28: Can Media Queries Save Us All?

http://flic.kr/p/713QR9

Performance

Friday, May 27, 2011

Page 29: Can Media Queries Save Us All?

58% of mobile users expect websites to load as quickly, almost as quickly or faster on their mobile phone, compared to the computer they use at home

Friday, May 27, 2011

Page 30: Can Media Queries Save Us All?

Text

http://www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/

Friday, May 27, 2011

Page 31: Can Media Queries Save Us All?

Original Resized K Saved % SavedHolmesWatsonMycroftMoriarty

AdlerWinter

34.7K 8.1K 26.6K 76.6%

39.0K 8.4K 30.6K 78.4%

30.5K 6.7K 23.8K 78.0%

43.4K 8.2K 35.2K 81.1%

26.0K 6.6K 19.4K 74.6%

34.7K 7.8K 26.9K 77.5%

Total 208.3K 45.8K 162.5K 78.0%

Friday, May 27, 2011

Page 32: Can Media Queries Save Us All?

Responsive Images

Friday, May 27, 2011

Page 34: Can Media Queries Save Us All?

<img src="small.jpg?full=large.jpg">

https://github.com/filamentgroup/Responsive-Images

Responsive Images Script

Friday, May 27, 2011

Page 35: Can Media Queries Save Us All?

Responsive ImagesAssets

Friday, May 27, 2011

Page 36: Can Media Queries Save Us All?

if (screen.width >= 320) { // bring the hotness}

By Width

Friday, May 27, 2011

Page 37: Can Media Queries Save Us All?

if (matchMedia('only screen and (max-width: 480px)').matches) { // bring the hotness}

https://github.com/paulirish/matchMedia.js/

By Media Query

Friday, May 27, 2011

Page 38: Can Media Queries Save Us All?

if (localStorage.supported && screen.width >= 320) { //bring the hotness}

By Some Combination

Friday, May 27, 2011

Page 39: Can Media Queries Save Us All?

http://flic.kr/p/81vbku

Combine with Device Detection

He said what?

Friday, May 27, 2011

Page 40: Can Media Queries Save Us All?

http://flic.kr/p/3HMbN

Friday, May 27, 2011

Page 41: Can Media Queries Save Us All?

Summary

• Device Classification

• Mobile First

• Resize Images - don’t just scale

• Responsive assets

• Pair with device detection

• Challenge traditional assumptions

Friday, May 27, 2011

Page 42: Can Media Queries Save Us All?

http://flic.kr/p/7MhBfD

Thank you!

Tim Kadlechttp://www.timkadlec.com

Twitter: @tkadlec

Friday, May 27, 2011

Page 43: Can Media Queries Save Us All?

• http://www.businessinsider.com/chart-of-the-day-pc-usage-2011-2

• http://www.slideshare.net/OnDevice/the-mobile-only-internet-generation

• http://www.comscore.com/Press_Events/Press_Releases/2011/1/Web-based_Email_Shows_Signs_of_Decline_in_the_U.S._While_Mobile_Email_Usage_on_the_Rise

• http://internet2go.net/news/data-and-forecasts/pew-85-us-adults-have-mobile-phones-one-ten-high-earners-own-tablets

• http://www.bulletbits.com/slow-sites-and-bad-press/

• http://techcrunch.com/2011/01/25/eric-schmidt-at-dld11-google-will-add-1000-new-employees-in-europe/

• http://www.lukew.com/ff/entry.asp?1258

• http://www.slideshare.net/Gomez_Inc/gomez-mobile-web-experience-survey-why-the-mobile-web-is-disappointing-end-users

Sources

Friday, May 27, 2011