csldry
csldry

Reputation: 1

Why css object should start with prefix o- and component starts with c-?

Is there any reason why in css naming convention, some object preferably start with prefix o- and component starts with c- ?

I know o- will stand for object and c- stand for component, but why don't we just ignore that rules? For example c-btn, why we're using c-, I thought it was too verbose. Instead using some of that prefix, we can just use btn, simple clean and straight to the point.

Please, enlighten me guys. : )

Upvotes: 0

Views: 274

Answers (1)

Mattia Astorino
Mattia Astorino

Reputation: 1576

ITCSS is not OOCSS 😌. To aswer your question, with ITCSS you have specific folder location for components, objects...and other family types.

Since it was meant to work with other people, if you write the namespace before the classname everyone can easily recognise where the code and his file is located. If you don't do it, you can have a .btn, .button, .circular-button. What is an object and what is a component?

Upvotes: 0

Related Questions