2 ms·
Because there are a few paddings and margins that are used repeatedly, and it's convenient. Clearfixes and floats are another common use case. An anchor that I
by WiseWeasel 11y ago
Because there are a few paddings and margins that are used repeatedly, and it's convenient. Clearfixes and floats are another common use case. An anchor that I want to look like a button might have classes like "button orange float-r margin-r20".
- dheera 11y agoIf you're repeatedly using 10px paddings, it doesn't really save anything to name your classes 'padding-10px'. Inlining your CSS is just as efficient. Plus, if you have to change your styling, e.g. from 10px to 12px, all of a sudden you have to change both the definition of the class AND the name of the class, which is a mess. And if you don't, you have a class called 'padding-10px' that is actually 12px and that is a real mess. If you're naming your classes to create abstractions, i.e. 'article-box' or 'navbar-section' then it makes a lot more sense.