Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS long css styles vs. mutliple class calls Re: long css styles vs. mutliple class calls

#122546
Paulie_D
Member

I think you will find that most ‘forward thinking’ developers/designers are working with a form of Object Oriented CSS.

We’ll have components with common styles that we can use and re-use and then add additional classes depending on the type of combined element we want.

Take CSS-Tricks main page. Chris has a ‘module’ component that is basically a white box with margin and padding on it. Each box then gets another class which adds the top-border color depending on what the post type is.

So while he is chaining classes, he’s not doing it to the extent that your example would suggest.

I’m not going to create individual property (.border-1) for a 1px border and another for a 2px border (.border-2)….that way lies madness.