Skip to content

Commit 2c148d5

Browse files
author
Ashley Baldwin-Hunter
authored
Add rule about spacing (#57)
* Add rule about spacing Inspired by discussion in this PR: https://github.com/codeclimate/app/pull/3973#issuecomment-283774038
1 parent 6366cf3 commit 2c148d5

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

sass/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,61 @@ Notable exceptions:
1616
* prefer double quotes
1717

1818
[1]: http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
19+
20+
## Whitespace
21+
22+
Use space between neighboring nested blocks, but not before or after.
23+
24+
### Good
25+
26+
```scss
27+
.btn {
28+
display: inline-block;
29+
font-size: 15px;
30+
31+
&:hover {
32+
box-shadow: 0 5px 7px $box-shadow-color;
33+
}
34+
35+
&:active {
36+
box-shadow: 0 1px 3px $box-shadow-color;
37+
color: $green-dark;
38+
}
39+
}
40+
```
41+
42+
### Bad
43+
44+
```scss
45+
.btn {
46+
47+
display: inline-block;
48+
font-size: 15px;
49+
50+
&:hover {
51+
box-shadow: 0 5px 7px $box-shadow-color;
52+
}
53+
54+
&:active {
55+
box-shadow: 0 1px 3px $box-shadow-color;
56+
color: $green-dark;
57+
}
58+
59+
}
60+
```
61+
62+
### Bad
63+
64+
```scss
65+
.btn {
66+
display: inline-block;
67+
font-size: 15px;
68+
&:hover {
69+
box-shadow: 0 5px 7px $box-shadow-color;
70+
}
71+
&:active {
72+
box-shadow: 0 1px 3px $box-shadow-color;
73+
color: $green-dark;
74+
}
75+
}
76+
```

0 commit comments

Comments
 (0)