CASE STUDY • Bulletproof • Progressive enrichment • Reevaluating past methods BULLETPROOF • Flexibility • Adaptable to multiple scenarios • Adding detail without complexity
Trang 1by Dan Cederholm
I M P L E M E N T I N G D E S I G N
BULLETPROOF
Trang 2SimpleBits
Trang 3HAND-CRAFTED
Trang 4CRAFTSMANSHIP
Trang 5VERMONT
Trang 6A product labeled ‘ Made in Vermont ’—
whether herb-infused maple syrup,
pineapple pepper jam, or chai water
buffalo yogurt—is worth 10 percent more
than the same product made elsewhere.”
“
—BOSTON GLOBE, The brand called Vermont
http://boston.com/news/globe/ideas/articles/2003/10/12/the_brand_called_vermont
Trang 7When something is well-crafted, it reflects that a human
was behind its design.
Trang 8HTML CSS Javascript GIF JPG PNG
Trang 11• Flexibility
• Adaptable to multiple scenarios
• Adding detail without complexity
Trang 12LANDSCAPE
Trang 13PROGRESSIVE ENHANCEMENT
{ behavior }
Trang 14PROGRESSIVE ENRICHMENT
{ style }
Trang 15REALLY COOL STUFF
THAT DOESN’T
Trang 16REEXAMINING PAST
Trang 18MY LOCAL COFFEE SHOP
http://www.flickr.com/photos/dankamminga/1678248602/
Trang 19I LOVE COFFEE.
Trang 20POWER OF THE BEAN™
Trang 21ICED
16º
HOT
Trang 23ICEDORHOT.COM
Trang 24Aa
Trang 25ANCHOR LINKS WITH META INFORMATION
A
{ bulletproof }
Trang 27<li><a href="/latte"> Latte <em> 12 </em></a></li>
li a { display: block;
position: relative;
}
li a em { position: absolute;
top: 0;
right: 0;
}
Trang 30<li><a href="/latte"><em> 12 </em> Latte </a></li>
li a { display: block;
}
li a em { float: right;
}
Trang 32overflow: hidden; }
li a span { float: left;
}
li a em { float: right;
}
Trang 34Bb
Trang 35B
{ progressive enrichment }
Trang 37.mod {
border-radius: 4px 4px; }
CSS3
Trang 38CSS3
Trang 39.mod {
-webkit-border-radius: 4px 4px; -moz-border-radius: 4px 4px;
}
Vendor-Specific Properties
Trang 42glass.png
Trang 44-webkit-border-radius: 4em 4em;
-moz-border-radius: 4em 4em;
}
Trang 46Firefox 2
Trang 48master.css
enriched.css
ie.css
Trang 49-moz-border-radius:
.4em 4em;
}
enriched.css
Trang 50#nav li a {
border-radius: 4em 4em;
-webkit-border-radius: 4em 4em; -moz-border-radius: 4em 4em;
}
enriched.css
Trang 51ol.cities li,
#nav li a {
border-radius: 4em 4em;
-webkit-border-radius: 4em 4em; -moz-border-radius: 4em 4em;
}
enriched.css
Trang 52WHAT ABOUT OTHER BROWSERS?
Trang 54Can get away with FF2 if contrast is low enough.
Degrades nicely.
before carving out images.
Trang 55Cc
Trang 56COLOR TRANSPARENCY
C
{ progressive enrichment }
Trang 60a.city-over {
background-color: rgba(0,0,0,.7); }
RGBa
(sets opacity value for background-color only)
Trang 62a.city-over {
background-color: #000;
background-color: rgba(0,0,0,.7); }
RGBa
Trang 63enriched.css
Trang 64Tiled PNG would reach
more browsers.
RGBa great for protoyping
Trang 65Dd
Trang 66DO WEBSITES NEED
TO LOOK EXACTLY THE SAME IN EVERY
BROWSER?
D
Trang 68Websites don’t need
to look exactly
the same in every
browser
Trang 69DECISION-MAKERS
WHO GET IT
D
Trang 72for this nifty new avatar, which
perfectly captures the goulish-like
quality found in me and other insane
people.
for blogging about CakePHP.
for picking up the tab last night at
the Gulu Gulu.
for a really awesome idea
for creating such a fun little app (foamee)
for foamee Dan (buuuurp)
Dan Cederholm • Massachusetts • Twitter profile
the pub people how-to faq store
Trang 73for this nifty new avatar, which
perfectly captures the goulish-like
quality found in me and other insane
people.
for blogging about CakePHP.
for picking up the tab last night at
the Gulu Gulu.
for a really awesome idea
for creating such a fun little app (foamee)
for foamee Dan (buuuurp)
Dan Cederholm • Massachusetts • Twitter profile
the pub people how-to faq store
Trang 74IT’S OK
Tiny visual enhancements that do
not affect layout.
Techniques that make our lives
easier.
Trang 75Ee
Trang 77FLOATS = FLEXIBILITY
2008
Trang 78Lorem ipsum dolor sit amet, consectetuer adipiscing elit Quisque eget augue Praesent
ac purus Ut risus Ut mauris ligula, dictum vulputate, ornare id, suscipit at, nisi Quisque
et est et urna consectetuer adipiscing Mauris
ac arcu Sed quis enim eu elit faucibus vehicula Aliquam sodales dui sit amet ligula Vivamus leo.
Trang 79Lorem ipsum dolor sit amet, consectetuer adipiscing elit Quisque eget augue Praesent
ac purus Ut risus Ut mauris ligula, dictum vulputate, ornare id, suscipit at, nisi Quisque
et est et urna consectetuer adipiscing Mauris
ac arcu Sed quis enim eu elit faucibus vehicula Aliquam sodales dui sit amet ligula Vivamus leo.
Trang 80.clearfix:after { content: ".";
Trang 81<div class="clearfix">
Trang 83Lil’ bit better
<div class="group">
Trang 84Multiple classes
<ol class="cities group">
Trang 85}
/*IE7 */
*:first-child+html group { min-height: 1px;
}
ie.css
Trang 86* /_**(.)/*+:@//\*+html!~/rofl**/ {
clear: please !reallyeffingimportant; }
IE8?
Trang 87SUPPORTS GENERATED
CONTENT!
Trang 88<ol class="cities group">
<ol class="cities group">
<div class="mod group">
<form id="loc" class="group">
<div id="header" class="group">
Trang 89Ff
Trang 90F
Trang 92master.css
Trang 95ie.css
Trang 96A TESTIMONIAL FOR
RESET.CSS
Trang 98margin: 0; 66
padding: 0; 89
155
MTV.com
Trang 99Gg
Trang 100G
{ bulletproof }
Trang 101gridius • lasticus • nessinus
Trang 102GRID LAYOUT
Trang 103The gut.
Trang 110#wrap {
width: 50em; }
#content {
width: 30em; }
#sidebar {
width: 20em; }
Trang 114Em-based layouts force you to ensure ultimate flexibility
Trang 115Em/pixel values make more sense when using
the 62.5% method
Trang 116body {
font-size: 62.5%;
}
Setting a base
Trang 117#nav { font-size: 1em } 10px
#content { font-size: 1.2em } 12px
#sidebar { font-size: 1em } 10px
#footer { font-size: 0.9em } 9px
Base of 10
Trang 119Avoid setting width and font-size on the
same element
Trang 121Adjusting text size may
throw off the grid
Trang 125Set a max-width on
elastic layouts
Trang 127#wrap {
max-width: 100%; }
Trang 13016em 16em 16em 16em
Trang 131THINK MODULAR
{ from the outside in }
Trang 133http://iconfactory.com/software/xscope
Trang 135Hh
Trang 136HORIZONTAL GRID? SURE.
H
Trang 140Use classes for main columns
Trang 142#secondary
#header
Trang 143.main secondary
.group
.main secondary
Trang 144Ii
Trang 145IE8 BETA STILL REFUSES TO RESIZE TEXT SET IN PIXELS
I
{ reexamining past methods }
Trang 146WTF?
Trang 147body {
font-size: 12px; }
Trang 150STILL USING RELATIVE UNITS
Trang 151body {
font-size: 62.5%; }
h1 {
font-size: 2em;
}
Trang 152PAGE ZOOM?
Trang 153TEXT SIZE TOOLS ARE STILL THERE
ENSURES FLEXIBILITY (NOT JUST TEXT)
Trang 154Jj
Trang 155J
Trang 158// Toggle search stuff
function togglifySearch(){
$(" #loc-adv a ").click(function(){ $(" #map ").slideToggle("slow");
return false;
});
}
Familiar selector syntax
<script src="js/jquery.js" type="text/javascript"></script>
Trang 159Kk
Trang 160(invisible pool!)
Trang 161Ll
Trang 162L
{ bulletproof }
Trang 163ul.lst li.last {
margin-bottom: 0; padding-bottom: 0; border-bottom: 0;
}
<li class="last" >
Trang 164// Add last class to certain lists
function addLast(){
$('ul.lst li:last').addClass('last'); }
Behavior or presentation?
Trang 165Mm
Trang 166MUST SKIP A FEW LETTERS IF WE’RE
GOING TO GET THROUGH THIS
Trang 167Nn
Trang 168Oo
Trang 169Pp
Trang 170Rr
Trang 172Ss
Trang 173SHIFTING BACKGROUNDS
(PARALLAX SCROLLING FOR THE LAZY)
S
Trang 175How to recreate Silverback’s parallax effect
http://www.thinkvitamin.com/features/design/how-to-recreate-silverbacks-parallax
Trang 181Tt
Trang 182Uu
Trang 183UR STATS
U
YO
Trang 184WHEN CAN WE ?
Trang 185The answer is simple: when your site’s
(or sites’ if you have more than one) user logs tell you that you can Not before
then The user stats from other sites, or
from global-aggregation surveys, are
worse than useless.
“
”
—ERIC MEYER
http://simplebits.com/notebook/2004/12/17/ie5.html#comment53
Trang 186IE7 SAFARI FIREFOX OPERA IE6
Trang 187IE7 SAFARI FIREFOX OPERA IE6
Trang 188THANK YOU.
simplebits.com/publications/speak/a-z/a-z.pdf