From ffdd6821371a83d25a34ec34f1c9fe9bdec44cb5 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Fri, 14 Jul 2017 07:51:48 +0200 Subject: [PATCH] feature: add sass lint --- .stylelintrc | 3 +++ package.json | 3 +++ src/webui/src/components/Header/header.scss | 1 + src/webui/src/components/Package/package.scss | 7 ++++--- src/webui/src/index.js | 2 +- src/webui/src/styles/global.scss | 11 ++++++++--- src/webui/src/styles/variable.scss | 1 + yarn.lock | Bin 221221 -> 233990 bytes 8 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 000000000..40db42c66 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,3 @@ +{ + "extends": "stylelint-config-standard" +} diff --git a/package.json b/package.json index 30b1fb3ed..af98f2bad 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,8 @@ "source-map-loader": "0.2.1", "style-loader": "0.18.2", "styled-components": "2.1.1", + "stylelint": "7.13.0", + "stylelint-config-standard": "16.0.0", "url-loader": "0.5.8", "webpack": "3.2.0", "webpack-dev-server": "2.5.0" @@ -121,6 +123,7 @@ "test-travis": "npm run test:coverage", "test-only": "mocha ./test/functional ./test/unit", "lint": "eslint .", + "lint:css": "stylelint 'src/**/*.scss' --syntax scss", "build-docker": "docker build -t verdaccio .", "build:webui": "rimraf static/* && webpack --config src/webui/scripts/webpack.prod.config.babel.js", "dev:webui": "babel-node src/webui/scripts/dev.server.js", diff --git a/src/webui/src/components/Header/header.scss b/src/webui/src/components/Header/header.scss index 0e92caa8a..4de404318 100644 --- a/src/webui/src/components/Header/header.scss +++ b/src/webui/src/components/Header/header.scss @@ -11,6 +11,7 @@ .header { .headerWrap { display: flex; align-items: center; + @include container-size(); } diff --git a/src/webui/src/components/Package/package.scss b/src/webui/src/components/Package/package.scss index e21eeb3eb..fd9265da1 100644 --- a/src/webui/src/components/Package/package.scss +++ b/src/webui/src/components/Package/package.scss @@ -12,7 +12,7 @@ .package { font-size: 18px; color: $primary-color; - :global{ + :global { .el-tag { margin-left: 5px; } @@ -39,7 +39,7 @@ .package { filter: blur(5px); } - &:before { + &::before { display: block; position: absolute; top: 0; @@ -49,7 +49,8 @@ .package { background: rgba(255, 255, 255, 0.7); content: ''; } - &:after { + + &::after { display: block; position: absolute; top: 50%; diff --git a/src/webui/src/index.js b/src/webui/src/index.js index 6867376b1..76b24d453 100644 --- a/src/webui/src/index.js +++ b/src/webui/src/index.js @@ -20,7 +20,7 @@ let renderApp = (Component) => { renderApp(App); if (module.hot) { - module.hot.accept('./App', () => { + module.hot.accept('./app', () => { renderApp(App); }); } diff --git a/src/webui/src/styles/global.scss b/src/webui/src/styles/global.scss index ac1b81ebf..2deb15339 100644 --- a/src/webui/src/styles/global.scss +++ b/src/webui/src/styles/global.scss @@ -1,12 +1,17 @@ @import "variable"; +body { + font-family: $font; +} + :global { .container { margin-top: $space-lg; + @include container-size(); - .el-loading-spinner { - margin-top: 0 !important; - } + .el-loading-spinner { + margin-top: 0 !important; + } } } diff --git a/src/webui/src/styles/variable.scss b/src/webui/src/styles/variable.scss index 0dab39dfc..22463eeb4 100644 --- a/src/webui/src/styles/variable.scss +++ b/src/webui/src/styles/variable.scss @@ -8,6 +8,7 @@ @mixin container-size { } $space-lg: 30px; +$font: "'Source Sans Pro', 'Lucida Grande', sans-serif"; /* Colors */ $primary-color: #de4136; diff --git a/yarn.lock b/yarn.lock index afc80bb3257cea22bb8b5368e9481b560cd522f8..d166511fc3e0bd043768b299d0e7712f40ff1f3b 100644 GIT binary patch delta 8181 zcma)BeT*FCdDqO`+2^&f&-U4O{=&<}KzhDC&-*c7Jp*T(;y_CHa+5Yj#_!C$b6$Jz z_Po1iY#??L3EBXS8>aQ!7Ezff38kSJa?ov6Ris3!5UCQ3nzkZUffA{-N=b=mK{P;r z@67Ic?|i7${c$_b%)IaOKA*qmH{bm3CHH+}a=X#?bc36TTo6|;y95VaGLnUk0=cinMBg(PV6NtBx={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