Loading...
Flash Player 9 (or above) is needed to view slideshows. We have detected that you do not have it on your computer.To install it, go here
-
Djouh favorited this 1 month ago
-
sinosunnysun favorited this 1 month ago -
adski favorited this 1 month ago -
storrao favorited this 1 month ago
-
DragonI favorited this 1 month ago -
diniscorreia favorited this 1 month ago -
manobi favorited this 1 month ago -
thenooch favorited this 1 month ago -
Mapk favorited this 1 month ago -
mdupuis favorited this 1 month ago -
dennisfrank favorited this 1 month ago -
stmawes favorited this 1 month ago -
iamdanw favorited this 2 months ago -
stevioz favorited this 2 months ago
-
jessica.kjm favorited this 2 months ago -
wiederkehr favorited this 2 months ago
-
jamesa favorited this 2 months ago -
Montgomery favorited this 2 months ago
-
copernic67 favorited this 2 months ago
-
iainc favorited this 2 months ago -
csaila favorited this 2 months ago
-
ed23 favorited this 2 months ago -
stephenrwalli favorited this 2 months ago
-
austinpmaher favorited this 2 months ago -
dubtje favorited this 2 months ago
-
mariano.viola favorited this 2 months ago -
sachingadia favorited this 2 months ago -
sachingadia favorited this 2 months ago -
kapil favorited this 2 months ago
-
thomd favorited this 2 months ago -
jay0917 favorited this 2 months ago -
badosa favorited this 2 months ago
-
jfillman favorited this 2 months ago -
oualter favorited this 2 months ago -
DustinAskins favorited this 2 months ago -
chrisdpratt favorited this 2 months ago -
matiasjajaja favorited this 2 months ago -
oneway favorited this 2 months ago
-
t1mmyb favorited this 2 months ago -
rlozano favorited this 2 months ago -
Added to the group Learning Javascript by zazk
-
deadentry favorited this 2 months ago -
renatoalbano favorited this 2 months ago
-
brammuller favorited this 2 months ago
-
joneff favorited this 2 months ago -
theronin favorited this 2 months ago -
jarod51 favorited this 2 months ago
-
garrettc favorited this 2 months ago
-
losfinkos favorited this 2 months ago -
abecciu favorited this 2 months ago -
nmariz favorited this 2 months ago
Slideshow Transcript
- Slide 1: WRITING MAINTAINABLE CSS Natalie Downe | Barcamp London 5 28th September 2008 1
- Slide 2: WRITING MAINTAINABLE CSS Natalie Downe | Barcamp London 5 28th September 2008 2
- Slide 3: CSS SYSTEMS Natalie Downe | Barcamp London 5 28th September 2008 3
- Slide 4: I am an optimist 4
- Slide 5: so I am going to assume that 5
- Slide 6: you already write beautiful and valid markup 6
- Slide 7: you use semantic markup & class / id names 7
- Slide 8: you separate content, presentation & behavior 8
- Slide 9: because you care 9
- Slide 10: Maintainability in CSS? 10
- Slide 11: It’s not a solved problem. 11
- Slide 12: It’s not just about the future 12
- Slide 13: It’s about now 13
- Slide 14: CLEARLEFT High quality code To tight deadlines For handover to external developers 14
- Slide 15: CSS SYSTEMS 15
- Slide 16: A CSS SYSTEM IS... a top down approach personalised for an individual site a reusable set of markup patterns and CSS looking at the overall stucture and individual components glossary of shared vocabulary for developers 16
- Slide 17: ORDERING Rule blocks are loosely ordered by specificity, Elements, grouped by type of tag Classes, grouped by the effect they create IDs, grouped by the component they affect 17
- Slide 18: GROUPING general styles body styles reset links headings other elements, tags helper styles forms notifications and errors consistant items with normally just one class page structure skeleton including page furniture, page components most of your styles will be in here overrides 18
- Slide 19: GROUPING general styles body styles reset links headings other elements, tags helper styles forms notifications and errors consistant items with normally just one class page structure skeleton including page furniture, page components most of your styles will be in here overrides 19
- Slide 20: CSS Edit macrabbit.com/cssedit 20
- Slide 21: CSS Edit macrabbit.com/cssedit 21
- Slide 22: CONDITIONAL COMMENTS Never use browser hacks Browser specific stylesheets for all versions of IE and another for IE6 and under If you have to entirely re-engineer for IE, overriding your standards ready CSS in a conditional comment, you’re Doing It Wrong 22
- Slide 23: please look to my right for a moment 23
- Slide 24: please look to my right for a moment 24
- Slide 25: BEFORE YOU START So I have a design ... what now? 25
- Slide 26: look at the basics 26
- Slide 27: will it be liquid? elastic? or fixed? 27
- Slide 28: MAINTAINABLE LAYOUT if you are using an em or fixed width layout, try to only set a width on the container, using percentages inside a max-width of 100% will stop your layout creeping out the side of the viewport up and down font size all the time be afraid of heights, vertigo is healthy on the web. NEVER use height in px on anything with text inside 28
- Slide 29: 29
- Slide 30: the grid 30
- Slide 31: draw diagrams 31
- Slide 32: lots of diagrams 32
- Slide 33: make calculations 33
- Slide 34: get inventive 34
- Slide 35: levels of headings 35
- Slide 36: 36
- Slide 37: page structure and components 37
- Slide 38: 38
- Slide 39: 39
- Slide 40: 40
- Slide 41: MAINTAINABILITY MYTHS Any existing ‘best practices’ or approaches? 41
- Slide 42: CSS frameworks 42
- Slide 43: Single line declaration blocks 43
- Slide 44: Selector based indentation 44
- Slide 45: colour.css / layout.css / typography.css 45
- Slide 46: ON YOUR MARKS ... You have your design and your plan - you’re all set! 46
- Slide 47: use the cascade 47
- Slide 48: div#page div.teaser ul.products li p.name 48
- Slide 49: ul.products p.name 49
- Slide 50: you love to float 50
- Slide 51: shorthand? 51
- Slide 52: p { font: 12px/14px sans-serif } p { font: 80% sans-serif } p { font: x-large/110% \"New Century Schoolbook\", serif } p { font: bold italic large Palatino, serif } p { font: normal small-caps 120%/120% fantasy } 52
- Slide 53: 53
- Slide 54: background: url(\"w00t.png\") orange 0 50% repeat fixed; 54
- Slide 55: background: lime; 55
- Slide 56: background: url(\"rofl.gif\"); 56
- Slide 57: background-color: lime; background-image: url(\"rofl.png\"); 57
- Slide 58: PREPARE FOR THE WORST n00bs will one day be let loose on your code (accept it) 58
- Slide 59: clear your footer 59
- Slide 60: careful with dimensions 60
- Slide 61: watch your height 61
- Slide 62: hooks 62
- Slide 63: editable content 63
- Slide 64: sanitise text 64
- Slide 65: abstract your icons 65
- Slide 66: DESIGN TO AVOID DEBUGGING engineer your way around the browser 66
- Slide 67: Simultaneously develop 67
- Slide 68: dont re-engineer seperate solutions 68
- Slide 69: floating 69
- Slide 70: you need to set psuedo selectors on links 70
- Slide 71: buttons 71
- Slide 72: review 72
- Slide 73: HANDOVER what to give the client 73
- Slide 74: THE IDEAL HANDOVER INCLUDES The markup scheme, a set of files demonstrating the different markup components The CSS itself Supporting documents that explain the system as clearly as possible A face to face meeting if possible 74
- Slide 75: FINALLY 75
- Slide 76: ITS ALL ABOUT THE SYSTEM define it develop it maintain it communicate it 76
- Slide 77: THANK YOU 77
- Slide 78: ? 78

