While building a Javascript-heavy web application, what is the best practice for naming CSS classes to keep the Javascript code and CSS stylesheets clean and the UI structur
The cleanest solution would be to decouple everything: HTML - CSS - JS.
To do that, you would use your first approach (the individual naming allows the CSS-classes to be applied to any HTML-element) but additionally you add specially named classes for JS. Like this you don't have to be afraid to break your JS if they remove a CSS class and vice versa.
A good read about how to best implement such a naming convention: http://nicolasgallagher.com/about-html-semantics-front-end-architecture/
// HTML
Item 1
// CSS
.list-delete {
color: black;
}
.item-delete {
color: blue;
}
// Javascript
$(".js-list-delete").show();
$(".js-item-delete").hide();