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

Commit 61f03dd

Browse files
author
Marlow Payne
committed
Lint SCSS with sass-lint
1 parent 0912db3 commit 61f03dd

File tree

8 files changed

+35
-20
lines changed

8 files changed

+35
-20
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Migrate all dependencies to NPM, remove Bower
55
- Migrate JS linting to eslint
66
- Migrate SCSS compilation to libsass
7+
- Lint SCSS with sass-lint
78
5.1.2
89
- Ensuring disabled items don't close on close
910
5.0.1

Gruntfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = function(grunt) {
3737
'grunt-eslint',
3838
'grunt-mocha-phantomjs',
3939
'grunt-sass',
40+
'grunt-sass-lint',
4041
'grunt-shell',
4142
'grunt-version'
4243
];
@@ -48,8 +49,8 @@ module.exports = function(grunt) {
4849
});
4950

5051
grunt.registerTask('serve', ['build', 'connect:server', 'watch']);
51-
grunt.registerTask('build', ['lint:prod', 'copy', 'uglify', 'version:all', 'sass', 'autoprefixer']);
52-
grunt.registerTask('release', ['lint:prod', 'test', 'shell:tagRelease']);
52+
grunt.registerTask('build', ['sasslint', 'lint:prod', 'copy', 'uglify', 'version:all', 'sass', 'autoprefixer']);
53+
grunt.registerTask('release', ['test', 'shell:tagRelease']);
5354
grunt.registerTask('test', ['build', 'connect:test', 'mocha_phantomjs']);
5455
grunt.registerTask('test:browser', ['build', 'connect:test:keepalive']);
5556
grunt.registerTask('default', 'build');

dist/bellows-theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
height: 4px;
2929
margin-top: -2px;
3030
background: white;
31-
pointer-events: none;
3231
-webkit-transition: -webkit-transform 0.25s ease-in-out;
3332
transition: transform 0.25s ease-in-out;
33+
pointer-events: none;
3434
}
3535

3636
.bellows__header::before {

dist/bellows-theme.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"grunt-mocha-phantomjs": "0.3.2",
2121
"grunt-open": "0.2.3",
2222
"grunt-sass": "1.1.0",
23+
"grunt-sass-lint": "git+https://github.com/mobify/grunt-sass-lint.git#toggle-rules-in-src",
2324
"grunt-shell": "0.2.2",
2425
"grunt-version": "0.3.3",
2526
"mobify-code-style": "^2.4.2",

src/style/bellows-theme.scss

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@ $active-header-background: #2980b9;
1111
padding: 15px 20px;
1212
border: 1px solid $active-header-background;
1313
border-width: 0 0 1px;
14-
14+
1515
background: $header-background;
16-
16+
1717
color: white;
18-
18+
1919
-webkit-tap-highlight-color: rgba(black, 0);
20-
20+
2121
&:active {
2222
background: $active-header-background;
2323
}
2424

2525
&::before,
2626
&::after {
2727
content: '';
28-
28+
2929
position: absolute;
3030
top: 50%;
3131
right: 20px;
3232
z-index: 2;
33-
33+
3434
display: block;
3535
width: 16px;
3636
height: 4px;
3737
margin-top: -2px;
38-
38+
3939
background: white;
4040

41-
pointer-events: none;
42-
4341
transition: transform 0.25s ease-in-out;
42+
43+
pointer-events: none;
4444
}
4545

4646
&::before {
@@ -55,18 +55,18 @@ $active-header-background: #2980b9;
5555

5656
.bellows__item.bellows--is-open > &,
5757
.bellows__item.bellows--is-opening > & {
58-
&::before {
58+
&::before {
5959
transform: rotate(180deg);
6060
}
6161

6262
&::after {
6363
transform: rotate(360deg);
6464
}
65-
65+
6666
}
6767

6868
.bellows__item.bellows--is-closing > & {
69-
69+
7070
}
7171

7272
.bellows__item:last-child > & {
@@ -84,8 +84,8 @@ $active-header-background: #2980b9;
8484
.bellows__content {
8585
padding: 20px;
8686
border: 1px solid #ecf0f1;
87-
87+
8888
.bellows {
8989
margin-top: 20px;
9090
}
91-
}
91+
}

src/style/bellows.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
.bellows__item.bellows--is-closing {
1010
> .bellows__content-wrapper {
1111
// This declaration is necessary for items that are open by default
12-
display: block
12+
display: block;
1313
}
1414
}
1515

1616
.bellows__content-wrapper {
1717
display: none;
18-
}
18+
}

tasks/config/sasslint.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = function(grunt) {
2+
var targets = [
3+
'src/**/*.scss'
4+
];
5+
6+
return {
7+
options: {
8+
configFile: require.resolve('mobify-code-style/css/.sass-lint.yml')
9+
},
10+
target: targets
11+
};
12+
};

0 commit comments

Comments
 (0)