Progressive Advancement, by way of progressive enhancement

40
Progressive Advancement by way of Progressive Enhancement with a sprinkle of Regressive Enhancement, where possible Paul Irish Google Chrome FRONTEND2010 Sunday, September 12, 2010

description

with a sprinkle of Regressive Enhancement, where possible

Transcript of Progressive Advancement, by way of progressive enhancement

Page 1: Progressive Advancement, by way of progressive enhancement

Progressive Advancementby way of Progressive Enhancementwith a sprinkle of Regressive Enhancement, where possible

Paul Irish

Google Chrome

FRONTEND2010

Sunday, September 12, 2010

Page 2: Progressive Advancement, by way of progressive enhancement

Your mother does

NOT find a website

she likes the look of,

and then opens it

another browser.

~Andy Clarke (@malarkey)

Sunday, September 12, 2010

Page 3: Progressive Advancement, by way of progressive enhancement

OMG Browser wars

Sunday, September 12, 2010

Page 6: Progressive Advancement, by way of progressive enhancement

A Question...

if you’re designing a mobile experience,

do you start with how its going to look

in blackberry and s60 and winmobile?

or do you design it to look fucking great

in android, iOS, happy new webkits...

and function decently on the rest?

Sunday, September 12, 2010

Page 7: Progressive Advancement, by way of progressive enhancement

So why have we had a different approach

when it comes to the desktop?

Sunday, September 12, 2010

Page 8: Progressive Advancement, by way of progressive enhancement

So we create an experience that takes

advantage of hotness when we have it.

and function decently when we don’t.

Sunday, September 12, 2010

Page 9: Progressive Advancement, by way of progressive enhancement

How then?

Sunday, September 12, 2010

Page 10: Progressive Advancement, by way of progressive enhancement

Modernizr

Sunday, September 12, 2010

Page 11: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 12: Progressive Advancement, by way of progressive enhancement

Feature Detection

Sunday, September 12, 2010

Page 13: Progressive Advancement, by way of progressive enhancement

sniffing useragents === sniffing glue

Sunday, September 12, 2010

Page 14: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 15: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 16: Progressive Advancement, by way of progressive enhancement

Native

Implementation

.box {// use border-radius

}

No Native

Implementation

.no-borderradius .box {// maybe less padding?

}

if (Modernizr.borderradius == false){// call up DD_roundies, etc.

}

Sunday, September 12, 2010

Page 17: Progressive Advancement, by way of progressive enhancement

// geo-location bridgefunction getLocation(callback){ if (getLocation.cache) return callback(getLocation.cache); if (Modernizr.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { callback(getLocation.cache = { "lat": position.coords.latitude, "lon": position.coords.longitude, "obj": position }) }); } else { $.getScript('//www.google.com/jsapi',function(){ callback(getLocation.cache = { "lat": google.loader.ClientLocation.latitude, "lon": google.loader.ClientLocation.longitude, "obj": google.loader.ClientLocation }) }); }}// usagegetLocation(function(pos){ console.log("I'm located at ",pos.lat,' and ',pos.lon);});

Sunday, September 12, 2010

Page 18: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 19: Progressive Advancement, by way of progressive enhancement

OMG it’s only 3.7k!

Sunday, September 12, 2010

Page 20: Progressive Advancement, by way of progressive enhancement

Rounded corners

@font-face fonts

Canvas

rgba(), hsla() colors

border-image

box-shadow

HTML5 Audio & Video

CSS Animations

CSS Transitions

2D Transformations

CSS Gradients

SVG

Geolocation

CSS Columns

HTML5 Forms

Web Workers

Offline Web Apps

We got you covered, b.

Sunday, September 12, 2010

Page 21: Progressive Advancement, by way of progressive enhancement

Rounded corners

@font-face fonts

Canvas

rgba(), hsla() colors

border-image

box-shadow

HTML5 Audio & Video

CSS Animations

CSS Transitions

2D Transformations

CSS Gradients

SVG

Geolocation

CSS Columns

HTML5 Forms

Web Workers

Offline Web Apps

We got you covered, b.

webGL

SMIL

hashchange event

localStorage

sessionStorage

postMessage

html5 drag ‘n drop

web sql database

Sunday, September 12, 2010

Page 22: Progressive Advancement, by way of progressive enhancement

Rounded corners

@font-face fonts

Canvas

rgba(), hsla() colors

border-image

box-shadow

HTML5 Audio & Video

CSS Animations

CSS Transitions

2D Transformations

CSS Gradients

SVG

Geolocation

CSS Columns

HTML5 Forms

Web Workers

Offline Web Apps

We got you covered, b.

webGL

SMIL

hashchange event

localStorage

sessionStorage

postMessage

html5 drag ‘n drop

web sql database

or just take the tests

by themselves, sans-library

Sunday, September 12, 2010

Page 23: Progressive Advancement, by way of progressive enhancement

Modernizr

http://modernizr.com

@modernizr

Yah, it’s open source. Fork it, baby.

Sunday, September 12, 2010

Page 24: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 25: Progressive Advancement, by way of progressive enhancement

CSS3 Please!

Sunday, September 12, 2010

Page 26: Progressive Advancement, by way of progressive enhancement

.. but how can i convince my team

to use this stuff for modern

browsers?

Sunday, September 12, 2010

Page 27: Progressive Advancement, by way of progressive enhancement

Be the champion of performance.

Sunday, September 12, 2010

Page 28: Progressive Advancement, by way of progressive enhancement

1. Both you and the client want the most

responsive experience possible.

2. Everything added to the page slows it

down.

A Performance Policy

2 truths

Sunday, September 12, 2010

Page 29: Progressive Advancement, by way of progressive enhancement

A Performance Policy

During IA, IxD and visual design

communicate impact of design decisions

Tell the client all browsers will not have the

same experience

It’s not worthwhile to have feature parity

Sunday, September 12, 2010

Page 30: Progressive Advancement, by way of progressive enhancement

When performance is poor

There are three options:

1. Redevelop the code

2. Drop the feature

3. Redesign approach of the UI

Sunday, September 12, 2010

Page 32: Progressive Advancement, by way of progressive enhancement

Killing code is a good thing

HTML5 form controls

VS

UI libraries

HTML5 drag ‘n drop

VS

jQuery.fn.draggable()

css transitionsVS

.animate()

border-radius

border-image

background gradients

VS

large image sprites

localStorage

VS

cookies

Sunday, September 12, 2010

Page 33: Progressive Advancement, by way of progressive enhancement

Tantek sez:

Sunday, September 12, 2010

Page 34: Progressive Advancement, by way of progressive enhancement

Tantek’s list:

dependable:

doctype

charset

selfclose, quotes

new semantics

audio/video

roughly usable:

canvas

experimentable:

awkward:

form inputs

meter/progress

geolocation

web sockets

autofocus,

placeholder

web sql database

indexeddatabase

webstorage

web workers

Sunday, September 12, 2010

Page 35: Progressive Advancement, by way of progressive enhancement

roughly usable:

canvas

awkward:

form inputs

meter/progress

geolocation

web sockets autofocus,

placeholder

Paul’s list:

data-* attrs

drag n drop

contenteditable

experimentable:

web sql database

indexeddatabase

webstorage

web workers

dependable:

doctype

charset

selfclose, quotes

new semantics

audio/video

Sunday, September 12, 2010

Page 36: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 37: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 38: Progressive Advancement, by way of progressive enhancement

Sunday, September 12, 2010

Page 39: Progressive Advancement, by way of progressive enhancement

Me:

http://paulirish.com

@paul_irish

Sunday, September 12, 2010

Page 40: Progressive Advancement, by way of progressive enhancement

Me:

http://paulirish.com

@paul_irish

OMG THX!

Sunday, September 12, 2010