Skip to content
This repository was archived by the owner on Jun 21, 2020. It is now read-only.

Commit 4964d49

Browse files
author
Justin Myers
committed
Updated styleguide for Nerium International standards
1 parent ce8a27a commit 4964d49

File tree

3 files changed

+70
-86
lines changed

3 files changed

+70
-86
lines changed

.sass-lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
files:
2+
include: '**/*.s+(a|c)ss'
3+
options:
4+
formatter: stylish
5+
merge-default-rules: false
6+
rules:
7+
indentation:
8+
- 1
9+
- size: 4
10+
bem-depth: 1
11+
border-zero:
12+
- 1
13+
- convention: zero
14+
brace-style:
15+
- 1
16+
- allow-single-line: false
17+
class-name-format:
18+
- 1
19+
- convention: '^(?!js-).*'
20+
convention-explanation: 'should not be written in the form js-*'
21+
extends-before-declarations: 0
22+
extends-before-mixins: 0
23+
function-name-format: 1
24+
id-name-format:
25+
- 1
26+
- convention: hyphenatedbem
27+
leading-zero: 0
28+
mixin-name-format: 1
29+
mixins-before-declarations: 0
30+
no-extends: 1
31+
no-qualifying-elements: 0
32+
placeholder-name-format:
33+
- 1
34+
- convention: hyphenatedbem
35+
property-sort-order: 0
36+
quotes:
37+
- 1
38+
- style: double
39+
variable-name-format: 1

.scss-lint.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Airbnb CSS / Sass Styleguide
1+
# Nerium International CSS / Sass Styleguide
22

33
*A mostly reasonable approach to CSS and Sass*
44

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+
57
## Table of Contents
68

79
1. [Terminology](#terminology)
@@ -22,7 +24,6 @@
2224
- [Mixins](#mixins)
2325
- [Extend directive](#extend-directive)
2426
- [Nested selectors](#nested-selectors)
25-
1. [Translation](#translation)
2627

2728
## Terminology
2829

@@ -32,8 +33,8 @@ A “rule declaration” is the name given to a selector (or a group of selector
3233

3334
```css
3435
.listing {
35-
font-size: 18px;
36-
line-height: 1.2;
36+
font-size: 18px;
37+
line-height: 1.2;
3738
}
3839
```
3940

@@ -43,11 +44,11 @@ In a rule declaration, “selectors” are the bits that determine which element
4344

4445
```css
4546
.my-element-class {
46-
/* ... */
47+
/* ... */
4748
}
4849

4950
[aria-hidden] {
50-
/* ... */
51+
/* ... */
5152
}
5253
```
5354

@@ -66,7 +67,7 @@ Finally, properties are what give the selected elements of a rule declaration th
6667

6768
### Formatting
6869

69-
* Use soft tabs (2 spaces) for indentation
70+
* Use soft tabs (4 spaces) for indentation
7071
* Prefer dashes over camelCasing in class names.
7172
- Underscores and PascalCasing are okay if you are using BEM (see [OOCSS and BEM](#oocss-and-bem) below).
7273
* Do not use ID selectors
@@ -94,14 +95,14 @@ Finally, properties are what give the selected elements of a rule declaration th
9495

9596
```css
9697
.avatar {
97-
border-radius: 50%;
98-
border: 2px solid white;
98+
border-radius: 50%;
99+
border: 2px solid white;
99100
}
100101

101102
.one,
102103
.selector,
103104
.per-line {
104-
// ...
105+
// ...
105106
}
106107
```
107108

@@ -189,15 +190,15 @@ Use `0` instead of `none` to specify that a style has no border.
189190

190191
```css
191192
.foo {
192-
border: none;
193+
border: none;
193194
}
194195
```
195196

196197
**Good**
197198

198199
```css
199200
.foo {
200-
border: 0;
201+
border: 0;
201202
}
202203
```
203204

@@ -216,9 +217,9 @@ Use `0` instead of `none` to specify that a style has no border.
216217

217218
```scss
218219
.btn-green {
219-
background: green;
220-
font-weight: bold;
221-
// ...
220+
background: green;
221+
font-weight: bold;
222+
// ...
222223
}
223224
```
224225

@@ -228,10 +229,10 @@ Use `0` instead of `none` to specify that a style has no border.
228229

229230
```scss
230231
.btn-green {
231-
background: green;
232-
font-weight: bold;
233-
@include transition(background 0.5s ease);
234-
// ...
232+
background: green;
233+
font-weight: bold;
234+
@include transition(background 0.5s ease);
235+
// ...
235236
}
236237
```
237238

@@ -241,13 +242,13 @@ Use `0` instead of `none` to specify that a style has no border.
241242

242243
```scss
243244
.btn {
244-
background: green;
245-
font-weight: bold;
246-
@include transition(background 0.5s ease);
245+
background: green;
246+
font-weight: bold;
247+
@include transition(background 0.5s ease);
247248

248-
.icon {
249-
margin-right: 10px;
250-
}
249+
.icon {
250+
margin-right: 10px;
251+
}
251252
}
252253
```
253254

@@ -269,11 +270,11 @@ Mixins should be used to DRY up your code, add clarity, or abstract complexity--
269270

270271
```scss
271272
.page-container {
272-
.content {
273-
.profile {
274-
// STOP!
273+
.content {
274+
.profile {
275+
// STOP!
276+
}
275277
}
276-
}
277278
}
278279
```
279280

@@ -286,14 +287,4 @@ When selectors become this long, you're likely writing CSS that is:
286287
287288
Again: **never nest ID selectors!**
288289
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:
294-
295-
- ![cn](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/China.png) **Chinese (Simplified)**: [Zhangjd/css-style-guide](https://github.com/Zhangjd/css-style-guide)
296-
- ![ru](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Russia.png) **Russian**: [Nekorsis/css-style-guide](https://github.com/Nekorsis/css-style-guide)
297-
- ![ja](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Japan.png) **Japanese**: [nao215/css-style-guide](https://github.com/nao215/css-style-guide)
298-
- ![es](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Spain.png) **Spanish**: [ismamz/guia-de-estilo-css](https://github.com/ismamz/guia-de-estilo-css)
299-
- ![PT-BR](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Brazil.png) **Portuguese**: [felipevolpatto/css-style-guide](https://github.com/felipevolpatto/css-style-guide)
290+
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

Comments
 (0)