Skip to content

Coding Conventions

Huy Anh Nguyen edited this page Jan 7, 2019 · 2 revisions

This wiki contains all the conventions necessary for working on this project.

I. Coding conventions

1. IDs and Classes

  • For changing the presentation in CSS, use class only.

  • For naming, we are going to use BEM naming convention. This means that the class name will have this structure: block-name__element-name--modifier. The name will use dash to separate two or more words (block-name instead of blockName or block_name). For more information, you can take a look here: http://getbem.com/naming/

2. Others

  • There are no spaces between a key-value pair of a HTML attribute. To be more specific, an attribute name, an equal sign and the attribute's value should be written continuously without any spaces between them. For example, we use class="block" instead of class = "block"

II. Commits and Pull requests

Every pull request must follow the following structure (the list dot is just a dash "-"):

[IssueNo] Feature/Bugfix:

  • Change1

  • Change2

  • Note: Issue Number can be gotten from the issue page here. 'Feature' is used when a new feature is added (the issue is adding new feature) in the Pull Request, and 'Bugfix' is used when the Pull Request is a bugfix (when the issue is a bug, or when the feature of the issue caused a bug).

An example pull request:

[#12] Feature:

  • Added new page test.html
  • Added the button to the nav bar
  • Some other things here
Clone this wiki locally