Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/felipefialho/coding-style

[outdated/deprecated] My rules coding for HTML, CSS and JavaScript development
https://github.com/felipefialho/coding-style

code-style coding-style css-syntax html-syntax javascript-syntax

Last synced: 26 days ago
JSON representation

[outdated/deprecated] My rules coding for HTML, CSS and JavaScript development

Awesome Lists containing this project

README

        



# My Coding Style

[![license](https://img.shields.io/github/license/LFeh/coding-style.svg)](./license.md)
[![GitHub contributors](https://img.shields.io/github/contributors/LFeh/coding-style.svg)](https://github.com/LFeh/coding-style/graphs/contributors)

> "Every line of code should appear to be written by a single person, no matter the number of contributors." - Chinese Proverb.

The following document describes the rules of writing in development languages that I use: HTML, CSS and JavaScript.

The idea of this repository is not to be a complete code guide. Only to have a place for myself and other developers who participate in my projects able to inform the coding standards used.

As this is a new document, some rules may not have been applied in old projects.

This is a live document and changes can occur at any time.

## Summary

1. [Commits](#commits)
1. [HTML](#html)
1. [Pug](#Pug)
1. [CSS](#css)
1. [CSS Preprocessors](#css-preprocessors)
1. [JavaScript](#js)
1. [Boilerplate](#boilerplate)
1. [References](#references)
1. [Translations](#translations)


## 1. Commits

In order to facilitate the contribution by anyone in a project, all commit messages, pull request title or issues discussion must be in **English**.

Before commit adjusts in project, check if exists an open issue and make references for this issue using '#' in your commit message.

```javascript
// Good
git commit -m "Add placeholder on input #10"

// Bad
git commit -m "Add placeholder on input"
```


## 2. HTML

The main influence for the HTML rules is the [Code Guide by @mdo](https://github.com/mdo/code-guide).

### HTML Summary

1. [HTML Syntax](#html-syntax)
1. [HTML Comments](#html-comments)
1. [HTML Character Encoding](#html-encoding)
1. [HTML Attribute Order](#html-attribute-order)
1. [HTML Performance](#html-performance)
1. [HTML Base Code](#html-base)


### 2.1. HTML Syntax

Use soft tabs with two spaces. You can configure your editor for this.

```html