Published 2 years 8 months ago on June 16, 2011 — 2 min read
It turns out many people don’t enjoy being told that their work has potential issues, at least when it comes to their CSS. I ran some of my work through the tool, and it screamed bloody murder at me for using id’s in my selectors. This seems to be the most common point at which people are throwing up their arms and saying the tool is worthless. Personally, I took a look at the rules to see why. Then it clicked. The rule is as follows:
IDs shouldn’t be used in selectors because these rules are too tightly coupled with the HTML and have no possibility of reuse. It’s much preferred to use classes in selectors and then apply a class to an element in the page.
Okay, that makes sense to a certain degree. Personally I feel different about it, but a little more research showed me that CSS Lint was built and is distributed by none other than stubbornella herself. Nicole Sullivan is famous for her views on ‘object-oriented’ CSS so it makes complete sense that the above would result in a warning of usage in her tool.
I continued reading. There are things to be learned from CSS Lint. There are a couple of things that contradict how I use CSS, but reading the rule is going to get me thinking about it for the next few projects, that’s for sure.
CSS Lint doesn’t have to be the rule by which you style your documents from this day forth, but like anything, we should be taking these opportunities to both learn as well as validate our reasons for disagreement on any particular rule or two. Already some bugs have been filed and changes are imminent.