Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 943 Bytes

Style.md

File metadata and controls

39 lines (27 loc) · 943 Bytes

Style Guidelines

We use fairly standard code style, with a few changes.

Spacing:

  • Indentation should be two spaces, no tabs.
  • No trailing whitespace at end of lines.

JavaScript

Based on Eslint recommended style.

  • Use single quotes unless to avoid needing escaping characters.
  • Use semi colons at the end of lines.
  • See eslint config for more.

CSS

  • Generally follow 18F CSS style, but we don't currently use Sass.
  • Use hyphen-separation rather than CamelCase.
  • Indentation increases with specificity, for example:
.material-radio {
  ...
}
  .material-radio .btn {
    ...
  }
  • but as mentioned in the 18F guides, try to keep specificity low.

HTML

  • Use double quotes around element attribute values (<element attribute="values">)
  • Two space indents.