Stop using 'background-color' in your CSS
welcomebrand.co.uk
welcomebrand.co.uk
I understand that if I have multiple definitions, I can collapse them -- but if that's the point, the title of the post shouldn't be "stop using background-color".
Anyway, as people have mentioned already this is completely off the mark. The whole principle how CSS long/shorthand works is so you use the right accessor when it suits.
#item { background: #fff url(bg.gif) no-repeat top left; }
is anyone really supposed to believe that cascading to: #item.alert { background: #ff0000 url(bg.gif) no-repeat top left; }
is more sensible than just #item.alert { background-color: #ff0000; }
background-color is just one of those ones that I see all the time and always remove from code I use in plugins because I’m a little OCD like that
oh.
Meaning that if he upgrades, he either merges the changes, or does it all over again?
That's not OCD. That's a giant waste of time. Writing a script to do it automatically would have been less waste (a CSS minifier? surely that must already exist).
Commenting meticulously, streamlining indentation, writing commit logs consisting of full sentences, that's OCD (the good kind). "Fixing" perfectly fine libraries is stupid.
The only reason to use the verbose declarations is in jQuery where a specific part of an element attribute is updated, and resetting everything else is not wanted. I.E. {background:#ddd url(somefile.png) no-repeat} => {background:#fff}
In the above case, the image background would be dropped.
I've always preferred being a little more verbose, if only to avoid hidden side effects and improve readability. You can always compress later if it really bothers you.
http://www.welcomebrand.co.uk/blog/please-stop-using-backgro...