From 4b19e76fffc772f726bd9bef16b5ce30ed7d1650 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Mar 2016 11:12:40 -0500 Subject: [PATCH] feature(package) add stylelint --- .stylelintrc | 13 +++++++++++++ css/config.css | 12 ++++++------ css/icons.css | 24 ++++++++++++------------ css/nojs.css | 2 +- css/query.css | 20 +++++++++++--------- css/reset.css | 17 +++++++++-------- css/style.css | 39 +++++++++++++++++++++------------------ css/urls.css | 45 ++++++++++++++++++++++++--------------------- css/view.css | 6 +++--- package.json | 3 +++ 10 files changed, 103 insertions(+), 78 deletions(-) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 00000000..cced9dc1 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,13 @@ +extends: stylelint-config-standard +rules: + indentation: 4 + rule-trailing-semicolon: null + declaration-colon-space-before: null + selector-list-comma-newline-after: null + comment-empty-line-before: null + number-leading-zero: null + number-no-trailing-zeros: null + string-quotes: single + function-url-quotes: none + no-eol-whitespace: null + diff --git a/css/config.css b/css/config.css index a8a5dd67..aaa28fb7 100644 --- a/css/config.css +++ b/css/config.css @@ -16,8 +16,8 @@ padding: 0 12px; font-size: 16px; line-height: 1.5; - color: #555555; - border: 1px solid #cccccc; + color: #555; + border: 1px solid #ccc; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); @@ -43,19 +43,19 @@ } .config .form-control:-moz-placeholder { - color: #999999; + color: #999; } .config .form-control::-moz-placeholder { - color: #999999; + color: #999; } .config .form-control:-ms-input-placeholder { - color: #999999; + color: #999; } .config .form-control::-webkit-input-placeholder { - color: #999999; + color: #999; } .config .list { diff --git a/css/icons.css b/css/icons.css index 751b1b75..199cdd6f 100644 --- a/css/icons.css +++ b/css/icons.css @@ -1,59 +1,59 @@ -.icon-help:before { +.icon-help::before { font-family : 'Fontello'; content : '\e801 '; } -.icon-rename:before { +.icon-rename::before { font-family : 'Fontello'; content : '\e802 '; } -.icon-view:before { +.icon-view::before { font-family : 'Fontello'; content : '\e803 '; } -.icon-edit:before { +.icon-edit::before { font-family : 'Fontello'; content : '\e804 '; } -.icon-copy:before { +.icon-copy::before { font-family : 'Fontello'; content : '\e805 '; } -.icon-move:before { +.icon-move::before { font-family : 'Fontello'; content : '\e806 '; } -.icon-directory:before { +.icon-directory::before { font-family : 'Fontello'; content : '\e807 '; } -.icon-delete:before { +.icon-delete::before { font-family : 'Fontello'; content : '\e808 '; } -.icon-menu:before { +.icon-menu::before { font-family : 'Fontello'; content : '\e809 '; } -.icon-config:before { +.icon-config::before { font-family : 'Fontello'; content : '\e80a '; } -.icon-console:before { +.icon-console::before { font-family : 'Fontello'; content : '\e80b '; } -.icon-contact:before { +.icon-contact::before { font-family : 'Fontello'; content : '\e80c '; } diff --git a/css/nojs.css b/css/nojs.css index 2544e8b6..4a165c4f 100644 --- a/css/nojs.css +++ b/css/nojs.css @@ -1,4 +1,4 @@ - .path-icon, .keyspanel { +.path-icon, .keyspanel { display: none; } diff --git a/css/query.css b/css/query.css index 584373b9..98a5ca1b 100644 --- a/css/query.css +++ b/css/query.css @@ -101,7 +101,7 @@ background-color: rgba(49, 123, 249, .40); color: white; } - /* делаем иконки под курсом белыми*/ + /* делаем иконки под курсом белыми */ .current-file a { color: white; } @@ -109,7 +109,7 @@ color: white; } - /* меняем иконки на шрифтовые*/ + /* меняем иконки на шрифтовые */ .mini-icon { color : rgb(246, 224, 124); color : rgba(246, 224, 124, 0.56); @@ -131,33 +131,35 @@ .directory::before { content: '\e807'; } - .text-file::before { + + .text-file::before { color: rgb(26, 224, 124); color: rgba(26, 224, 124, 0.56); content: '\e80d'; } + .text-file { - background-image:none; + background-image: none; } - /* убираем заголовок*/ + /* убираем заголовок */ .fm-header { - display:none; + display: none; } /* выводим заголовки рядом с полями */ - .cmd-button { width: 20%; } } + @media only screen and (min-width: 601px) and (max-width: 785px) { .cmd-button { width: 13%; } } -@media only screen and (min-width:786px) and (max-width: 1155px) { +@media only screen and (min-width: 786px) and (max-width: 1155px) { .cmd-button { width: 10%; } @@ -165,7 +167,7 @@ @media only screen and (max-width: 1155px) { .panel { - width:97%; + width: 97%; } /* если правая панель не помещаеться - прячем её */ .panel-right, .cmd-button#f5, .cmd-button#f6 { diff --git a/css/reset.css b/css/reset.css index a7577d4a..05084f43 100644 --- a/css/reset.css +++ b/css/reset.css @@ -7,11 +7,11 @@ * 2. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g */ -html{ +html { color: #222; } -body { +body { margin: 0; } @@ -20,16 +20,17 @@ body { * These selection declarations have to be separate * Also: hot pink! (or customize the background color to match your design) */ -/* - ::selection { background: #fe57a1; color: #fff; text-shadow: none; } -*/ - /* ============================================================================= Links ========================================================================== */ -a:focus { outline: thin dotted; } +a:focus { + outline: thin dotted; +} /* Improve readability when focused and hovered in all browsers: h5bp.com/h */ -a:hover, a:active { outline: 0; } +a:hover, +a:active { + outline: 0; +} diff --git a/css/style.css b/css/style.css index 74fb3749..3eb4b872 100644 --- a/css/style.css +++ b/css/style.css @@ -10,7 +10,7 @@ body { } body, pre, code { - font-family : "Droid Sans Mono", "Ubuntu Mono", "Consolas", monospace; + font-family : 'Droid Sans Mono', 'Ubuntu Mono', 'Consolas', monospace; font-size : 16px; } @@ -19,7 +19,7 @@ body, pre, code { } .fm, .keyspanel { - cursor : default; + cursor : default; -webkit-user-select : none; -moz-user-select : none; -ms-user-select : none; @@ -37,8 +37,8 @@ body, pre, code { .panel, .cmd-button { border: 1.5px solid; - border-color: rgb(49,123,249); - border-color: rgba(49,123,249, 0.4); + border-color: rgb(49, 123, 249); + border-color: rgba(49, 123, 249, 0.4); } .icon { @@ -85,7 +85,7 @@ body, pre, code { bottom : 5px; left : 16px; font-size : 10px; - color : rgb(49,123,249); + color : rgb(49, 123, 249); content : attr(data-progress); } @@ -105,7 +105,7 @@ body, pre, code { .cmd-button:active { color: white; - background-color: rgb(49,123,249); + background-color: rgb(49, 123, 249); transition: ease 0.1s; } @@ -120,7 +120,7 @@ body, pre, code { .mini-icon { position: relative; top: 2px; - /* отступ перед картинкой + /* отступ перед картинкой * для нормального отображения * рамки */ @@ -136,12 +136,13 @@ body, pre, code { height: 90%; margin: 26px auto 0 auto; } + .fm-header { font-weight: bold; } .panel-left { - float:left; + float: left; } .current-file { @@ -153,12 +154,13 @@ body, pre, code { } .selected-file, .selected-file .name > a { - color: rgb(254,159,224); + color: rgb(254, 159, 224); } .panel-right { - float:right; + float: right; } + .panel { width: 46%; height: 97%; @@ -171,7 +173,7 @@ body, pre, code { } .keyspanel { - text-align: center; + text-align: center; } .name { @@ -184,8 +186,8 @@ body, pre, code { } .size { - float:left; - width:12%; + float: left; + width: 12%; margin-right: 27px; text-align: right; } @@ -207,8 +209,8 @@ body, pre, code { } .mode { - float: right; - width: 18%; + float: right; + width: 18%; } .reduce-text { @@ -230,9 +232,10 @@ body, pre, code { } a { - text-decoration:none; + text-decoration: none; } + a:hover, a:active { - color : #06e; - text-decoration:none; + color: #06e; + text-decoration: none; } diff --git a/css/urls.css b/css/urls.css index 74bfc5c5..291b82b6 100644 --- a/css/urls.css +++ b/css/urls.css @@ -4,38 +4,41 @@ /* http://fontello.com/ */ @font-face { - font-family: 'Fontello'; - src: url("../font/fontello.eot"); - src: url("../font/fontello.eot?#iefix") format('embedded-opentype'), - url("../font/fontello.woff2") format('woff2'), - url("../font/fontello.woff") format('woff'), - url("../font/fontello.ttf") format('truetype'), - url("../font/fontello.svg#cloudcmd") format('svg'); - font-weight: normal; - font-style: normal; + font-family: 'Fontello'; + src: url(../font/fontello.eot); + src: + url(../font/fontello.eot?#iefix) format('embedded-opentype'), + url(../font/fontello.woff2) format('woff2'), + url(../font/fontello.woff) format('woff'), + url(../font/fontello.ttf) format('truetype'), + url(../font/fontello.svg#cloudcmd) format('svg'); + font-weight: normal; + font-style: normal; } @font-face { - font-family : 'Droid Sans Mono'; + font-family : 'Droid Sans Mono'; src : url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJTwtzT4qNq-faudv5qbO9-U.eot); - src : local('Droid Sans Mono'), - local('DroidSansMono'), - url(../font/DroidSansMono.eot) format('embedded-opentype'), - url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJTwtzT4qNq-faudv5qbO9-U.eot?#iefix) format('embedded-opentype'), - url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJTwtzT4qNq-faudv5qbO9-U.eot) format('embedded-opentype'), - url(../font/DroidSansMono.woff2) format('woff2'), - url(../font/DroidSansMono.woff) format('woff'), - url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format('woff'), - local('Consolas'); + src : + local('Droid Sans Mono'), + local('DroidSansMono'), + url(../font/DroidSansMono.eot) format('embedded-opentype'), + url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJTwtzT4qNq-faudv5qbO9-U.eot?#iefix) format('embedded-opentype'), + url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJTwtzT4qNq-faudv5qbO9-U.eot) format('embedded-opentype'), + url(../font/DroidSansMono.woff2) format('woff2'), + url(../font/DroidSansMono.woff) format('woff'), + url(https://themes.googleusercontent.com/static/fonts/droidsansmono/v5/ns-m2xQYezAtqh7ai59hJUYuTAAIFFn5GTWtryCmBQ4.woff) format('woff'), + local('Consolas'); font-style : normal; font-weight : 400; } .directory { - background-image:url('../img/dir.png'); + background-image: url(../img/dir.png); } + .text-file { - background-image:url('../img/txt.png'); + background-image: url(../img/txt.png); } .loading-svg { diff --git a/css/view.css b/css/view.css index b777c07e..0ceedbf9 100644 --- a/css/view.css +++ b/css/view.css @@ -1,6 +1,6 @@ .view { font-size: 16px; - white-space :pre; + white-space: pre; outline: 0; } @@ -11,12 +11,12 @@ .view-overlay { display : block; - background : rgb(255, 255, 255); + background : rgb(255, 255, 255); background : rgba(255, 255, 255, 0.1); } .fancybox-wrap { - /* + /* * when search element with * document.elementFromPoint */ diff --git a/package.json b/package.json index d459dd76..13f0912a 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "start": "node bin/cloudcmd.js", "codestyle": "npm-run-all --parallel lint:* jscs spell", "lint:css": "recess css/*.css", + "lint:style": "stylelint css/*.css", "lint:js": "jshint $npm_package_config_dirs", "jscs": "jscs --esnext $npm_package_config_dirs", "test": "tape test/**/*.js", @@ -97,6 +98,8 @@ "place": "^1.1.4", "recess": "^1.1.9", "shortdate": "^1.0.1", + "stylelint": "^4.4.0", + "stylelint-config-standard": "^3.0.0", "tape": "^4.4.0", "version-io": "^1.2.5", "yaspeller": "^2.6.0"