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

251 Views Asked by At

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. : )

1

There are 1 best solutions below

0
On

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?