More classes •If a thing does three separate jobs, it needs three separate hooks. •Allows you to stay more granular. •Build more combinations more quickly. •Keeps CSS’ size down.
More classes means more to maintain. — Every developer everywhere ever
1. HTML is simple •Changing a dozen classes in your HTML is a lot simpler (and nicer) than picking apart a tangled stylesheet. •Use tools (command line (grep, sed, etc.), global find and replace, etc.) to help you.
2. DRY your markup •Why are things repeated so much anyway? •DRY out your HTML as well as your CSS.
3. It’s your job.
It’s your job… •As a developer you are expected to maintain and work with code; why get so scared by the idea? •Embrace ways to make it easier. •Split the load between HTML and CSS.
Specificity •Keep it low. •Always. •Classes are ideally suited to the granularity of SRP. •No IDs.
But IDs mean that I can spot unique elements in HTML! — A lot of developers, still
Housekeeping •Factor in tidy-up and refactor time to any feature estimates. •Regularly create tech tasks to maintain and tidy up your codebase. •It’s not just about shipping new code, it’s also about looking after the code you already have.