Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit 10066c8

Browse files
Adds stylelinting
1 parent 3dd4189 commit 10066c8

File tree

7 files changed

+63
-45
lines changed

7 files changed

+63
-45
lines changed

.stylelintrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "stylelint-config-sass-guidelines",
3+
"rules": {
4+
"indentation": 4,
5+
"no-missing-end-of-source-newline": null
6+
}
7+
}

build/app.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = merge({
5252
*/
5353
settings: {
5454
sourceMaps: true,
55+
styleLint: true,
5556
browserSync: {
5657
host: 'localhost',
5758
port: 3000,

build/rules/sass.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const isdev = require('isdev')
2+
const stylelint = require("stylelint")
23
const autoprefixer = require('autoprefixer')
34

45
const ExtractTextPlugin = require("extract-text-webpack-plugin")

build/webpack.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const webpack = require('webpack')
44
const autoprefixer = require('autoprefixer')
55

66
const CleanWebpackPlugin = require('clean-webpack-plugin')
7+
const StyleLintPlugin = require('stylelint-webpack-plugin')
78
const ExtractTextPlugin = require("extract-text-webpack-plugin")
89
const BrowserSyncPlugin = require("browser-sync-webpack-plugin")
910

@@ -46,6 +47,12 @@ module.exports = {
4647
]
4748
}
4849

50+
if (config.settings.styleLint) {
51+
module.exports.plugins.push(
52+
new StyleLintPlugin()
53+
)
54+
}
55+
4956
if (config.settings.browserSync) {
5057
module.exports.plugins.push(
5158
new BrowserSyncPlugin(config.settings.browserSync)

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"postcss-loader": "^1.3.3",
3030
"sass-loader": "^6.0.3",
3131
"style-loader": "^0.16.1",
32+
"stylelint-config-sass-guidelines": "^2.1.0",
33+
"stylelint-webpack-plugin": "^0.7.0",
3234
"webpack": "^2.3.3",
3335
"webpack-dev-server": "^2.4.4",
3436
"webpack-merge": "^4.1.0"

resources/assets/sass/_settings.scss

+43-43
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ $global-font-size: 100%;
5050
$global-width: rem-calc(1200);
5151
$global-lineheight: 1.5;
5252
$foundation-palette: (
53-
primary: #1779ba,
54-
secondary: #767676,
55-
success: #3adb76,
56-
warning: #ffae00,
57-
alert: #cc4b37,
53+
primary: #1779ba,
54+
secondary: #767676,
55+
success: #3adb76,
56+
warning: #ffae00,
57+
alert: #cc4b37,
5858
);
5959
$light-gray: #e6e6e6;
6060
$medium-gray: #cacaca;
@@ -80,11 +80,11 @@ $print-transparent-backgrounds: true;
8080
// --------------
8181

8282
$breakpoints: (
83-
small: 0,
84-
medium: 640px,
85-
large: 1024px,
86-
xlarge: 1200px,
87-
xxlarge: 1440px,
83+
small: 0,
84+
medium: 640px,
85+
large: 1024px,
86+
xlarge: 1200px,
87+
xxlarge: 1440px,
8888
);
8989
$print-breakpoint: large;
9090
$breakpoint-classes: (small medium large);
@@ -95,8 +95,8 @@ $breakpoint-classes: (small medium large);
9595
$grid-row-width: $global-width;
9696
$grid-column-count: 12;
9797
$grid-column-gutter: (
98-
small: 20px,
99-
medium: 30px,
98+
small: 20px,
99+
medium: 30px,
100100
);
101101
$grid-column-align-edge: true;
102102
$block-grid-max: 8;
@@ -112,22 +112,22 @@ $header-color: inherit;
112112
$header-lineheight: 1.4;
113113
$header-margin-bottom: 0.5rem;
114114
$header-styles: (
115-
small: (
116-
'h1': ('font-size': 24),
117-
'h2': ('font-size': 20),
118-
'h3': ('font-size': 19),
119-
'h4': ('font-size': 18),
120-
'h5': ('font-size': 17),
121-
'h6': ('font-size': 16),
122-
),
123-
medium: (
124-
'h1': ('font-size': 48),
125-
'h2': ('font-size': 40),
126-
'h3': ('font-size': 31),
127-
'h4': ('font-size': 25),
128-
'h5': ('font-size': 20),
129-
'h6': ('font-size': 16),
130-
),
115+
small: (
116+
'h1': ('font-size': 24),
117+
'h2': ('font-size': 20),
118+
'h3': ('font-size': 19),
119+
'h4': ('font-size': 18),
120+
'h5': ('font-size': 17),
121+
'h6': ('font-size': 16),
122+
),
123+
medium: (
124+
'h1': ('font-size': 48),
125+
'h2': ('font-size': 40),
126+
'h3': ('font-size': 31),
127+
'h4': ('font-size': 25),
128+
'h5': ('font-size': 20),
129+
'h6': ('font-size': 16),
130+
),
131131
);
132132
$header-text-rendering: optimizeLegibility;
133133
$small-font-size: 80%;
@@ -249,10 +249,10 @@ $button-color: $white;
249249
$button-color-alt: $black;
250250
$button-radius: $global-radius;
251251
$button-sizes: (
252-
tiny: 0.6rem,
253-
small: 0.75rem,
254-
default: 0.9rem,
255-
large: 1.25rem,
252+
tiny: 0.6rem,
253+
small: 0.75rem,
254+
default: 0.9rem,
255+
large: 1.25rem,
256256
);
257257
$button-palette: $foundation-palette;
258258
$button-opacity-disabled: 0.25;
@@ -299,16 +299,16 @@ $card-margin: $global-margin;
299299

300300
$closebutton-position: right top;
301301
$closebutton-offset-horizontal: (
302-
small: 0.66rem,
303-
medium: 1rem,
302+
small: 0.66rem,
303+
medium: 1rem,
304304
);
305305
$closebutton-offset-vertical: (
306-
small: 0.33em,
307-
medium: 0.5rem,
306+
small: 0.33em,
307+
medium: 0.5rem,
308308
);
309309
$closebutton-size: (
310-
small: 1.5em,
311-
medium: 2em,
310+
small: 1.5em,
311+
medium: 2em,
312312
);
313313
$closebutton-lineheight: 1;
314314
$closebutton-color: $dark-gray;
@@ -333,9 +333,9 @@ $dropdown-font-size: 1rem;
333333
$dropdown-width: 300px;
334334
$dropdown-radius: $global-radius;
335335
$dropdown-sizes: (
336-
tiny: 100px,
337-
small: 200px,
338-
large: 400px,
336+
tiny: 100px,
337+
small: 200px,
338+
large: 400px,
339339
);
340340

341341
// 18. Dropdown Menu
@@ -491,8 +491,8 @@ $progress-radius: $global-radius;
491491

492492
$responsive-embed-margin-bottom: rem-calc(16);
493493
$responsive-embed-ratios: (
494-
default: 4 by 3,
495-
widescreen: 16 by 9,
494+
default: 4 by 3,
495+
widescreen: 16 by 9,
496496
);
497497

498498
// 29. Reveal

resources/assets/sass/app.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Fonts
22

33
// Variables, Mixins and Utilities
4-
@import "variables";
5-
@import "settings";
4+
@import 'settings';
5+
@import 'variables';
66

77
// Theme components

0 commit comments

Comments
 (0)