Okay, so I’m no expert like Coyier, Cederholm or Marcotte, but I’m having a hard time coming to terms with the idea that adjoining classes is bad practice… In this post, I’ll probably end up answering my own question with a question, but the rhetoric has its place. And I’d really like you guys’ feedback, please.
Here’s an example: (ignore the odd spacing on tags)
I set a global class .column, that floats the div, like so:
I can use the .column class on paragraphs, divs, whatever…
As expected, I can target the .column by specifying a parent. But, by adjoining the classes _.column_ and _.one_, or _.column.three_, I can also target and style the first or third column differently, like so:
I use them generously, and I also was surprized about this.
Come to think of it a little, it is probably because the class “two” could also apply to other adjacent classes, so you can define .column.two, but say you also want to define .level.one for the same element… then you will have a problem because it won’t be clear to what the two applies. You will need to do something like .column-two and .level-one.
But heck, i’m gonna continue using them, I guess. Hey after all, I know what I’m doing.