If you've ever worked on a large programming project you know all about the joy of trying to read other people's code. And of course that's how everyone else feels about reading your code. That's why formal programming style guides exist – to help bridge the gap between individual styles.
There is no right or wrong style of writing code, but there are styles that are easier to read and share with other people. Search the web and you'll find formal guides to writing readable JavaScript, Python, Ruby and countless other popular languages, but one language that doesn't get as much attention is CSS.
Developer Nicolas Gallagher wants to change that. To do so Gallagher has put together Idiomatic CSS, a style guide for how to format, organize and craft quality CSS that anyone can work with. Here are the general principles of the project:
Idiomatic CSS follows in the footsteps of Rick Waldron's Idiomatic JS, which does the same thing for JavaScript.
If you've made the leap to a CSS preprocessor like SASS or LESS, fear not, Idiomatic CSS has you covered as well. Preprocessor syntax varies and Idiomatic CSS offers examples in SCSS, but the more general rule, "your conventions should be extended to accommodate the particularities of any preprocessor in use," apply to others as well.
Wrangling CSS on large projects can be a pain, but if you take the time to create a set of conventions and ensure that everyone sticks to them it becomes a much more manageable task. If you've got experience and insight to share, head on over to the Idiomatic CSS GitHub page and contribute your knowledge.