Sass 3.2 Placeholders and Object-Oriented CSS

About 1 min reading time

Follow link to ianstormtaylor.com →

Ian Storm Taylor on how to use Sass 3.2's Placeholder feature together with Object-Oriented CSS (OOCSS), in order to create a clutter-free HTML presentation as well as semantic CSS classes. I immediately thought of Placeholders as the abstract classes in object-oriented programming languages, such as Java – they're only used to inherit from.

I also like the shift from clinically clean HTML – stripped from all classes – to a more semantic thinking which tells us that a bunch of classes in our HTML aren't that bad if they're semantic and makes sense (boy aren't I just tossing the word semantic around?). You can always rely on classes. HTML elements might change, but their styling will stay the same if you apply the same class on the new element, for instance.

Thanks to Sass and some planning, I think you're able to pull off some pretty sweet reusable CSS in the end.