Page 1
CSS Audits
@susanjrobertson susanjeanrobertson.com
Take back control of your CSS
Page 2
Me
Developer @ Writer @
&
Page 3
Old Application, layers
https://flic.kr/p/4xVXxH
Page 4
Admitting there is a problem
Page 5
Wrangling for time
https://flic.kr/p/8J6XML
Page 6
Cleaning == deleting
Remember, you have version control to find things again :)
Page 9
Standardize code
Decide about the best ways to write code going forward and
DOCUMENT IT!
Page 10
Reduce files
Elimination of ~200 lines of code
Page 11
Increase performance
https://flic.kr/p/FpnZC
Page 12
Familiarize yourself with code base
Page 16
CSS Dig http://cssdig.com
Page 17
StyleStats http://www.stylestats.org
Page 19
CSS Lint
http://csslint.net
Page 20
Type-o-matic
http://type-o-matic.net
Page 21
Grep
http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/
Page 22
CSS Colorguard
https://github.com/SlexAxton/css-colorguard
Page 23
Dust-me Selectors
https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/
Page 24
Visual Inventory
http://bradfrost.com/blog/post/interface-inventory/
Page 26
Depth of Applicability
https://smacss.com/book/applicability
Page 27
Specificity issues
.orderdetail_wrap .dapth_wrap .dapth_data .shopping_cart .checkout_orderdetail_table .item_price_box
Page 29
Tighten code
How modular is it? Consolidation?
Page 30
Preprocessors
Mixins/Extends/Placeholders
Nesting
Output
Page 32
Coding Philosophy
OOCSS SMACSS
BEM
Page 33
Deviations
Document why you may stray
Page 35
Write up
Outlines are fine
Give reasons
Good explanation
Page 36
Explanation of reasons
Page 38
Order the recommendations
Page 39
Small pieces that can be done?
• Navigation • Blog post • News section
Page 40
If major, are there sections?
• Basket and Checkout • Product pages
Page 41
Markup may need to change
Page 42
Style guide or standards?
Page 43
Document your CSS
Comments?
Spaces or tabs?Empty lines between rule set?
Space between property and value?
Is nesting OK at all, if so how deep?
Break up CSS into one style sheet per module or not?
Build process if using a preprocessor?
Do you commit and track generated files?
Page 44
Where will docs live?
Easily accessible & convenient for entire team
Best online, either privately or publicly
Page 45
How will it maintained?
• Schedule when to go back to audit & review • Base schedule on the rate of your
application changing. • Monthly, Quarterly, Yearly?
Page 46
Time estimate
Imagine you could devote time to just this? How long would it take? By section or the entire thing?
Page 47
Hand off or get to work!
Page 48
How was my app better?
Page 49
FiftyThree Type Audit
http://www.fiftythree.com/styleguide/typography
Page 50
Cleaned up/better understood
https://github.com/Editorially/styleguide
Page 52
BONUS POINTS for documentation that helps people understand you code base quickly.
Page 53
Thank youA note of thanks to Ethan Marcotte, Rob Brackett, Jason Grigsby, Max Fenton and
Jonathan Snook for early feedback on this talk.
Also, thanks to Flickr users and their creative commons photos.
@susanjrobertson susanjeanrobertson.com