News for hackers. Stuff that matters.
Re:How We Could Write Better CSS by nwienert on Tuesday September 24, 2013 @02:35PM (#6439816)
This article is a few years behind the latest best practice.

What this is is basically "Object Oriented CSS" that became popular years ago and was later refuted by many in the community for it's numerous downsides, namely in maintenance cost, code-clutter and slow performance on old browsers and mobile.

With a preprocessor like SASS you can have OO and have semantic class names. Take that margin example. You could define class names that add varying types of margins. But you don't use them in HTML. You create a semantic class for specific use cases that @extend's the margin class you need.

Now you have the best of both worlds. Less, semantic class names, with the flexibility and consistency of the OO style.

There are no comments on this comment yet.