|
|
|
|
|
by ninjaofawesome
3223 days ago
|
|
You may want to look into Sass (SCSS). It makes your code reusable and extendable via variables, mixins, loops, if/else statements- its quite robust. Another suggestion, such as SMACSS is BEM (my personal favorite), as it flattens out your styling to prevent over specificity and makes everything clean and neat. (Check it out here: http://getbem.com/) Ultimately though, what I've found reduces messes is to think of the end product before beginning. If you have the luxury of starting with a fresh codebase, think of the end product and its styling before starting- much like you would with any other set of features in any other language. If you're walking in to legacy code, try to avoid the "one-offs". Sure, they solve the problem now, but its making a mess for future you to clean up as well as being a potential code smell. Leave your code a little better than when you came in and you'll be thanking yourself later. Good luck! |
|