You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+31-40Lines changed: 31 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
-
# Airbnb CSS / Sass Styleguide
1
+
# Nerium International CSS / Sass Styleguide
2
2
3
3
*A mostly reasonable approach to CSS and Sass*
4
4
5
+
This styleguide is based off of the Airbnb CSSThis styleguide is based off of the Airbnb Javascript Style Guide. It has been updated to fit the standards of Nerium International. Style Guide. It has been updated to fit the standards of Nerium International.
6
+
5
7
## Table of Contents
6
8
7
9
1.[Terminology](#terminology)
@@ -22,7 +24,6 @@
22
24
-[Mixins](#mixins)
23
25
-[Extend directive](#extend-directive)
24
26
-[Nested selectors](#nested-selectors)
25
-
1.[Translation](#translation)
26
27
27
28
## Terminology
28
29
@@ -32,8 +33,8 @@ A “rule declaration” is the name given to a selector (or a group of selector
32
33
33
34
```css
34
35
.listing {
35
-
font-size: 18px;
36
-
line-height: 1.2;
36
+
font-size: 18px;
37
+
line-height: 1.2;
37
38
}
38
39
```
39
40
@@ -43,11 +44,11 @@ In a rule declaration, “selectors” are the bits that determine which element
43
44
44
45
```css
45
46
.my-element-class {
46
-
/* ... */
47
+
/* ... */
47
48
}
48
49
49
50
[aria-hidden] {
50
-
/* ... */
51
+
/* ... */
51
52
}
52
53
```
53
54
@@ -66,7 +67,7 @@ Finally, properties are what give the selected elements of a rule declaration th
66
67
67
68
### Formatting
68
69
69
-
* Use soft tabs (2 spaces) for indentation
70
+
* Use soft tabs (4 spaces) for indentation
70
71
* Prefer dashes over camelCasing in class names.
71
72
- Underscores and PascalCasing are okay if you are using BEM (see [OOCSS and BEM](#oocss-and-bem) below).
72
73
* Do not use ID selectors
@@ -94,14 +95,14 @@ Finally, properties are what give the selected elements of a rule declaration th
94
95
95
96
```css
96
97
.avatar {
97
-
border-radius: 50%;
98
-
border: 2pxsolidwhite;
98
+
border-radius: 50%;
99
+
border: 2pxsolidwhite;
99
100
}
100
101
101
102
.one,
102
103
.selector,
103
104
.per-line {
104
-
// ...
105
+
// ...
105
106
}
106
107
```
107
108
@@ -189,15 +190,15 @@ Use `0` instead of `none` to specify that a style has no border.
189
190
190
191
```css
191
192
.foo {
192
-
border: none;
193
+
border: none;
193
194
}
194
195
```
195
196
196
197
**Good**
197
198
198
199
```css
199
200
.foo {
200
-
border: 0;
201
+
border: 0;
201
202
}
202
203
```
203
204
@@ -216,9 +217,9 @@ Use `0` instead of `none` to specify that a style has no border.
216
217
217
218
```scss
218
219
.btn-green {
219
-
background: green;
220
-
font-weight: bold;
221
-
// ...
220
+
background: green;
221
+
font-weight: bold;
222
+
// ...
222
223
}
223
224
```
224
225
@@ -228,10 +229,10 @@ Use `0` instead of `none` to specify that a style has no border.
228
229
229
230
```scss
230
231
.btn-green {
231
-
background: green;
232
-
font-weight: bold;
233
-
@includetransition(background0.5sease);
234
-
// ...
232
+
background: green;
233
+
font-weight: bold;
234
+
@includetransition(background0.5sease);
235
+
// ...
235
236
}
236
237
```
237
238
@@ -241,13 +242,13 @@ Use `0` instead of `none` to specify that a style has no border.
241
242
242
243
```scss
243
244
.btn {
244
-
background: green;
245
-
font-weight: bold;
246
-
@includetransition(background0.5sease);
245
+
background: green;
246
+
font-weight: bold;
247
+
@includetransition(background0.5sease);
247
248
248
-
.icon {
249
-
margin-right: 10px;
250
-
}
249
+
.icon {
250
+
margin-right: 10px;
251
+
}
251
252
}
252
253
```
253
254
@@ -269,11 +270,11 @@ Mixins should be used to DRY up your code, add clarity, or abstract complexity--
269
270
270
271
```scss
271
272
.page-container {
272
-
.content {
273
-
.profile {
274
-
// STOP!
273
+
.content {
274
+
.profile {
275
+
// STOP!
276
+
}
275
277
}
276
-
}
277
278
}
278
279
```
279
280
@@ -286,14 +287,4 @@ When selectors become this long, you're likely writing CSS that is:
286
287
287
288
Again: **never nest ID selectors!**
288
289
289
-
If you must use an ID selector in the first place (and you should really try not to), they should never be nested. If you find yourself doing this, you need to revisit your markup, or figure out why such strong specificity is needed. If you are writing well formed HTML and CSS, you should **never** need to do this.
290
-
291
-
## Translation
292
-
293
-
This style guide is also available in other languages:
If you must use an ID selector in the first place (and you should really try not to), they should never be nested. If you find yourself doing this, you need to revisit your markup, or figure out why such strong specificity is needed. If you are writing well formed HTML and CSS, you should **never** need to do this.
0 commit comments