Building scalable and modular code
The process of building good code is unique to each developer. But how can you build easily scalable CSS code? Additionally, this code needs to be modular.
The most important thing in methodologies is the naming convention. You can use a proper methodology for your project, but you can use it in the wrong way and append bad class names. Have you ever seen projects that have classes with a name and definition similar to this one:
.padding-0 { padding: 10px; }
As you can see, the class name is created to make padding with value 0
, but finally it has a value not equal to 0
. This can be an example of a bad naming convention. There can be more examples of badly used names:
.marginTop10 { padding-top: 50px; }
The second important thing in methodologies is the structure of classes/elements in document and nesting levels. Some sources say that the maximum nesting levels shouldn't be greater than five, while others say three. For the sake of readability, code...