Do you adhere to certain CSS methodologies?

I’m trying my luck with the OOCSS methodology for the first time in a small project I’m working on (just read about it a few days ago).

Can’t really say it’s going that well, as I’m still used to just writing normal CSS without following a certain methodology, so I don’t believe I’m utilizing its advantages to the fullest. However, as my first time with OOCSS I think I’m not doing that bad either, and I can see the benefits. There are also all the other methodologies like SMACSS and BEM. The latter seems to be really popular. Will surely give them a try with more complex projects.

I was just curious, do you guys adhere to CSS methodologies at all? Also, will companies see it as a disadvantage if you don’t follow methodologies in your code, or at least methodologies that they use?

Honestly, never heard of OOCSS until your post. Had to google it up.

Anyways, when I started using LESS, it brought structure and predictability to my CSS. That way, a ul tag, or a p tag, or a specific h2 tag can have it’s own style depending on who it’s parent is… So styling for ul for #parent1 can be different from #parent2. and I don’t have to remember to “Oh I need to apply an additional class (ex: big-text) to this ul tag for div parent2.”

#parent1 {
    ul { 
      // some styles here.... 
    } 
}

#parent2 {
   ul {
     // different style here
   }
}

Then in HTML, I can just have:

<div id="parent1">
   <ul> 
      // stuff here
   </ul>
</div>

<div id="parent2">
   <ul> 
      // stuff here
   </ul>
</div>

My opinion is if you’re NOT writing a CSS framework that will be used by other people, (where you don’t know on what project its going to be used), then doing “separation of concerns” may be overkill for a CSS. I write my CSS for a specific project. I doubt my #parent1 ul styling for Project X will be the same ul style I’m going to use for Project Y.

Of course, I can still use Bootstrap, and BS features can be added via classes, and they don’t interfere with my above css organization. I can also overwrite BS classes but only for a specific div by

#parent2 {
   ul {
     // different style here
   }
   .well {
     // override BS style, or add additional stuff to it
  }
}