maperun / prj-rev-bwfs-tea-cozy

0 stars 0 forks source link

Keep your code DRY #5

Open zannain opened 6 years ago

zannain commented 6 years ago

Don't repeat yourself

When you find yourself writing certain styles repeatedly it's generally a red flag that you can refactor somewhere. In CSS this is most easily done by with classes. For example you use width:1200px and height:700px a couple of times. Creating a class with these styles and giving elements that require these styles requires less code. Plus when you start working on large applications it is much easier to find elements by class names and adding or removing them than multiple CSS selectors with the width or height properties and changing their values.

You can read more about D.R.Y code here