From 90e5b75575d02eae6491deae730e92157aaca921 Mon Sep 17 00:00:00 2001 From: Nikos Roussos Date: Fri, 10 Feb 2017 15:32:33 +0200 Subject: [PATCH] Add stylelint --- .stylelintrc | 91 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 4 +- network/static/css/app.css | 83 ++++++++++++++++------------------ 3 files changed, 132 insertions(+), 46 deletions(-) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000..3c61608 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,91 @@ +{ + "rules": { + "color-hex-case": "lower", + "color-no-invalid-hex": true, + + "font-family-no-duplicate-names": true, + "font-family-name-quotes": "always-where-recommended", + + "function-calc-no-unspaced-operator": true, + "function-comma-space-after": "always", + "function-comma-space-before": "never", + "function-name-case": "lower", + "function-parentheses-space-inside": "never", + "function-whitespace-after": "always", + "function-url-no-scheme-relative": true, + "function-url-quotes": "always", + + "number-no-trailing-zeros": true, + + "string-no-newline": true, + "string-quotes": "single", + + "length-zero-no-unit": true, + + "unit-case": "lower", + "unit-no-unknown": true, + + "value-keyword-case": lower, + + "value-list-comma-space-after": "always-single-line", + "value-list-comma-space-before": "never", + + "property-case": "lower", + "property-no-unknown": true, + + "keyframe-declaration-no-important": true, + + "declaration-colon-space-after": "always", + "declaration-colon-space-before": "never", + "declaration-no-important": true, + + "declaration-block-trailing-semicolon": "always", + "declaration-block-single-line-max-declarations": 1, + "declaration-block-semicolon-space-before": "never", + "declaration-block-semicolon-newline-after": "always-multi-line", + "declaration-block-no-shorthand-property-overrides": true, + "declaration-block-no-duplicate-properties": true, + + "block-no-empty": true, + "block-closing-brace-empty-line-before": "never", + "block-closing-brace-newline-after": "always", + "block-closing-brace-newline-before": "always-multi-line", + "block-closing-brace-space-before": "always-single-line", + "block-opening-brace-newline-after": "always-multi-line", + "block-opening-brace-space-after": "always-single-line", + "block-opening-brace-space-before": "always", + + "selector-attribute-brackets-space-inside": "never", + "selector-attribute-operator-space-after": "never", + "selector-attribute-operator-space-before": "never", + "selector-combinator-space-after": "always", + "selector-combinator-space-before": "always", + "selector-pseudo-class-no-unknown": true, + "selector-pseudo-element-no-unknown": true, + "selector-pseudo-class-case": "lower", + "selector-pseudo-element-case": "lower", + "selector-type-case": "lower", + "selector-type-no-unknown": true, + "selector-max-empty-lines": 0, + + "rule-empty-line-before": "always-multi-line", + + "media-feature-name-case": "lower", + "media-feature-name-no-unknown": true, + "media-feature-colon-space-after": "always", + "media-feature-colon-space-before": "never", + "media-feature-parentheses-space-inside": "never", + + "comment-no-empty": true, + + "indentation": 4, + "max-nesting-depth": 6, + "no-duplicate-selectors": true, + "no-eol-whitespace": true, + "no-extra-semicolons": true, + "no-unknown-animations": true, + "no-invalid-double-slash-comments": true, + "no-missing-end-of-source-newline": true, + "max-empty-lines": 1 + } +} diff --git a/.travis.yml b/.travis.yml index dfc052a..1c18e9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ language: python +dist: trusty python: - "2.7" install: - pip install -r requirements/dev.txt - - npm install -g jshint + - npm install -g jshint stylelint script: - flake8 . - jshint . - pytest + - stylelint 'network/static/css/*.css' after_success: - coveralls diff --git a/network/static/css/app.css b/network/static/css/app.css index 317959f..149f707 100644 --- a/network/static/css/app.css +++ b/network/static/css/app.css @@ -2,61 +2,56 @@ ==================== */ @font-face { - font-family: 'ClearSans'; + font-family: ClearSans; src: url('../fonts/ClearSans-Regular.eot'); src: url('../fonts/ClearSans-Regular.eot?#iefix') format('embedded-opentype'), - url('../fonts/ClearSans-Regular.woff') format('woff'), - url('../fonts/ClearSans-Regular.ttf') format('truetype'), - url('../fonts/ClearSans-Regular.svg#open_sans') format('svg'); + url('../fonts/ClearSans-Regular.woff') format('woff'), + url('../fonts/ClearSans-Regular.ttf') format('truetype'), + url('../fonts/ClearSans-Regular.svg#open_sans') format('svg'); font-weight: normal; font-style: normal; - } @font-face { - font-family: 'ClearSans'; + font-family: ClearSans; src: url('../fonts/ClearSans-Bold.eot'); src: url('../fonts/ClearSans-Bold.eot?#iefix') format('embedded-opentype'), - url('../fonts/ClearSans-Bold.woff') format('woff'), - url('../fonts/ClearSans-Bold.ttf') format('truetype'), - url('../fonts/ClearSans-Bold.svg#open_sansbold') format('svg'); + url('../fonts/ClearSans-Bold.woff') format('woff'), + url('../fonts/ClearSans-Bold.ttf') format('truetype'), + url('../fonts/ClearSans-Bold.svg#open_sansbold') format('svg'); font-weight: bold; font-style: normal; - } @font-face { - font-family: 'ClearSans'; + font-family: ClearSans; src: url('../fonts/ClearSans-BoldItalic.eot'); src: url('../fonts/ClearSans-BoldItalic.eot?#iefix') format('embedded-opentype'), - url('../fonts/ClearSans-BoldItalic.woff') format('woff'), - url('../fonts/ClearSans-BoldItalic.ttf') format('truetype'), - url('../fonts/ClearSans-BoldItalic.svg#open_sansbold_italic') format('svg'); + url('../fonts/ClearSans-BoldItalic.woff') format('woff'), + url('../fonts/ClearSans-BoldItalic.ttf') format('truetype'), + url('../fonts/ClearSans-BoldItalic.svg#open_sansbold_italic') format('svg'); font-weight: bold; font-style: italic; - } @font-face { - font-family: 'ClearSans'; + font-family: ClearSans; src: url('../fonts/ClearSans-Italic.eot'); src: url('../fonts/ClearSans-Italic.eot?#iefix') format('embedded-opentype'), - url('../fonts/ClearSans-Italic.woff') format('woff'), - url('../fonts/ClearSans-Italic.ttf') format('truetype'), - url('../fonts/ClearSans-Italic.svg#open_sansitalic') format('svg'); + url('../fonts/ClearSans-Italic.woff') format('woff'), + url('../fonts/ClearSans-Italic.ttf') format('truetype'), + url('../fonts/ClearSans-Italic.svg#open_sansitalic') format('svg'); font-weight: normal; font-style: italic; - } - /* Generic ==================== */ body { - font-size:14px; + font-size: 14px; line-height: 1.3; - font-family:'ClearSans'; + font-family: ClearSans; } a:hover { @@ -94,9 +89,8 @@ a:hover { } .error { - margin-top: 40px; + margin-top: 40px auto 0 auto; width: 500px; - margin: auto; text-align: center; } @@ -105,8 +99,8 @@ a:hover { } .form-group { - margin-left: 0px; - margin-right: 0px; + margin-left: 0; + margin-right: 0; } .bottom-details { @@ -127,7 +121,7 @@ a:hover { } .progress { - margin-bottom: 0px; + margin-bottom: 0; } footer { @@ -144,7 +138,7 @@ footer { #map { position: absolute; - top: 0px; + top: 0; width: 100%; height: 450px; } @@ -179,9 +173,9 @@ footer { } .coloredDiv { - height:20px; - width:20px; - float:left; + height: 20px; + width: 20px; + float: left; margin-right: 5px; } @@ -195,7 +189,7 @@ footer { } .stage-notice { - background-color: #D74545; + background-color: #d74545; color: white; padding: 5px; text-align: center; @@ -203,8 +197,8 @@ footer { z-index: 20; width: 100%; position: fixed; - top: 0px; - left: 0px; + top: 0; + left: 0; } .stage-notice a { @@ -230,7 +224,6 @@ code.log p { padding: 5px; } - /* Stations ==================== */ @@ -258,7 +251,6 @@ code.log p { margin-top: 10px; } - /* Observations ==================== */ @@ -277,17 +269,18 @@ code.log p { font-family: sans-serif; font-size: 10px; } + .timeline-label { font-family: sans-serif; font-size: 12px; } #timeline2 .axis { - transform: translate(0px,30px); - -ms-transform: translate(0px,30px); /* IE 9 */ - -webkit-transform: translate(0px,30px); /* Safari and Chrome */ - -o-transform: translate(0px,30px); /* Opera */ - -moz-transform: translate(0px,30px); /* Firefox */ + transform: translate(0, 30px); + -ms-transform: translate(0, 30px); /* IE 9 */ + -webkit-transform: translate(0, 30px); /* Safari and Chrome */ + -o-transform: translate(0, 30px); /* Opera */ + -moz-transform: translate(0, 30px); /* Firefox */ } .playback-time { @@ -316,7 +309,7 @@ code.log p { } #UTCModal .panel-default:last-child { - margin-bottom: 0px; + margin-bottom: 0; } #UTCModal .panel-body { @@ -390,14 +383,14 @@ code.log p { color: #666; } -@media screen and (max-width:835px) { +@media screen and (max-width: 835px) { + .vetting { float: none; margin-top: 5px; } } - /* Satellites ==================== */