I have been embarrassing both OOCSS and the B.E.M. naming conventions for quite some time and will NEVER look back. For those who are claiming that it's just a "catchy buzz-word" or "CSS already does this stuff", do not understand the potential of writing css using both of these methodologies.
Let's look at the simplest of objects, a list with links. It comes in many different flavors:
Menus
Toolbars
Tabs
Panels (Bootstrap)
In OOCSS, we find the common properties of each of these and create a base object. I usually call it nav.
/* Nav
=================================================*/
/* B
---------------------------------------------*/
.nav
{
margin-left: 0;
padding-left: 0;
list-style: none;
}
/* E
---------------------------------------------*/
.nav__item
{
float: left;
}
.nav__link
{
display: block;
color: inherit;
text-decoration: none;
}
/* M
---------------------------------------------*/
.nav--right
{
float: right;
}
.nav--stack .nav__item
{
float: none;
}
You will notice a few things:
Nav is the base object that gets applied to the block element
Child elements are prefixed with nav_
Modifiers are prefixed with nav--
A modifier is an option that changes behavior. For example --right floats nav right.
Once I have my base object witten, I create skins that will change the appearance of the object. This will turn it into toolbars, tabs, etc. Microsoft has Pivot tabs on their phones. It is an easier skin to create fpr now.
/* Nav
=================================================*/
/* E
---------------------------------------------*/
.pivot .nav__item
{
margin-left: 24px;
color: #aaa;
font-size: 36px;
}
.pivot .nav__item--active, .pivot .nav__item:hover
{
color: #000;
}
To use this object and skin, you would write
<ul class="pivot nav">
<li class="nav__item">
<a class="nav__link"> Item 1 </a>
</li>
<li class="nav__item">
<a class="nav__link"> Item 2 </a>
</li>
</ul>
Because of its location independence, you can also write it as
<nav class="pivot nav">
<div class="nav__item">
<a class="nav__link"> Item 1 </a>
</li>
<div class="nav__item">
<a class="nav__link"> Item 2 </a>
</div>
</nav>
Ultimately, you are separating the container from the skin. I would suggest start smaller with Nicole Sullivans Media Object. Take a look at Twiter Bootstrap and Inuit.css for more inspiration.