Eric Meyer’s post Class Presentation has started an interesting discussion on how to keep class names non-presentational.
As an example Eric mentions class names for images, something I took some time to think about while preparing for the recent redesign of this site. I used to have class names like
padded, which didn’t feel quite right.
I’m not so sure what I replaced them with is a whole lot better, but at least I started thinking about it. I use
flow for images that are supposed to let text flow around them, and
fullwidth for those images that should not. Since I want only some images to have a decoration (
padding) I use an additional class name,
dec (as in “decorated”), for those images.
Perfect? Probably not. Less presentational than
padded? I think so.