diff --git a/.stylelintrc.yml b/.stylelintrc.yml new file mode 100644 index 0000000..be9c9e2 --- /dev/null +++ b/.stylelintrc.yml @@ -0,0 +1,6 @@ +extends: + - stylelint-config-standard + - stylelint-config-sass-guidelines + +rules: + order/declaration-block-properties-alphabetical-order: null diff --git a/gulp/tasks/lint.js b/gulp/tasks/lint.js new file mode 100644 index 0000000..e814ed4 --- /dev/null +++ b/gulp/tasks/lint.js @@ -0,0 +1,26 @@ +const merge = require('merge-stream'); + +module.exports = (gulp, $, config) => { + const toolingGlob = config.entryGlobs.tooling; + const scriptsGlobs = config.watchGlobs.scripts; + const stylesGlobs = config.watchGlobs.styles; + + const task = () => { + const scriptsStream = gulp.src(toolingGlob.concat(scriptsGlobs)) + .pipe($.eslint()) + .pipe($.eslint.format()) + ; + + const stylesStream = gulp.src(stylesGlobs) + .pipe($.stylelint({ + reporters: [ + { formatter: 'string', console: true } + ] + })); + + return merge(scriptsStream, stylesStream); + }; + + task.description = 'Lints script and styles.'; + return task; +}; diff --git a/gulp/tasks/tooling.js b/gulp/tasks/tooling.js deleted file mode 100644 index f422c9b..0000000 --- a/gulp/tasks/tooling.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = (gulp, $, config) => { - const entryGlobs = config.watchGlobs.tooling; - - const task = () => - gulp.src(entryGlobs) - .pipe($.eslint()) - .pipe($.eslint.format()) - ; - - task.description = 'Lints the tooling files.'; - return task; -}; diff --git a/gulpfile.js b/gulpfile.js index 9526492..7aaec13 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -63,8 +63,8 @@ gulp.task('test', gulp.parallel('test:unit')); // Serve the build folder gulp.task('serve', t.getTask('serve')); -// Lints the tooling files. -gulp.task('tooling', t.getTask('tooling')); +// Lints scripts and styles. +gulp.task('lint', t.getTask('lint')); // What happens when just running 'gulp' gulp.task( diff --git a/package.json b/package.json index 28fb4f5..bd8eea1 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build": "NODE_ENV=production gulp build", "test": "gulp test", "test:watch": "npm run test -- --watchAll", + "lint": "gulp lint", "serve": "gulp serve" }, "dependencies": { @@ -44,6 +45,7 @@ "gulp-sass": "^3.1.0", "gulp-sass-glob": "^1.0.8", "gulp-sourcemaps": "^2.4.1", + "gulp-stylelint": "^3.9.0", "gulp-svg-sprite": "^1.3.6", "gulp-sync": "^0.1.4", "jade-inline-file": "^0.1.0", @@ -54,6 +56,8 @@ "merge-stream": "^1.0.1", "pug": "^2.0.0-beta11", "pug-include-glob": "^0.3.2", + "stylelint-config-sass-guidelines": "^2.0.0", + "stylelint-config-standard": "^16.0.0", "uuid": "^3.0.1", "webpack": "^2.2.1", "webpack-stream": "^3.2.0", diff --git a/src/elements/header/spec/.eslintrc.yml b/src/components/header/spec/.eslintrc.yml similarity index 100% rename from src/elements/header/spec/.eslintrc.yml rename to src/components/header/spec/.eslintrc.yml diff --git a/src/elements/header/spec/script.spec.js b/src/components/header/spec/script.spec.js similarity index 100% rename from src/elements/header/spec/script.spec.js rename to src/components/header/spec/script.spec.js diff --git a/src/elements/base/style.scss b/src/elements/base/style.scss index c5ba94e..a95ce47 100644 --- a/src/elements/base/style.scss +++ b/src/elements/base/style.scss @@ -1,11 +1,10 @@ -body, html { +body, +html { margin: 0; padding: 0; - color: $c-white; text-align: center; line-height: 1.5; - background: $c-eigengrau; /** diff --git a/src/elements/card/style.scss b/src/elements/card/style.scss index e6b5668..d79c59d 100644 --- a/src/elements/card/style.scss +++ b/src/elements/card/style.scss @@ -20,16 +20,15 @@ } } - .card-background { display: block; position: absolute; width: 100%; - top: 50%; left: 0; + top: 50%; + left: 0; transform: translate(0, -50%); } - @include breakpoint(mobile) { .card { &--right-mobile { diff --git a/src/elements/layout/style.scss b/src/elements/layout/style.scss index f25fbe4..777c45f 100644 --- a/src/elements/layout/style.scss +++ b/src/elements/layout/style.scss @@ -26,32 +26,30 @@ .l-panorama, .l-square, .l-landscape { - &:before { - content: ""; + &::before { + content: ''; display: block; } } .l-panorama { - &:before { + &::before { padding-top: 50%; } } .l-square { - &:before { + &::before { padding-top: 100%; } } .l-landscape { - &:before { + &::before { padding-top: 75%; } } - - @include breakpoint(mobile) { .l-one-whole-mobile { width: 100%; @@ -70,19 +68,19 @@ } .l-panorama-mobile { - &:before{ + &::before { padding-top: 50%; } } .l-square-mobile { - &:before { + &::before { padding-top: 100%; } } .l-landscape-mobile { - &:before { + &::before { padding-top: 75%; } } @@ -90,7 +88,9 @@ .l-absolute-centered { position: absolute; - top: 50%; left: 10%; right: 10%; + top: 50%; + left: 10%; + right: 10%; max-height: 80%; transform: translate(0, -50%); } diff --git a/src/elements/typography/style.scss b/src/elements/typography/style.scss index f73e37f..946281f 100644 --- a/src/elements/typography/style.scss +++ b/src/elements/typography/style.scss @@ -4,6 +4,7 @@ .t-title { @include base-font; + font-size: 5rem; line-height: 1.25; margin: 0; diff --git a/src/layouts/default/style.scss b/src/layouts/default/style.scss index 92e661e..20ecde2 100644 --- a/src/layouts/default/style.scss +++ b/src/layouts/default/style.scss @@ -1,3 +1,3 @@ -@import "../../materials/**/*.scss"; -@import "../../elements/**/*.scss"; -@import "../../components/**/*.scss"; +@import '../../materials/**/*'; +@import '../../elements/**/*'; +@import '../../components/**/*'; diff --git a/src/materials/breakpoints/style.scss b/src/materials/breakpoints/style.scss index e74e3b6..69f1238 100644 --- a/src/materials/breakpoints/style.scss +++ b/src/materials/breakpoints/style.scss @@ -1,4 +1,4 @@ -@import "sensible/mediaqueries"; +@import 'sensible/mediaqueries'; /** * Define the breakpoints for vendor/sensible/mediaqueries @@ -6,8 +6,8 @@ */ $breakpoints: ( - "mobile" : "only screen and (max-width:740px)", - "tablet" : "only screen and (max-width:1050px)", - "desktop" : "only screen and (min-width:1051px)", - "print" : "print" + 'mobile' : 'only screen and (max-width:740px)', + 'tablet' : 'only screen and (max-width:1050px)', + 'desktop' : 'only screen and (min-width:1051px)', + 'print' : 'print' ); diff --git a/src/materials/colors/style.scss b/src/materials/colors/style.scss index 4ee948a..178c14d 100644 --- a/src/materials/colors/style.scss +++ b/src/materials/colors/style.scss @@ -2,10 +2,10 @@ * Color variables */ -$c-eigengrau: #16161D; -$c-graphite: #666; -$c-silver: #eee; -$c-white: #fff; -$c-red: #E00202; +$c-eigengrau: #16161d; +$c-graphite: #666; +$c-silver: #eee; +$c-white: #fff; +$c-red: #e00202; -$c-cover: rgba(0,0,0,0.5); +$c-cover: rgba(0, 0, 0, 0.5); diff --git a/src/materials/fonts/style.scss b/src/materials/fonts/style.scss index 65ac5a0..c5f6416 100644 --- a/src/materials/fonts/style.scss +++ b/src/materials/fonts/style.scss @@ -1,14 +1,14 @@ /** * Typography settings */ -$base-font-size : 1em; -$base-font-family : sans-serif; -$base-font-weight : 300; -$base-font-style : normal; -$base-line-height : 1.5; +$base-font-size: 1em; +$base-font-family: sans-serif; +$base-font-weight: 300; +$base-font-style: normal; +$base-line-height: 1.5; @mixin base-font() { font-family: $base-font-family; font-weight: $base-font-weight; - font-style : $base-font-style; + font-style: $base-font-style; }