Top Banner
CSS Audits @susanjrobertson susanjeanrobertson.com Take back control of your CSS
53

CSS Audits: Take Back Control of your CSS (Susan Robertson)

Aug 12, 2015

Download

Technology

Future Insights
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: CSS Audits: Take Back Control of your CSS (Susan Robertson)

CSS Audits

@susanjrobertson susanjeanrobertson.com

Take back control of your CSS

Page 2: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Me

Developer @ Writer @

&

Page 3: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Old Application, layers

https://flic.kr/p/4xVXxH

Page 4: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Admitting there is a problem

Page 5: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Wrangling for time

https://flic.kr/p/8J6XML

Page 6: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Cleaning == deleting

Remember, you have version control to find things again :)

Page 7: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Benefits

Page 8: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Consistency

Page 9: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Standardize code

Decide about the best ways to write code going forward and

DOCUMENT IT!

Page 10: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Reduce files

Elimination of ~200 lines of code

Page 11: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Increase performance

https://flic.kr/p/FpnZC

Page 12: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Familiarize yourself with code base

Page 13: CSS Audits: Take Back Control of your CSS (Susan Robertson)

How

Page 14: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Inventory

Page 15: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Tools

Page 16: CSS Audits: Take Back Control of your CSS (Susan Robertson)

CSS Dig http://cssdig.com

Page 17: CSS Audits: Take Back Control of your CSS (Susan Robertson)

StyleStats http://www.stylestats.org

Page 18: CSS Audits: Take Back Control of your CSS (Susan Robertson)

cssstats.com

Page 19: CSS Audits: Take Back Control of your CSS (Susan Robertson)

CSS Lint

http://csslint.net

Page 20: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Type-o-matic

http://type-o-matic.net

Page 21: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Grep

http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/

Page 22: CSS Audits: Take Back Control of your CSS (Susan Robertson)

CSS Colorguard

https://github.com/SlexAxton/css-colorguard

Page 23: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Dust-me Selectors

https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/

Page 24: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Visual Inventory

http://bradfrost.com/blog/post/interface-inventory/

Page 25: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Read through

Page 26: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Depth of Applicability

https://smacss.com/book/applicability

Page 27: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Specificity issues

.orderdetail_wrap .dapth_wrap .dapth_data .shopping_cart .checkout_orderdetail_table .item_price_box

Page 28: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Review

Page 29: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Tighten code

How modular is it? Consolidation?

Page 30: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Preprocessors

Mixins/Extends/Placeholders

Nesting

Output

Page 31: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Consistency

Page 32: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Coding Philosophy

OOCSS SMACSS

BEM

Page 33: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Deviations

Document why you may stray

Page 34: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Recommend

Page 35: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Write up

Outlines are fine

Give reasons

Good explanation

Page 36: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Explanation of reasons

Page 37: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Make a plan

Page 38: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Order the recommendations

Page 39: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Small pieces that can be done?

• Navigation • Blog post • News section

Page 40: CSS Audits: Take Back Control of your CSS (Susan Robertson)

If major, are there sections?

• Basket and Checkout • Product pages

Page 41: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Markup may need to change

Page 42: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Style guide or standards?

Page 43: CSS Audits: Take Back Control of your CSS (Susan Robertson)

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: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Where will docs live?

Easily accessible & convenient for entire team

Best online, either privately or publicly

Page 45: CSS Audits: Take Back Control of your CSS (Susan Robertson)

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: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Time estimate

Imagine you could devote time to just this? How long would it take? By section or the entire thing?

Page 47: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Hand off or get to work!

Page 48: CSS Audits: Take Back Control of your CSS (Susan Robertson)

How was my app better?

Page 49: CSS Audits: Take Back Control of your CSS (Susan Robertson)

FiftyThree Type Audit

http://www.fiftythree.com/styleguide/typography

Page 50: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Cleaned up/better understood

https://github.com/Editorially/styleguide

Page 51: CSS Audits: Take Back Control of your CSS (Susan Robertson)

Marriott

Page 52: CSS Audits: Take Back Control of your CSS (Susan Robertson)

BONUS POINTS for documentation that helps people understand you code base quickly.

Page 53: CSS Audits: Take Back Control of your CSS (Susan Robertson)

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