Skip to content

Commit 8a55a04

Browse files
authored
Merge pull request #45 from briancwald/8.x-scss-lint-orgainzation-refacator
8.x scss lint orgainzation refacator
2 parents f014bf1 + a2f765d commit 8a55a04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3622
-2504
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ node_modules
44
vendor
55

66
# Dont add npm lock since we are using yarn.
7-
pacckage-lock.json
7+
package-lock.json

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Material Design Inspired Admin Theme Utilizing the [Materialize CSS](http://mate
1414
- `gulp rename` renames conflict with jQueryUI and Materialize CSS autocomplete plugin and places it in /js/lib to manage in git repo.
1515
- `gulp sass` or `gulp` to watch sass changes
1616

17+
1718
## Features Notes
1819

1920
- Additional features supported with [Material Admin Support](https://github.com/briancwald/material_admin_support) module.
@@ -62,4 +63,4 @@ Since this is just a POC, code is not very well organized and needs to be mature
6263
- [x] Easy color swap in SCSS variables (_settings.scss)
6364
- [ ] Better way to handle Materialize CSS overrides
6465
- [ ] Prod deployment packaging (Min, optimize, etc)
65-
- [ ] Code standards + Lint
66+
- [x] Code standards + Lint

css/maps/material_admin.css.map

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

css/material_admin.css

Lines changed: 1333 additions & 1147 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
'use strict';
2-
32
/*global require:true*/
43
/*jshint esversion: 6 */
5-
6-
var gulp = require('gulp');
7-
var sourcemaps = require('gulp-sourcemaps');
8-
var sass = require('gulp-sass');
9-
const jshint = require('gulp-jshint');
10-
const stylish = require('jshint-stylish');
11-
var gulpCopy = require('gulp-copy');
12-
var replace = require('gulp-replace');
13-
var $ = require('gulp-load-plugins')();
14-
var refresh = require('gulp-refresh');
15-
4+
var gulp = require('gulp');
5+
var sourcemaps = require('gulp-sourcemaps');
6+
var sass = require('gulp-sass');
7+
var sassLint = require('gulp-sass-lint');
8+
const jshint = require('gulp-jshint');
9+
const stylish = require('jshint-stylish');
10+
var gulpCopy = require('gulp-copy');
11+
var replace = require('gulp-replace');
12+
var $ = require('gulp-load-plugins')();
13+
var refresh = require('gulp-refresh');
1614
// provide a paht to node modules
1715
var sassPaths = [
1816
'node_modules'
1917
];
20-
2118
// Copy materialize and tablesaw libraries.
2219
gulp.task('libsrc', function() {
2320
gulp.src([
@@ -33,7 +30,6 @@ gulp.task('libsrc', function() {
3330
])
3431
.pipe(gulpCopy('js/lib', { prefix: 3 }));
3532
});
36-
3733
// Rename functions that conflict with jQueryUI; then move to source control folder js/lib
3834
gulp.task('rename', function() {
3935
gulp.src(['js/vendor/materialize.min.js'])
@@ -43,9 +39,13 @@ gulp.task('rename', function() {
4339
.pipe(replace('.tabs(', '.tabs_materialize('))
4440
.pipe(gulp.dest('js/lib'));
4541
});
46-
4742
gulp.task('sass', function() {
48-
return gulp.src(['scss/material_admin.scss'])
43+
return gulp.src(['scss/**/**.scss'])
44+
.pipe(sassLint({
45+
configFile: 'scss/.sass-lint.yml',
46+
}))
47+
.pipe(sassLint.format())
48+
.pipe(sassLint.failOnError())
4949
.pipe(sourcemaps.init())
5050
.pipe(sourcemaps.identityMap())
5151
.pipe($.sass({
@@ -59,14 +59,12 @@ gulp.task('sass', function() {
5959
.pipe(gulp.dest('css'))
6060
.pipe(refresh());
6161
});
62-
6362
gulp.task('lint', function() {
6463
return gulp.src(['./js/*.js', '!./js/vendor.all.js'])
6564
.pipe(jshint())
6665
.pipe(jshint.reporter('jshint-stylish'));
6766
});
68-
6967
gulp.task('default', ['sass'], function() {
70-
refresh.listen();
68+
refresh.listen();
7169
gulp.watch(['scss/**/*.scss'], ['sass']);
7270
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"gulp-refresh": "^1.1.0",
1515
"gulp-replace": "^0.5.4",
1616
"gulp-sass": "^3.1.0",
17+
"gulp-sass-lint": "^1.3.4",
1718
"gulp-sourcemaps": "^2.6.0",
1819
"jshint": "^2.9.4",
1920
"jshint-stylish": "^2.2.1",

scss/.sass-lint.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
options:
2+
formatter: stylish
3+
rules:
4+
# Extends
5+
extends-before-mixins: 1
6+
extends-before-declarations: 1
7+
placeholder-in-extend: 0
8+
9+
# Mixins
10+
mixins-before-declarations: 1
11+
12+
# Line Spacing
13+
one-declaration-per-line: 1
14+
empty-line-between-blocks: 0
15+
single-line-per-selector: 1
16+
17+
# Disallows
18+
no-color-keywords: 1
19+
no-color-literals: 1
20+
no-css-comments: 0
21+
no-debug: 1
22+
no-duplicate-properties:
23+
- 1
24+
-
25+
exclude:
26+
- vertical-align
27+
no-empty-rulesets: 1
28+
no-extends: 0
29+
no-ids: 0
30+
no-important: 0
31+
no-invalid-hex: 1
32+
no-mergeable-selectors: 1
33+
no-misspelled-properties:
34+
- 1
35+
-
36+
'extra-properties':
37+
- 'font-smooth'
38+
no-qualifying-elements:
39+
- 1
40+
-
41+
allow-element-with-attribute: true
42+
allow-element-with-class: true
43+
allow-element-with-id: true
44+
no-trailing-zero: 1
45+
no-transition-all: 1
46+
no-url-protocols: 1
47+
no-vendor-prefixes: 0
48+
no-warn: 1
49+
50+
# Nesting
51+
force-attribute-nesting: 0
52+
force-element-nesting: 0
53+
force-pseudo-nesting: 0
54+
55+
# Name Formats
56+
function-name-format: 1
57+
mixin-name-format: 1
58+
placeholder-name-format: 1
59+
class-name-format: 0
60+
variable-name-format:
61+
- 1
62+
-
63+
allow-leading-underscore: false
64+
65+
# Style Guide
66+
border-zero: 1
67+
brace-style: 1
68+
clean-import-paths: 0
69+
empty-args: 1
70+
hex-length: 1
71+
hex-notation: 1
72+
indentation: 1
73+
leading-zero: 0
74+
nesting-depth: 0
75+
property-sort-order:
76+
- 1
77+
- order: concentric
78+
quotes: 1
79+
shorthand-values: 1
80+
url-quotes: 1
81+
variable-for-property: 1
82+
zero-unit: 1
83+
84+
# Inner Spacing
85+
space-after-comma: 1
86+
space-before-colon: 1
87+
space-after-colon: 1
88+
space-before-brace: 1
89+
space-before-bang: 1
90+
space-after-bang: 1
91+
space-between-parens: 1
92+
93+
# Final Items
94+
trailing-semicolon: 1
95+
final-newline: 1

scss/_color_schema.scss

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,34 @@
55

66
// AVAILABLE COLOR PALETTE VARIABLES
77
// red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, teal, green, light-green, lime, yellow, amber, orange, deep-orange, brown, grey, blue-grey
8-
98
// $your-colors: (
10-
// "base": #29aae1,
11-
// "lighten-1": #49b7e6,
12-
// "lighten-2": #6fdcff,
13-
// "lighten-3": #69c4ea,
14-
// "lighten-4": #94d5f0,
15-
// "lighten-5": #e5f5fb,
16-
// "darken-1": #24a3dd,
17-
// "darken-2": #1f99d9,
18-
// "darken-3": #1990d5,
19-
// "darken-4": #0f7fcd,
20-
// "accent-1": #fafdff,
21-
// "accent-2": #c7e6ff,
22-
// "accent-3": #94d0ff,
23-
// "accent-4": #7ac4ff
9+
// 'base': #29aae1,
10+
// 'lighten-1': #49b7e6,
11+
// 'lighten-2': #6fdcff,
12+
// 'lighten-3': #69c4ea,
13+
// 'lighten-4': #94d5f0,
14+
// 'lighten-5': #e5f5fb,
15+
// 'darken-1': #24a3dd,
16+
// 'darken-2': #1f99d9,
17+
// 'darken-3': #1990d5,
18+
// 'darken-4': #0f7fcd,
19+
// 'accent-1': #fafdff,
20+
// 'accent-2': #c7e6ff,
21+
// 'accent-3': #94d0ff,
22+
// 'accent-4': #7ac4ff
2423
// );
25-
2624
// $colors: map-merge($colors, (your-colors: $your-colors));
27-
28-
2925
// These represent the Color Palette. SEE _settings.scss for more detailed overrides
3026
// See: http://materializecss.com/color.html
31-
3227
// MAIN
3328
$primary: 'blue';
3429
$secondary: 'materialize-red';
3530
$accent: 'teal';
3631
$action: 'orange';
3732
$utility: 'grey'; // This most likely wont change.
38-
3933
// VARIOUS HELPERS
40-
$black: color("shades", "black");
41-
$white: color("shades", "white");
34+
$black: color('shades', 'black');
35+
$white: color('shades', 'white');
4236
$success-color-base: 'grey';
4337
$error-color-base: 'red';
4438
$warning-color-base: 'yellow';

0 commit comments

Comments
 (0)