Skip to content

Commit 05ad559

Browse files
committed
Added scss linting
1 parent f24c0da commit 05ad559

File tree

12 files changed

+268
-58
lines changed

12 files changed

+268
-58
lines changed

.drone.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ steps:
88
image: mhart/alpine-node:12
99
commands:
1010
- yarn install
11-
- yarn lint
11+
- yarn lint-js
12+
- yarn lint-scss
13+
depends_on:
14+
- clone
1215

1316
- name: node10
1417
image: mhart/alpine-node:10
1518
commands:
1619
- yarn install
17-
- yarn lint
20+
- yarn lint-js
21+
- yarn lint-scss
22+
depends_on:
23+
- clone
1824

1925
---
2026
kind: signature
21-
hmac: 5594aac86b34494084f2b8acd3a7bf13c659f86c72bccd4ea149089f32d5059b
27+
hmac: a99df4241c8cbf630aa4941ed22712019474c707b2f62c0581b64885e971f1ae
2228

2329
...

.sass-lint.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
files:
2-
include: '**/*.scss'
2+
include: 'resources/assets/scss/**/*.scss'
33
options:
44
formatter: stylish
55
merge-default-rules: false
6+
config-file: .sass-lint/property-sort-order.yml
67
rules:
78
border-zero: 1
89
brace-style:
@@ -25,7 +26,7 @@ rules:
2526
- include: true
2627
force-attribute-nesting: 1
2728
force-element-nesting: 1
28-
force-pseudo-nesting: 1
29+
force-pseudo-nesting: 0
2930
function-name-format:
3031
- 1
3132
- allow-leading-underscore: true
@@ -42,7 +43,9 @@ rules:
4243
indentation:
4344
- 0
4445
- size: 4
45-
leading-zero: true
46+
leading-zero:
47+
- 1
48+
- include: true
4649
mixin-name-format:
4750
- 1
4851
- allow-leading-underscore: true
@@ -51,8 +54,10 @@ rules:
5154
nesting-depth:
5255
- 1
5356
- max-depth: 3
54-
no-color-keywords: 0
55-
no-color-literals: 0
57+
no-color-keywords: 1
58+
no-color-literals:
59+
- 1
60+
- allow-rgba: true
5661
no-css-comments: 1
5762
no-debug: 1
5863
no-duplicate-properties: 1
@@ -62,7 +67,7 @@ rules:
6267
no-mergeable-selectors: 1
6368
no-misspelled-properties:
6469
- 1
65-
- extra-properties: []
70+
- extra-properties: [ ]
6671
no-qualifying-elements:
6772
- 1
6873
- allow-element-with-attribute: false
@@ -74,10 +79,6 @@ rules:
7479
placeholder-name-format:
7580
- 1
7681
- convention: hyphenatedlowercase
77-
property-sort-order:
78-
- 1
79-
- ignore-custom-properties: true
80-
order: recess
8182
quotes:
8283
- 1
8384
- style: single

.sass-lint/property-sort-order.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Copied from https://github.com/sasstools/sass-lint/blob/49c3377464a7119f14a49174203d092a916c932f/lib/config/property-sort-orders/recess.yml
2+
# Includes additional properties as RECESS is no longer being maintained by Twitter.
3+
4+
rules:
5+
property-sort-order:
6+
- 1
7+
-
8+
order:
9+
- 'position'
10+
- 'top'
11+
- 'right'
12+
- 'bottom'
13+
- 'left'
14+
- 'z-index'
15+
- 'display'
16+
- 'align-content'
17+
- 'align-items'
18+
- 'align-self'
19+
- 'flex'
20+
- 'flex-basis'
21+
- 'flex-direction'
22+
- 'flex-flow'
23+
- 'flex-grow'
24+
- 'flex-shrink'
25+
- 'flex-wrap'
26+
- 'justify-content'
27+
- 'order'
28+
- 'float'
29+
- 'width'
30+
- 'height'
31+
- 'max-width'
32+
- 'max-height'
33+
- 'min-width'
34+
- 'min-height'
35+
- 'padding'
36+
- 'padding-top'
37+
- 'padding-right'
38+
- 'padding-bottom'
39+
- 'padding-left'
40+
- 'margin'
41+
- 'margin-top'
42+
- 'margin-right'
43+
- 'margin-bottom'
44+
- 'margin-left'
45+
- 'margin-collapse'
46+
- 'margin-top-collapse'
47+
- 'margin-right-collapse'
48+
- 'margin-bottom-collapse'
49+
- 'margin-left-collapse'
50+
- 'overflow'
51+
- 'overflow-x'
52+
- 'overflow-y'
53+
- 'clip'
54+
- 'clear'
55+
- 'font'
56+
- 'font-family'
57+
- 'font-size'
58+
- 'font-smoothing'
59+
- 'osx-font-smoothing'
60+
- 'font-style'
61+
- 'font-variant'
62+
- 'font-weight'
63+
- 'hyphens'
64+
- 'src'
65+
- 'line-height'
66+
- 'letter-spacing'
67+
- 'word-spacing'
68+
- 'color'
69+
- 'text-align'
70+
- 'text-decoration'
71+
- 'text-indent'
72+
- 'text-overflow'
73+
- 'text-rendering'
74+
- 'text-size-adjust'
75+
- 'text-shadow'
76+
- 'text-transform'
77+
- 'word-break'
78+
- 'word-wrap'
79+
- 'white-space'
80+
- 'vertical-align'
81+
- 'list-style'
82+
- 'list-style-type'
83+
- 'list-style-position'
84+
- 'list-style-image'
85+
- 'pointer-events'
86+
- 'cursor'
87+
- 'background'
88+
- 'background-attachment'
89+
- 'background-color'
90+
- 'background-image'
91+
- 'background-position'
92+
- 'background-repeat'
93+
- 'background-size'
94+
- 'border'
95+
- 'border-collapse'
96+
- 'border-top'
97+
- 'border-right'
98+
- 'border-bottom'
99+
- 'border-left'
100+
- 'border-color'
101+
- 'border-image'
102+
- 'border-image-source'
103+
- 'border-image-slice'
104+
- 'border-image-width'
105+
- 'border-image-outset'
106+
- 'border-image-repeat'
107+
- 'border-top-color'
108+
- 'border-right-color'
109+
- 'border-bottom-color'
110+
- 'border-left-color'
111+
- 'border-spacing'
112+
- 'border-style'
113+
- 'border-top-style'
114+
- 'border-right-style'
115+
- 'border-bottom-style'
116+
- 'border-left-style'
117+
- 'border-width'
118+
- 'border-top-width'
119+
- 'border-right-width'
120+
- 'border-bottom-width'
121+
- 'border-left-width'
122+
- 'border-radius'
123+
- 'border-top-right-radius'
124+
- 'border-bottom-right-radius'
125+
- 'border-bottom-left-radius'
126+
- 'border-top-left-radius'
127+
- 'border-radius-topright'
128+
- 'border-radius-bottomright'
129+
- 'border-radius-bottomleft'
130+
- 'border-radius-topleft'
131+
- 'content'
132+
- 'quotes'
133+
- 'outline'
134+
- 'outline-color'
135+
- 'outline-offset'
136+
- 'outline-style'
137+
- 'outline-width'
138+
- 'opacity'
139+
- 'filter'
140+
- 'visibility'
141+
- 'size'
142+
- 'zoom'
143+
- 'transform'
144+
- 'transform-origin'
145+
- 'box-align'
146+
- 'box-flex'
147+
- 'box-orient'
148+
- 'box-pack'
149+
- 'box-shadow'
150+
- 'box-sizing'
151+
- 'table-layout'
152+
- 'animation'
153+
- 'animation-delay'
154+
- 'animation-duration'
155+
- 'animation-iteration-count'
156+
- 'animation-name'
157+
- 'animation-play-state'
158+
- 'animation-timing-function'
159+
- 'animation-fill-mode'
160+
- 'transition'
161+
- 'transition-delay'
162+
- 'transition-duration'
163+
- 'transition-property'
164+
- 'transition-timing-function'
165+
- 'background-clip'
166+
- 'backface-visibility'
167+
- 'resize'
168+
- 'appearance'
169+
- 'user-select'
170+
- 'interpolation-mode'
171+
- 'direction'
172+
- 'marks'
173+
- 'page'
174+
- 'set-link-source'
175+
- 'unicode-bidi'
176+
- 'speak'
177+
ignore-custom-properties: true

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"private": true,
55
"scripts": {
66
"build": "bin/build",
7-
"lint": "eslint app boot resources/assets/babel"
7+
"lint-js": "eslint app boot resources/assets/babel",
8+
"lint-scss": "sass-lint --verbose --max-warnings=0 --no-exit"
89
},
910
"dependencies": {
1011
"grind-core-frontend": "^0.8.0-beta.3",
@@ -31,6 +32,7 @@
3132
"node-sass": "^4.12.0",
3233
"normalize.css": "^8.0.1",
3334
"ouch": "^2.0.0",
35+
"sass-lint": "^1.13.1",
3436
"svgo": "^1.3.0",
3537
"uglify-js": "^3.6.0",
3638
"ws": "^7.1.1"

resources/assets/scss/_variables.scss

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
$body-font-size: 16px;
22
$body-line-height: 1.428571429;
3-
$body-text-color: #4b4a4f;
4-
$body-background-color: #fff;
53

6-
$accent-color: #3a70f4;
7-
$link-color: $accent-color;
8-
$link-color-hover: darken($link-color, 5%);
9-
$link-color-active: darken($link-color, 10%);
4+
$color-white: #fff;
5+
$color-black: #000;
6+
7+
$body-color-foreground: #4b4a4f;
8+
$body-color-background: $color-white;
9+
10+
$color-secondary: #3a70f4;
11+
$color-heading: #1d1c1f;
12+
$color-muted: #8f8e98;
13+
14+
$color-link: $color-secondary;
15+
$color-link-hover: darken($color-link, 5%);
16+
$color-link-active: darken($color-link, 10%);
1017

1118
$font-weight-thin: 100;
1219
$font-weight-ultra-light: 200;
@@ -26,8 +33,27 @@ $transition-timing: $transition-duration $transition-timing-function;
2633

2734
$header-height: 112px;
2835
$header-z-index: 10000;
29-
$header-background-color: rgba($body-background-color, 0.8);
36+
$header-color-link: #494850;
3037

3138
$footer-height: 208px;
3239
$footer-z-index: $header-z-index - 1;
33-
$footer-background-color: rgba($body-background-color, 0.8);
40+
$footer-color-link: $header-color-link;
41+
$footer-color-foreground: #aeb3bf;
42+
$footer-color-border: rgba($footer-color-foreground, 0.15);
43+
44+
$button-color-primary-start: #4c82ff;
45+
$button-color-primary-end: #3b70ed;
46+
$button-color-secondary-start: #5c5c68;
47+
$button-color-secondary-end: #494851;
48+
49+
$code-color-base: #555;
50+
$code-color-keyword: #5520ff;
51+
$code-color-func: #5d99ff;
52+
$code-color-string: #00d8ff;
53+
54+
$toolbar-color-background-start: #e5e5e5;
55+
$toolbar-color-background-end: #d8d8d8;
56+
57+
$toolbar-color-button-red: #ff6058;
58+
$toolbar-color-button-yellow: #ffc02f;
59+
$toolbar-color-button-green: #28ca41;

resources/assets/scss/app.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
html, body {
11-
background: $body-background-color;
11+
background: $body-color-background;
1212
}
1313

1414
body {
@@ -18,16 +18,16 @@ body {
1818
font-family: $font-family-sans-serif;
1919
font-size: $body-font-size;
2020
line-height: $body-line-height;
21-
color: $body-text-color;
21+
color: $body-color-foreground;
2222
}
2323

2424
a {
25-
color: $link-color;
25+
color: $color-link;
2626
text-decoration: none;
2727
transition: color $transition-timing;
2828

29-
&:hover { color: $link-color-hover; }
30-
&:active { color: $link-color-hover; }
29+
&:hover { color: $color-link-hover; }
30+
&:active { color: $color-link-hover; }
3131
}
3232

3333
.brand-logo {

resources/assets/scss/app/_buttons.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
font-size: 15px;
99
font-weight: $font-weight-medium;
1010
line-height: 36px;
11-
color: #fff;
11+
color: $color-white;
1212
cursor: pointer;
1313

14-
background-image: linear-gradient(-180deg, #4c82ff 0%, #3b70ed 100%);
14+
background-image: linear-gradient(-180deg, $button-color-primary-start 0%, $button-color-primary-end 100%);
1515
border-radius: 6px;
16-
box-shadow: 0 1px 2px 0 rgba(#000, 0.15);
16+
box-shadow: 0 1px 2px 0 rgba($color-black, 0.15);
1717

1818
&:hover, &:active {
19-
color: #fff;
19+
color: $color-white;
2020
}
2121
}
2222

2323
.btn-info {
24-
background-image: linear-gradient(-180deg, #5c5c68 0%, #494851 100%);
24+
background-image: linear-gradient(-180deg, $button-color-secondary-start 0%, $button-color-secondary-end 100%);
2525
}
2626

2727
.btn-icon {

0 commit comments

Comments
 (0)