From d0e6246e99ccf1b0367569a3d99a110c91b346ce Mon Sep 17 00:00:00 2001 From: mrliptontea Date: Sun, 20 Nov 2016 20:19:51 +0000 Subject: [PATCH] Linting - Update scss_lint rules - Fix linter errors - Add .editorconfig file --- .editorconfig | 9 + .scss-lint.yml | 25 +- src/sass/_variables.scss | 2 + src/sass/application.scss | 1 + src/sass/components/_admin.scss | 35 +- src/sass/components/_buttons.scss | 47 +- src/sass/components/_coderay.scss | 74 ++- src/sass/components/_content.scss | 2 +- src/sass/components/_elements.scss | 152 ++--- src/sass/components/_flash.scss | 16 +- src/sass/components/_forms.scss | 185 +++--- src/sass/components/_gantt.scss | 68 ++- src/sass/components/_gravatar.scss | 7 +- src/sass/components/_icons.scss | 543 ++++++++---------- src/sass/components/_image-base64.scss | 2 +- src/sass/components/_issue.scss | 25 +- src/sass/components/_jquery-ui.scss | 30 +- src/sass/components/_jstoolbar.scss | 55 +- src/sass/components/_list.scss | 69 +-- src/sass/components/_plugins.scss | 4 +- src/sass/components/_simple-list.scss | 2 +- src/sass/components/_tabs.scss | 7 +- src/sass/components/_top.scss | 8 +- src/sass/components/_wiki.scss | 71 ++- src/sass/javascripts/_sidebar-toggler.scss | 10 +- src/sass/mixins/_clearfix.scss | 10 +- src/sass/mixins/_issues.scss | 6 +- src/sass/mixins/_shadows.scss | 8 +- src/sass/plugins/redmine_backlogs/global.scss | 40 +- .../redmine_backlogs/jquery/jquery-ui.scss | 8 +- .../jquery/jquery.multiselect.scss | 3 +- .../redmine_backlogs/master_backlog.scss | 90 ++- .../plugins/redmine_backlogs/taskboard.scss | 36 +- 33 files changed, 776 insertions(+), 874 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d741e40 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/.scss-lint.yml b/.scss-lint.yml index 2dc4634..304b3b7 100644 --- a/.scss-lint.yml +++ b/.scss-lint.yml @@ -18,7 +18,7 @@ linters: enabled: false Comment: - enabled: false + enabled: true DebugStatement: enabled: true @@ -30,8 +30,7 @@ linters: enabled: true ElsePlacement: - enabled: false - style: same_line + enabled: true EmptyLineBetweenBlocks: enabled: true @@ -94,6 +93,9 @@ linters: enabled: true extra_properties: [] + PseudoElement: + enabled: true + QualifyingElement: enabled: false @@ -124,6 +126,12 @@ linters: SpaceAfterPropertyName: enabled: true + SpaceAfterVariableName: + enabled: true + + SpaceAroundOperator: + enabled: true + SpaceBeforeBrace: enabled: true style: space @@ -140,8 +148,14 @@ linters: TrailingSemicolon: enabled: true + TrailingWhitespace: + enabled: true + TrailingZero: - enabled: false + enabled: true + + TransitionAll: + enabled: true UnnecessaryMantissa: enabled: true @@ -154,3 +168,6 @@ linters: UrlQuotes: enabled: true + + ZeroUnit: + enabled: true diff --git a/src/sass/_variables.scss b/src/sass/_variables.scss index 075b826..b73bfd6 100644 --- a/src/sass/_variables.scss +++ b/src/sass/_variables.scss @@ -248,6 +248,7 @@ $diff-in-bg-light: rgba($diff-in-bg, .3) !default; //== Journal changes // + $journal-old-value-color: #430 !default; $journal-old-value-bg: rgba(#ffeaaa, .3) !default; $journal-new-value-color: #350 !default; @@ -481,6 +482,7 @@ $issue-attribute-padding-h: 5px !default; //== Speech "bubbles" // + $bubble-gravatar-size: 24px !default; $bubble-gravatar-space: 12px !default; $bubble-padding-vertical: 8px !default; diff --git a/src/sass/application.scss b/src/sass/application.scss index cbda3a8..83dfdbd 100644 --- a/src/sass/application.scss +++ b/src/sass/application.scss @@ -4,6 +4,7 @@ @import "lib/normalize"; @import "lib/font-awesome"; + //== Redmine's core elements // diff --git a/src/sass/components/_admin.scss b/src/sass/components/_admin.scss index 8b5c676..d2815fe 100644 --- a/src/sass/components/_admin.scss +++ b/src/sass/components/_admin.scss @@ -32,9 +32,8 @@ } -/** - * Groups - */ +//== Groups +// table.members, table.memberships { @@ -44,9 +43,8 @@ table.memberships { } -/** - * Permissions - */ +//== Permissions +// table.permissions { td.role { @@ -58,9 +56,8 @@ table.permissions { } -/** - * Workflows - */ +//== Workflows +// table.transitions { td.enabled { @@ -88,9 +85,8 @@ table.fields_permissions { } -/** - * Enumerations - */ +//== Enumerations +// .controller-enumerations.action-index { #content { @@ -106,18 +102,16 @@ table.fields_permissions { } -/** - * Settings labels - */ +//== Settings labels +// fieldset.settings label { display: block; } -/** - * Settings -> Notifications - */ +//== Settings -> Notifications +// fieldset#notified_events { .parent { @@ -126,9 +120,8 @@ fieldset#notified_events { } -/** - * Settings -> Repositories - */ +//== Settings -> Repositories +// .settings.enabled_scm { table { diff --git a/src/sass/components/_buttons.scss b/src/sass/components/_buttons.scss index 3db6230..f430ad2 100644 --- a/src/sass/components/_buttons.scss +++ b/src/sass/components/_buttons.scss @@ -37,9 +37,8 @@ button { } -/** - * Form buttons layout - */ +//== Form buttons layout +// form { input[type="submit"] { @@ -51,26 +50,25 @@ form { + a { margin-right: 5px; - } - + a + a { - margin-left: 5px; + + a { + margin-left: 5px; + } } } } -/** - * Repository's 'View differences' button - */ +//== Repository's 'View differences' button +// + form[action*="repository/diff"] { margin-bottom: $line-height-computed / 2; } -/** - * Forum and news message form buttons layout - */ +//== Forum and news message form buttons layout +// #message-form, #news-form { @@ -83,9 +81,8 @@ form[action*="repository/diff"] { } -/** - * Button links - */ +//== Button links +// p.buttons, .other-formats > span, @@ -126,18 +123,16 @@ p.buttons, } -/** - * Action buttons group - */ +//== Action buttons group +// p.buttons { margin-bottom: $line-height-computed; } -/** - * Export actions - */ +//== Export actions +// .other-formats { margin: $line-height-computed 0 0; @@ -151,9 +146,8 @@ p.buttons { } -/** - * Query builder buttons - */ +//== Query builder buttons +// .query-columns { select { @@ -175,9 +169,8 @@ p.buttons { } -/** - * Button for toggling multiselect (in filters) - */ +//== Button for toggling multiselect (in filters) +// a[data-expands], .toggle-multiselect { diff --git a/src/sass/components/_coderay.scss b/src/sass/components/_coderay.scss index 42b24ee..1250d96 100644 --- a/src/sass/components/_coderay.scss +++ b/src/sass/components/_coderay.scss @@ -302,36 +302,13 @@ .insert { background: hsla(120, 100%, 50%, .12); - } - .delete { - background: hsla(0, 100%, 50%, .12); - } - - .change { - background: #007; - color: #bbf; - } - - .head { - background: #505; - color: #f8f; - - .filename { - color: #fff; + .insert { + background: transparent; + color: #0c0; + font-weight: $font-weight-bold; } - } - .delete .eyecatcher { - margin: -1px; - border: 1px solid hsla(0, 100%, 45%, .5); - border-bottom: 0 none; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - background-color: hsla(0, 100%, 50%, .2); - } - - .insert { .eyecatcher { margin: -1px; border: 1px solid hsla(120, 100%, 25%, .5); @@ -340,25 +317,46 @@ border-bottom-right-radius: 5px; background-color: hsla(120, 100%, 50%, .2); } + } - .insert { + .delete { + background: hsla(0, 100%, 50%, .12); + + .delete { background: transparent; - color: #0c0; + color: #c00; font-weight: $font-weight-bold; } + + .eyecatcher { + margin: -1px; + border: 1px solid hsla(0, 100%, 45%, .5); + border-bottom: 0 none; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + background-color: hsla(0, 100%, 50%, .2); + } } - .delete .delete { - background: transparent; - color: #c00; - font-weight: $font-weight-bold; + .change { + background: #007; + color: #bbf; + + .change { + color: #88f; + } } - .change .change { - color: #88f; - } + .head { + background: #505; + color: #f8f; - .head .head { - color: #f4f; + .head { + color: #f4f; + } + + .filename { + color: #fff; + } } } diff --git a/src/sass/components/_content.scss b/src/sass/components/_content.scss index a35c0fb..b091324 100644 --- a/src/sass/components/_content.scss +++ b/src/sass/components/_content.scss @@ -20,10 +20,10 @@ @if $flexbox-layout { // scss-lint:disable VendorPrefix $side-space: $sidebar-width + $padding-side * 2; - width: calc(100% - #{$side-space}); -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; + width: calc(100% - #{$side-space}); } @else { overflow: hidden; } diff --git a/src/sass/components/_elements.scss b/src/sass/components/_elements.scss index 55a07d1..b66edb0 100644 --- a/src/sass/components/_elements.scss +++ b/src/sass/components/_elements.scss @@ -3,9 +3,8 @@ // -------------------------------------------------- -/** - * Collapsible - */ +//== Collapsible +// a.collapsible, .collapsible > legend { @@ -17,7 +16,7 @@ a.collapsible, color: $link-hover-color; } - &:before { + &::before { display: inline-block; position: relative; top: -1px; @@ -39,7 +38,7 @@ a.collapsible, a.collapsible.collapsed, .collapsible.collapsed > legend { - &:before { + &::before { @include rotate(-90deg); } } @@ -73,18 +72,16 @@ a.collapsible.collapsed, } -/** - * Elements with context menus (doesn't really work on Windows) - */ +//== Elements with context menus (doesn't really work on Windows) +// .hascontextmenu { cursor: context-menu; } -/** - * Actions for block - */ +//== Actions for block +// .contextual { padding-left: $padding-base-vertical; @@ -106,9 +103,8 @@ a.collapsible.collapsed, } -/** - * Accessibility specific styles - */ +//== Accessibility specific styles +// .hidden-for-sighted { position: absolute; @@ -120,9 +116,8 @@ a.collapsible.collapsed, } -/** - * Responsive autoscroll - */ +//== Responsive autoscroll +// .autoscroll { overflow-x: auto; @@ -130,9 +125,8 @@ a.collapsible.collapsed, } -/** - * Container - */ +//== Container +// .box { margin-bottom: $line-height-computed; @@ -161,9 +155,8 @@ a.collapsible.collapsed, } -/** - * Column form layout - */ +//== Column form layout +// .splitcontent { @extend %clearfix; @@ -186,9 +179,8 @@ a.collapsible.collapsed, } -/** - * Watchers selection list - */ +//== Watchers selection list +// #users_for_watcher { height: 200px; @@ -201,9 +193,8 @@ a.collapsible.collapsed, } -/** - * Watchers list - */ +//== Watchers list +// #watchers { select { @@ -250,9 +241,8 @@ a.collapsible.collapsed, } -/** - * Subtitle paragraph (can be seen on activity list) - */ +//== Subtitle paragraph (can be seen on activity list) +// p.subtitle { margin-top: ($line-height-computed / -2); @@ -261,18 +251,8 @@ p.subtitle { } -/** - * Breadcrumbs (can be seen in time entries report) - * No need to style them, but let this selector be here. - */ - -// p.breadcrumb { -// } - - -/** - * My page layout - */ +//== My page layout +// #block-form { display: inline; @@ -335,9 +315,9 @@ a.close-icon { } -/** - * Resetting font for SCM (repository files) - */ +//== Resetting font for SCM (repository files) +// + #content table.filecontent { width: 100%; background: $body-bg; @@ -410,9 +390,8 @@ a.close-icon { } -/** - * Projects list - */ +//== Projects list +// ul.projects { padding-left: $padding-side; @@ -466,9 +445,8 @@ ul.projects { } -/** - * Time report - */ +//== Time report +// #time-report { th { @@ -513,9 +491,8 @@ ul.projects { } -/** - * Version issue list and page layout - */ +//== Version issue list and page layout +// div#roadmap { .related-issues { @@ -569,9 +546,8 @@ div#version-summary { } -/** - * Add form bottom space - */ +//== Add form bottom space +// #new_document, #add-message, @@ -581,9 +557,8 @@ div#version-summary { } -/** - * Ajax indicator - */ +//== Ajax indicator +// #ajax-indicator { position: fixed; @@ -611,9 +586,8 @@ div#version-summary { } -/** - * Boards (forum) - */ +//== Boards (forum) +// tr.message { &.locked { @@ -662,9 +636,8 @@ div.table-list.boards { } -/** - * Topic page - */ +//== Topic page +// .controller-messages.action-show { h2 { @@ -727,8 +700,8 @@ div.table-list.boards { > h4 { position: relative; - &:before, - &:after { + &::before, + &::after { display: block; position: absolute; top: 9px; @@ -742,14 +715,14 @@ div.table-list.boards { pointer-events: none; } - &:after { + &::after { margin-top: 1px; margin-left: 2px; border-width: 6px; border-right-color: $panel-bg; } - &:before { + &::before { border-width: 7px; border-right-color: $panel-border; } @@ -769,9 +742,9 @@ div.table-list.boards { } -/** - * News - */ +//== News +// + .news-article { margin-bottom: $line-height-computed; @@ -792,9 +765,8 @@ div.table-list.boards { } -/** - * News comments - */ +//== News comments +// #comments { > h4 { @@ -812,9 +784,8 @@ div.table-list.boards { } -/** - * Diff - */ +//== Diff +// .text-diff { margin-bottom: $line-height-computed; @@ -842,9 +813,8 @@ div.table-list.boards { } -/** - * Repository view - */ +//== Repository view +// .revision-info { margin-bottom: $line-height-computed; @@ -916,12 +886,6 @@ tr.changeset { } } -.revision-graph { - circle { - // @include translate(0, $table-cell-padding - 1px); - } -} - #content #changes-legend { font-size: 1em; @@ -947,22 +911,22 @@ tr.changeset { } .change-A { - &:before { color: $changeset-add-color; } + &::before { color: $changeset-add-color; } a { @include link-variant($changeset-add-color); } } .change-M { - &:before { color: $changeset-modified-color; } + &::before { color: $changeset-modified-color; } a { @include link-variant($changeset-modified-color); } } .change-C { - &:before { color: $changeset-copied-color; } + &::before { color: $changeset-copied-color; } a { @include link-variant($changeset-copied-color); } } .change-R { - &:before { color: $changeset-renamed-color; } + &::before { color: $changeset-renamed-color; } a { @include link-variant($changeset-renamed-color); } } diff --git a/src/sass/components/_flash.scss b/src/sass/components/_flash.scss index f54298d..3927585 100644 --- a/src/sass/components/_flash.scss +++ b/src/sass/components/_flash.scss @@ -17,7 +17,7 @@ @if $use-font-awesome { @extend %fa-icon; - &:before { + &::before { margin-left: -(8px + 16px); float: left; line-height: $line-height-computed; @@ -38,11 +38,15 @@ border-color: $border; @if $use-font-awesome { - @if $icon == "true" { $icon: $fa-var-check; } - @elseif $icon == "warning" { $icon: $fa-var-warning; } - @elseif $icon == "exclamation" { $icon: $fa-var-exclamation-circle; } + @if $icon == "true" { + $icon: $fa-var-check; + } @elseif $icon == "warning" { + $icon: $fa-var-warning; + } @elseif $icon == "exclamation" { + $icon: $fa-var-exclamation-circle; + } - &:before { + &::before { content: $icon; } } @else { @@ -75,7 +79,7 @@ text-align: center; @if $use-font-awesome { - &:before { + &::before { margin-left: 0; float: none; } diff --git a/src/sass/components/_forms.scss b/src/sass/components/_forms.scss index 3fbc402..98f952f 100644 --- a/src/sass/components/_forms.scss +++ b/src/sass/components/_forms.scss @@ -33,7 +33,7 @@ input[type="week"], input[type="number"], input[type="url"], input[type="tel"], -input[type="color"] +input[type="color"], input[type="search"], input[type="email"], input[type="text"], @@ -62,6 +62,11 @@ input[type="password"] { textarea { resize: vertical; height: auto; + + &.text_cf { + width: 100%; + resize: vertical; + } } input[type="search"] { @@ -84,14 +89,21 @@ input[type="range"] { width: 100%; } -input.autocomplete { - padding-right: 30px; - @extend %image-aci; - background-repeat: no-repeat; - background-position: right center; +input { + &.autocomplete { + padding-right: 30px; + @extend %image-aci; + background-repeat: no-repeat; + background-position: right center; - &.ajax-loading { - background-image: url("../images/preloader.gif"); + &.ajax-loading { + background-image: url("../images/preloader.gif"); + } + } + + &.string_cf, + &.link_cf { + width: 100%; } } @@ -108,15 +120,24 @@ select { option[disabled] { color: $gray-lighter; } + + &.expandable { + vertical-align: top; + } + + &.bool_cf { + // scss-lint:disable ImportantRule + width: auto !important; + } } -/** - * Browser hacks: unfortunately every browser has different capabilities when it - * comes to styling and