diff --git a/.sass-lint.yml b/.sass-lint.yml new file mode 100644 index 000000000..dc9d9d619 --- /dev/null +++ b/.sass-lint.yml @@ -0,0 +1,15 @@ +rules: + final-newline: 2 + indentation: + - 2 + - + size: 4 + property-sort-order: + - 1 + - + order: concentric + quotes: + - 2 + - + style: double + no-css-comments: 0 diff --git a/Makefile b/Makefile index 989b10812..5a80e1cde 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ ESLINT=./node_modules/.bin/eslint +SASSLINT=./node_modules/.bin/sass-lint -v NODE=node WATCH=./node_modules/.bin/watch WEBPACK=./node_modules/.bin/webpack @@ -52,6 +53,9 @@ lint: $(ESLINT) ./src/mixins/*.jsx $(ESLINT) ./src/views/**/*.jsx $(ESLINT) ./src/components/**/*.jsx + $(SASSLINT) ./src/*.scss + $(SASSLINT) ./src/views/**/*.scss + $(SASSLINT) ./src/components/**/*.scss # ------------------------------------ diff --git a/package.json b/package.json index 59c4b5396..87190ca56 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "react-onclickoutside": "0.3.1", "react-slick": "0.7.0", "routes-to-nginx-conf": "0.0.4", + "sass-lint": "1.2.0", "sass-loader": "2.0.1", "slick-carousel": "1.5.8", "style-loader": "0.12.3", diff --git a/src/components/avatar/avatar.scss b/src/components/avatar/avatar.scss index 5e0e54e2e..cb9dd541e 100644 --- a/src/components/avatar/avatar.scss +++ b/src/components/avatar/avatar.scss @@ -1,3 +1,3 @@ .avatar { border: 1px solid #ccc; -} \ No newline at end of file +} diff --git a/src/components/forms/button.scss b/src/components/forms/button.scss index d33c07b58..e89faca2f 100644 --- a/src/components/forms/button.scss +++ b/src/components/forms/button.scss @@ -24,4 +24,4 @@ &:active { box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.25); } -} \ No newline at end of file +} diff --git a/src/components/forms/input.scss b/src/components/forms/input.scss index 8bdf29e23..7962d9749 100644 --- a/src/components/forms/input.scss +++ b/src/components/forms/input.scss @@ -25,4 +25,3 @@ background-color: #eafdea; } } - diff --git a/src/components/login/login.scss b/src/components/login/login.scss index 060bd6849..b5995a49d 100644 --- a/src/components/login/login.scss +++ b/src/components/login/login.scss @@ -17,4 +17,4 @@ a:hover { background-color: transparent !important; } -} \ No newline at end of file +} diff --git a/src/components/modal/modal.scss b/src/components/modal/modal.scss index 7f1bfa4b5..cdc56994f 100644 --- a/src/components/modal/modal.scss +++ b/src/components/modal/modal.scss @@ -1,30 +1,30 @@ /* Copied from the un-styleable react-modal */ .ReactModal__Overlay { - background-color: rgba(0, 0, 0, 0.75); - z-index: 100; + background-color: rgba(0, 0, 0, 0.75); + z-index: 100; } .ReactModal__Content { - position: absolute; - top: 40px; - left: 40px; - right: 40px; - bottom: 40px; - background: #fff; - overflow: visible; - -webkit-overflow-scrolling: touch; - border-radius: 6px; - outline: none; - padding: 20px; + position: absolute; + top: 40px; + left: 40px; + right: 40px; + bottom: 40px; + background: #fff; + overflow: visible; + -webkit-overflow-scrolling: touch; + border-radius: 6px; + outline: none; + padding: 20px; } @media (max-width: 768px) { - .ReactModal__Content { - top: 10px; - left: 10px; - right: 10px; - bottom: 10px; - padding: 10px; - } + .ReactModal__Content { + top: 10px; + left: 10px; + right: 10px; + bottom: 10px; + padding: 10px; + } } .modal-close { diff --git a/src/components/navigation/dropdown.scss b/src/components/navigation/dropdown.scss index fadf604c9..a5e8201e3 100644 --- a/src/components/navigation/dropdown.scss +++ b/src/components/navigation/dropdown.scss @@ -1,4 +1,4 @@ -@import 'colors'; +@import "colors"; .dropdown { position: absolute; @@ -49,8 +49,8 @@ padding: 0 10px; &:hover { - background-color: $active-background-color; - text-decoration: none; + background-color: $active-background-color; + text-decoration: none; } } } @@ -68,7 +68,7 @@ height: $arrow-border-width; width: $arrow-border-width; - content: ''; + content: ""; transform: rotate(45deg); background-color: $base-background-color; diff --git a/src/components/navigation/navigation.scss b/src/components/navigation/navigation.scss index 64c3b075b..308ef8b48 100644 --- a/src/components/navigation/navigation.scss +++ b/src/components/navigation/navigation.scss @@ -1,4 +1,4 @@ -@import 'colors'; +@import "colors"; #navigation { position: fixed; @@ -40,15 +40,15 @@ margin: 0px 6px 0 0; border: none; - background-image: url('/images/logo_sm.png'); + background-image: url("/images/logo_sm.png"); background-repeat: no-repeat; background-position: center center; background-size: 95%; transition: .15s ease all; &:hover { - background-size: 100%; - transition: .15s ease all; + background-size: 100%; + transition: .15s ease all; } } } @@ -97,7 +97,7 @@ background-color: transparent; - background-image: url('/images/nav-search-glass.png'); + background-image: url("/images/nav-search-glass.png"); background-size: 14px 14px; background-repeat: no-repeat; background-position: center center; @@ -162,13 +162,13 @@ .messages { > a { - background-image: url('/images/nav-notifications.png'); + background-image: url("/images/nav-notifications.png"); } } .mystuff { > a { - background-image: url('/images/mystuff.png'); + background-image: url("/images/mystuff.png"); } } @@ -178,9 +178,9 @@ .account-nav { .userInfo { - padding-top: 11px; - padding-bottom: 6px; - } + padding-top: 11px; + padding-bottom: 6px; + } > a { font-weight: normal; @@ -201,7 +201,7 @@ display: inline-block; vertical-align: middle; - background-image: url('/images/dropdown.png'); + background-image: url("/images/dropdown.png"); background-size: 50%; background-repeat: no-repeat; background-position: center center;