Code Guide

Standards for developing flexible, durable, and sustainable HTML, CSS, and JavaScript.

Touchstones & general rules


Always write code with the knowledge that others will be reading it now and in the future:


When you write code with a team, simple beats clever, every time. If your clever trick requires an explanatory comment that is longer than the code itself, consider simplifying it so it’s easier to read, understand, and maintain.

Editor preferences

Set your editor to the following settings to avoid common code inconsistencies and dirty diffs:

Consider documenting and applying these preferences to your project's .editorconfig file. For an example, see the one in Bootstrap. Learn more about EditorConfig.

Code reviews and linters

The rules in this guide, once agreed upon by your team, can and should be referred to and cited in code reviews.

Also consider setting up code linters in your test suite to enforce these standards, to reduce the pain of instilling good citizenship and keeping the code clean.