-
Notifications
You must be signed in to change notification settings - Fork 0
/
code-style.txt
115 lines (65 loc) · 1.77 KB
/
code-style.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
--- Code Style ---
======= HTML =======
- Syntax -
- Use two spaces instead tab:
tab
2 spaces *
4 spaces
- Nested elements:
<div class="default">
<p>Some useful
<a href="#">Link</a>
</p>
</div>
- Always use double quotes.
- Don't include a trailing slash in self-closing elements such as: <br>, <hr>
***************************
- Attrs order -
- tag attrs:
• class
• id, name
• data-*
• src, for, type, href, value
• title, alt
• role, aria-*
- Reducing markup -
> Must be:
<img class="avatar" src="...">
***************************
- Indentation and Line Breaks -
Break to a new line if the tag contains another element.
> Must be:
<p>
This is a
<a href="#">Link</a>
</p>
> Exception:
<p>14 000 m<sup>2</sup></p>
***************************
- Escaping characters -
- Use for '<' (<), '>' (>), '&' (&).
***************************
======= CSS, SCSS =======
- 1 -
- Indents of two spaces.
- 2 -
- No vendor's prefixes.
- 3 -
- BEM methodology (only a naming of classes and common concepts).
> Must be:
element__block
menu__arrow_direction_right (modifier: _genus_species)
element__block_active (modifier in one word, if it denotes a state)
ele-ment__blo-ck (name of element or block may be written with hyphen)
- 4 -
- Don't use aggregating property 'flex'.
***************************
======= Flexbox Grid =======
- 1 -
- Renamed '.row' to '.flex-row'
- 2 -
- Added class '.no-pad-xs/sm/md/lg' for deleting of column's paddings.
***************************
======= Page =======
The base template 'application.hbs' includes any page (look in document - {{outlet}} or {{outlet 'modal'}}).
The base element of the page must have a class '.page-fragment'. Any elements inside must be ordered according a grid (Flexbox Grid).