CSS frames
For large projects, you will most likely need additional functionality on top of the βregularβ css, such as nesting, inheritance, and mixins. Any of them should do their job:
Performance optimization
In addition, you will want to do automatic performance optimization (concatenation, minimization and compression of source files), so take a look at:
or something that suits your development platform.
Naming
Many large sites use some kind of prefix for class names to separate style classes from script classes. For example:.
<div class="navigation dynHomepageNav">(...)</div>
If the dyn* class is used as a selector in scripts and the navigation class is used for styling. The advantage is that you can edit encoder scripts without touching a design, and designers change templates without worrying about functionality violations.
However, with modern Javascript and HTML5 frameworks you can do better; use semantic naming for identifiers and classes, apply style using these identifiers and classes, and use the data-* attributes for all data-* instead. Example:
<section class="navigation" data-hook="homepageNav">(...)</div>
What you will use with class id:
.navigation { border: 1px dotted #9c9; padding: 12px; }
And a script using data binding (using James Padolsey's data selection attribute for jQuery ):
$('section:data(hook="homepageNav")').fadeIn();
It may not be as concise or look as good as the good old use-semantic-classes-for-all method, but it will create a neat separation of style and behavioral properties that you will appreciate when you have 50,000 HTML lines and you need to update the design.