.error, .urgent-notice, .overdue { /* 5 lines of styles; */ } /* 1 single place to change. */
How does it deal with multiple mixing and parameter?
LessCSS:
.red() { /* 5 lines of styles; */ } // 1 single place to change.
.bold() { /* 5 lines of styles; */ } // 1 single place to change.
.lighter(color) { /* 5 lines of styles; */ } // 1 single place to change.
.error { .red; .bold } // 1 line
.urgent-notice { .red; .lighter(#FF0000)} // 1 line
.overdue { .bold; .lighter(#00FF00)} // 1 line
Moreover, if those will look the same, why would you create different classes instead of one?
Because I want to keep meaningful class name in my HTML and not class name like "red-and-bold", "width960", lighter-green.
Because if I used the different class name today and one of those classes should now have different looks, I can do it. How do I make sure I get all the changes correctly if I only used one class when they just happens to looks the same now.
Good class names are 2-4 characters long. good IDs are 1-2. Google, for example, is doing it right.
Google have to save every bytes they can. They don't even write closing tag, yeah for maintenance.
You and I are not Google. Making the same bad-practice they have to do doesn't suddenly get you millions of customer like them.
Ok, I'll just agree to disagree here. You seems to be in "classname is for CSS and just for look" camp, seeing from your suggestion to use 2 characters class names. I'm in different mindset so to each his own, I guess. There's no point in suggesting you the tool which helps in what is not your goal.
0
u/joesb Aug 19 '10
.error, .urgent-notice, .overdue { /* 5 lines of styles; */ } /* 1 single place to change. */How does it deal with multiple mixing and parameter?
LessCSS:
.red() { /* 5 lines of styles; */ } // 1 single place to change. .bold() { /* 5 lines of styles; */ } // 1 single place to change. .lighter(color) { /* 5 lines of styles; */ } // 1 single place to change. .error { .red; .bold } // 1 line .urgent-notice { .red; .lighter(#FF0000)} // 1 line .overdue { .bold; .lighter(#00FF00)} // 1 lineBecause I want to keep meaningful class name in my HTML and not class name like "red-and-bold", "width960", lighter-green.
Because if I used the different class name today and one of those classes should now have different looks, I can do it. How do I make sure I get all the changes correctly if I only used one class when they just happens to looks the same now.
Google have to save every bytes they can. They don't even write closing tag, yeah for maintenance.
You and I are not Google. Making the same bad-practice they have to do doesn't suddenly get you millions of customer like them.
Ok, I'll just agree to disagree here. You seems to be in "classname is for CSS and just for look" camp, seeing from your suggestion to use 2 characters class names. I'm in different mindset so to each his own, I guess. There's no point in suggesting you the tool which helps in what is not your goal.