Change Sass linting configuration to take advantage of stylelint capabilities

pull/2189/merge
Thibaud Colas 2017-08-26 01:04:10 +03:00
rodzic a900965fba
commit eea0664116
21 zmienionych plików z 104 dodań i 67 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ ignoreFiles:
- node_modules - node_modules
plugins: plugins:
- stylelint-scss - stylelint-scss
# See https://github.com/stylelint/stylelint/blob/master/docs/user-guide/rules.md
rules: rules:
block-closing-brace-newline-after: block-closing-brace-newline-after:
- always - always
@ -15,6 +16,7 @@ rules:
color-hex-length: short color-hex-length: short
color-named: never color-named: never
color-no-invalid-hex: true color-no-invalid-hex: true
comment-no-empty: true
declaration-bang-space-after: never declaration-bang-space-after: never
declaration-bang-space-before: always declaration-bang-space-before: always
declaration-block-no-duplicate-properties: true declaration-block-no-duplicate-properties: true
@ -26,17 +28,27 @@ rules:
declaration-property-value-blacklist: declaration-property-value-blacklist:
- /^border/: [none] - /^border/: [none]
- severity: error - severity: error
declaration-no-important: true
font-family-no-duplicate-names: true
function-calc-no-unspaced-operator: true
function-comma-space-after: always function-comma-space-after: always
function-linear-gradient-no-nonstandard-direction: true
function-parentheses-space-inside: never function-parentheses-space-inside: never
function-url-quotes: always function-url-quotes: always
indentation: indentation:
- 4 - 4
- severity: warning - severity: warning
length-zero-no-unit: true length-zero-no-unit: true
max-nesting-depth: 5 max-nesting-depth: 3
media-feature-name-no-unknown: true
no-empty-source: true
no-eol-whitespace: true no-eol-whitespace: true
no-extra-semicolons: true
no-missing-end-of-source-newline: true no-missing-end-of-source-newline: true
number-no-trailing-zeros: true number-no-trailing-zeros: true
number-leading-zero: always
property-case: lower
property-no-unknown: true
rule-empty-line-before: rule-empty-line-before:
- always - always
- except: - except:
@ -53,4 +65,14 @@ rules:
- class - class
selector-list-comma-newline-after: always selector-list-comma-newline-after: always
selector-max-id: 0 selector-max-id: 0
selector-pseudo-element-no-unknown: true
selector-type-no-unknown: true
scss/at-rule-no-unknown: true
scss/media-feature-value-dollar-variable: always
scss/selector-no-redundant-nesting-selector: true
string-no-newline: true
string-quotes: single string-quotes: single
unit-no-unknown: true
unit-case: lower
value-no-vendor-prefix: true
property-no-vendor-prefix: true

Wyświetl plik

@ -1,7 +1,7 @@
.o-pill { .o-pill {
display: inline-block; display: inline-block;
padding: .2em .5em; padding: 0.2em 0.5em;
border-radius: .25em; border-radius: 0.25em;
vertical-align: middle; vertical-align: middle;
line-height: 1.5; line-height: 1.5;
} }

Wyświetl plik

@ -1,3 +1,4 @@
// stylelint-disable declaration-no-important
.u-hidden { .u-hidden {
display: none !important; display: none !important;
} }

Wyświetl plik

@ -102,14 +102,14 @@ $menu-footer-height: 50px;
} }
.c-explorer__header__inner { .c-explorer__header__inner {
padding: 1em .75em; padding: 1em 0.75em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
.icon { .icon {
color: $c-explorer-secondary; color: $c-explorer-secondary;
margin-right: .25rem; margin-right: 0.25rem;
font-size: 1rem; font-size: 1rem;
} }

Wyświetl plik

@ -49,7 +49,7 @@
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
width: 50px; width: 50px;
padding: 0 .5em; padding: 0 0.5em;
line-height: 1; line-height: 1;
font-size: 2em; font-size: 2em;
cursor: pointer; cursor: pointer;

Wyświetl plik

@ -1,6 +1,6 @@
.c-status { .c-status {
background: $color-grey-1; background: $color-grey-1;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: .03rem; letter-spacing: 0.03rem;
font-size: 10px; font-size: 10px;
} }

Wyświetl plik

@ -87,8 +87,8 @@
outline: none; outline: none;
box-sizing: border-box; box-sizing: border-box;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
// stylelint-disable-next-line property-no-vendor-prefix
-moz-appearance: none; -moz-appearance: none;
-moz-box-sizing: border-box;
&:hover { &:hover {
background-color: #358c8b; background-color: #358c8b;
@ -98,7 +98,9 @@
} }
li.selected a { li.selected a {
// stylelint-disable-next-line declaration-no-important
color: #fff !important; color: #fff !important;
// stylelint-disable-next-line declaration-no-important
border-color: #43b1b0 !important; border-color: #43b1b0 !important;
background-color: #43b1b0; background-color: #43b1b0;
} }
@ -137,7 +139,7 @@ p.no-results {
} }
@media screen and (min-width: 50em) { @media screen and (min-width: $breakpoint-mobile) {
.changelist-filter { .changelist-filter {
float: right; float: right;
padding: 0 1.5%; padding: 0 1.5%;
@ -174,7 +176,7 @@ p.no-results {
} }
@media screen and (min-width: 1200px) { @media screen and (min-width: $breakpoint-desktop-large) {
.result-list.col9 { .result-list.col9 {
width: 79%; width: 79%;
} }

Wyświetl plik

@ -100,8 +100,6 @@ section {
} }
ul { ul {
-webkit-column-count: 3; // Chrome, Safari, Opera
-moz-column-count: 3; // Firefox
column-count: 3; column-count: 3;
} }

Wyświetl plik

@ -153,6 +153,7 @@
height: 2.3em; height: 2.3em;
line-height: 2.3em; line-height: 2.3em;
// stylelint-disable-next-line max-nesting-depth
&:first-child { &:first-child {
border-top-width: 0; border-top-width: 0;
} }
@ -289,12 +290,6 @@
} }
.xdsoft_noselect { .xdsoft_noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none; user-select: none;
} }
@ -321,6 +316,7 @@
cursor: pointer; cursor: pointer;
> .xdsoft_scroller { > .xdsoft_scroller {
// stylelint-disable-next-line declaration-no-important
background: #ccc !important; background: #ccc !important;
height: 20px; height: 20px;
border-radius: 3px; border-radius: 3px;

Wyświetl plik

@ -60,6 +60,7 @@
&.icon { &.icon {
padding-right: 5em; padding-right: 5em;
// stylelint-disable-next-line max-nesting-depth
&:before, &:before,
&:after { &:after {
right: 1em; right: 1em;
@ -238,7 +239,7 @@
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
line-height: 1; line-height: 1;
margin-top: -.25rem; margin-top: -0.25rem;
} }
.c-dropdown__button { .c-dropdown__button {
@ -254,7 +255,6 @@
cursor: pointer; cursor: pointer;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
user-select: none; user-select: none;
-webkit-user-select: none;
} }
.c-dropdown__toggle { .c-dropdown__toggle {
@ -262,22 +262,22 @@
} }
.c-dropdown__menu.c-dropdown__menu { .c-dropdown__menu.c-dropdown__menu {
margin-top: .75rem; margin-top: 0.75rem;
padding: .75rem 1rem; padding: 0.75rem 1rem;
min-width: 8rem; min-width: 8rem;
text-transform: none; text-transform: none;
position: absolute; position: absolute;
z-index: 1; z-index: 1;
animation: dropdownIn .1s ease-out backwards; animation: dropdownIn 0.1s ease-out backwards;
list-style: none; list-style: none;
} }
.c-dropdown__item { .c-dropdown__item {
margin-bottom: .375rem; margin-bottom: 0.375rem;
&:hover { &:hover {
.c-dropdown__indicator { .c-dropdown__indicator {
opacity: .6; opacity: 0.6;
} }
} }
} }
@ -300,7 +300,7 @@
// ============================================================================= // =============================================================================
.u-arrow:before { .u-arrow:before {
content: ''; content: '';
border: solid .35rem transparent; border: solid 0.35rem transparent;
display: block; display: block;
position: absolute; position: absolute;
} }

Wyświetl plik

@ -216,8 +216,6 @@ a.tag:hover {
margin: -15px 0 0 -15px; margin: -15px 0 0 -15px;
font-family: wagtail; font-family: wagtail;
animation: spin 0.5s infinite linear; animation: spin 0.5s infinite linear;
-webkit-animation: spin 0.5s infinite linear;
-moz-animation: spin 0.5s infinite linear;
content: '1'; content: '1';
z-index: 2; z-index: 2;
color: $color-teal; color: $color-teal;

Wyświetl plik

@ -62,6 +62,7 @@ select,
border: 1px solid $color-input-border; border: 1px solid $color-input-border;
padding: 0.9em 1.2em; padding: 0.9em 1.2em;
background-color: $color-fieldset-hover; background-color: $color-fieldset-hover;
// stylelint-disable-next-line property-no-vendor-prefix
-webkit-appearance: none; -webkit-appearance: none;
color: $color-text-input; color: $color-text-input;
font-size: 1.2em; font-size: 1.2em;
@ -136,6 +137,7 @@ input[type=checkbox] {
} }
input[type=radio] { input[type=radio] {
// stylelint-disable-next-line property-no-vendor-prefix
-webkit-appearance: radio; -webkit-appearance: radio;
width: auto; width: auto;
position: relative; position: relative;
@ -168,6 +170,7 @@ input[type=radio]:checked:before {
} }
input[type=checkbox] { input[type=checkbox] {
// stylelint-disable-next-line property-no-vendor-prefix
-webkit-appearance: checkbox; -webkit-appearance: checkbox;
width: auto; width: auto;
position: relative; position: relative;
@ -222,6 +225,7 @@ input[type=checkbox]:checked:before {
outline: none; outline: none;
box-sizing: border-box; box-sizing: border-box;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
// stylelint-disable-next-line property-no-vendor-prefix
-moz-appearance: none; -moz-appearance: none;
&:hover { &:hover {
@ -362,6 +366,7 @@ input[type=checkbox]:checked:before {
outline: none; outline: none;
box-sizing: border-box; box-sizing: border-box;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
// stylelint-disable-next-line property-no-vendor-prefix
-moz-appearance: none; -moz-appearance: none;
} }
@ -452,6 +457,7 @@ input[type=checkbox]:checked:before {
height: 1.8rem; height: 1.8rem;
width: 1.8rem; width: 1.8rem;
// stylelint-disable-next-line max-nesting-depth
&:before { &:before {
line-height: 1.7em; line-height: 1.7em;
} }

Wyświetl plik

@ -6,15 +6,15 @@
// ============================================================================= // =============================================================================
// Indicator light // Indicator light
// ============================================================================= // =============================================================================
$c-indicator-size: .625em; $c-indicator-size: 0.625em;
$c-indicator-margin: .25rem; $c-indicator-margin: 0.25rem;
.c-indicator { .c-indicator {
display: inline-block; display: inline-block;
border-radius: 50rem; border-radius: 50rem;
width: $c-indicator-size; width: $c-indicator-size;
height: $c-indicator-size; height: $c-indicator-size;
margin-top: -.125rem; margin-top: -0.125rem;
margin-right: $c-indicator-margin; margin-right: $c-indicator-margin;
font-size: 1rem; font-size: 1rem;
vertical-align: middle; vertical-align: middle;

Wyświetl plik

@ -194,6 +194,7 @@ ul.listing {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
// stylelint-disable max-nesting-depth
&:hover { &:hover {
color: $color-link; color: $color-link;
} }

Wyświetl plik

@ -2,6 +2,26 @@
@import 'wagtailadmin/scss/mixins'; @import 'wagtailadmin/scss/mixins';
@import 'wagtailadmin/scss/grid'; @import 'wagtailadmin/scss/grid';
@keyframes nod {
from {
transform: rotate(2deg);
}
to {
transform: rotate(8deg);
}
}
@keyframes tail-wag {
from {
transform: rotate(-3deg);
}
to {
transform: rotate(7deg);
}
}
.logo { .logo {
display: block; display: block;
text-align: left; text-align: left;
@ -50,10 +70,12 @@
transition: inherit; transition: inherit;
&.wagtail-logo__eye--open { &.wagtail-logo__eye--open {
// stylelint-disable-next-line declaration-no-important
display: inline !important; // doesn't work without `!important`, likely a specificity issue display: inline !important; // doesn't work without `!important`, likely a specificity issue
} }
&.wagtail-logo__eye--closed { &.wagtail-logo__eye--closed {
// stylelint-disable-next-line declaration-no-important
display: none !important; display: none !important;
} }
} }
@ -68,39 +90,22 @@
// Wagtail 'playful' animation (tail-wag, triggered by JS in base.html): // Wagtail 'playful' animation (tail-wag, triggered by JS in base.html):
&.logo-playful { &.logo-playful {
&:hover { &:hover {
@keyframes nod {
from {
transform: rotate(2deg);
}
to {
transform: rotate(8deg);
}
}
@keyframes tail-wag {
from {
transform: rotate(-3deg);
}
to {
transform: rotate(7deg);
}
}
animation: nod 1.2s forwards; animation: nod 1.2s forwards;
.wagtail-logo { .wagtail-logo {
// stylelint-disable max-nesting-depth
&.wagtail-logo__tail { &.wagtail-logo__tail {
animation: tail-wag 0.09s alternate; animation: tail-wag 0.09s alternate;
animation-iteration-count: infinite; animation-iteration-count: infinite;
} }
&.wagtail-logo__eye--open { &.wagtail-logo__eye--open {
// stylelint-disable-next-line declaration-no-important
display: none !important; display: none !important;
} }
&.wagtail-logo__eye--closed { &.wagtail-logo__eye--closed {
// stylelint-disable-next-line declaration-no-important
display: inline !important; display: inline !important;
} }
} }

Wyświetl plik

@ -436,6 +436,8 @@ body.explorer-open {
} }
} }
// stylelint-disable scss/media-feature-value-dollar-variable
// Media query hacks to detect IE10+ which doesn't support 3d transform of static elements and needs a fallback // Media query hacks to detect IE10+ which doesn't support 3d transform of static elements and needs a fallback
@media all and (-ms-high-contrast: none), @media all and (-ms-high-contrast: none),
all and (-ms-high-contrast: active) { all and (-ms-high-contrast: active) {

Wyświetl plik

@ -1,7 +1,7 @@
$zindex-modal-background: 500; $zindex-modal-background: 500;
.fade { .fade {
@include transition(opacity .15s linear); @include transition(opacity 0.15s linear);
opacity: 0; opacity: 0;
&.in { &.in {
@ -14,7 +14,6 @@ $zindex-modal-background: 500;
overflow: hidden; overflow: hidden;
.content-wrapper { .content-wrapper {
-webkit-transform: none;
transform: none; transform: none;
} }
} }
@ -104,6 +103,7 @@ $zindex-modal-background: 500;
} }
.header-title { .header-title {
// stylelint-disable-next-line declaration-no-important
padding-left: 0 !important; padding-left: 0 !important;
margin-left: -36px; margin-left: -36px;
} }

Wyświetl plik

@ -44,7 +44,7 @@ body {
&:after { &:after {
content: ''; content: '';
position: fixed; position: fixed;
transition: visibility 0s linear 0s, opacity .2s ease-out; transition: visibility 0s linear 0s, opacity 0.2s ease-out;
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -174,8 +174,10 @@ footer {
} }
} }
@media screen and (min-width: 90em) { $width-1440px: 90em;
width: 90em;
@media screen and (min-width: $width-1440px) {
width: $width-1440px;
} }
} }
@ -234,6 +236,7 @@ footer {
&.home { &.home {
a { a {
// stylelint-disable max-nesting-depth
padding-right: 0; padding-right: 0;
text-align: center; text-align: center;
width: 3em; width: 3em;

Wyświetl plik

@ -284,6 +284,7 @@
font-size: 0; // helps fake the effect of t.ext-replace class, which can't be used here. font-size: 0; // helps fake the effect of t.ext-replace class, which can't be used here.
width: 2em; width: 2em;
// stylelint-disable max-nesting-depth
&:before { &:before {
position: relative; position: relative;
padding: 0; padding: 0;

Wyświetl plik

@ -9,7 +9,7 @@
$size-home-button: 3.5em; $size-home-button: 3.5em;
$position: 2em; $position: 2em;
$width-arrow: .6em; $width-arrow: 0.6em;
$box-shadow-props: 0 0 1px 0 rgba(107, 214, 230, 1); $box-shadow-props: 0 0 1px 0 rgba(107, 214, 230, 1);
$max-items: 12; $max-items: 12;
$userbar-radius: 6px; $userbar-radius: 6px;
@ -88,6 +88,7 @@ $positions: (
.#{$namespace}-userbar { .#{$namespace}-userbar {
position: fixed; position: fixed;
z-index: 9999; z-index: 9999;
// stylelint-disable-next-line declaration-no-important
font-size: initial !important; font-size: initial !important;
line-height: initial; line-height: initial;
margin: 0; margin: 0;
@ -105,7 +106,7 @@ $positions: (
} }
} }
// stylelint-disable declaration-no-important
.#{$namespace}-userbar-trigger { .#{$namespace}-userbar-trigger {
display: flex; display: flex;
align-items: center; align-items: center;
@ -119,7 +120,7 @@ $positions: (
color: $color-black; color: $color-black;
padding: 0 !important; padding: 0 !important;
cursor: pointer; cursor: pointer;
box-shadow: $box-shadow-props, 0 1px 10px 0 rgba(107, 214, 230, .7); box-shadow: $box-shadow-props, 0 1px 10px 0 rgba(107, 214, 230, 0.7);
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
font-size: 16px; font-size: 16px;
text-decoration: none !important; text-decoration: none !important;
@ -127,7 +128,7 @@ $positions: (
.#{$namespace}-userbar.touch.is-active &, .#{$namespace}-userbar.touch.is-active &,
.#{$namespace}-userbar.no-touch &:hover { .#{$namespace}-userbar.no-touch &:hover {
box-shadow: $box-shadow-props, 0 3px 15px 0 rgba(107, 214, 230, .95); box-shadow: $box-shadow-props, 0 3px 15px 0 rgba(107, 214, 230, 0.95);
} }
.#{$namespace}-userbar-help-text { .#{$namespace}-userbar-help-text {
@ -137,7 +138,7 @@ $positions: (
} }
&.#{$namespace}-icon:before { &.#{$namespace}-icon:before {
transition: color .2s ease; transition: color 0.2s ease;
font-size: 32px; font-size: 32px;
width: auto; width: auto;
margin: 0; margin: 0;
@ -170,13 +171,13 @@ $positions: (
height: 0; height: 0;
opacity: 0; opacity: 0;
border: solid $width-arrow transparent; border: solid $width-arrow transparent;
transition-duration: .15s; transition-duration: 0.15s;
transition-timing-function: cubic-bezier(.55, 0, .1, 1); transition-timing-function: cubic-bezier(0.55, 0, 0.1, 1);
.#{$namespace}-userbar.is-active & { .#{$namespace}-userbar.is-active & {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateY(0);
transition-delay: .3s; transition-delay: 0.3s;
} }
} }
@ -200,8 +201,8 @@ $positions: (
background-color: $color-grey-1; background-color: $color-grey-1;
opacity: 0; opacity: 0;
overflow: hidden; overflow: hidden;
transition-duration: .125s; transition-duration: 0.125s;
transition-timing-function: cubic-bezier(.55, 0, .1, 1); transition-timing-function: cubic-bezier(0.55, 0, 0.1, 1);
font-family: 'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
font-size: 16px !important; font-size: 16px !important;
text-decoration: none !important; text-decoration: none !important;
@ -319,7 +320,7 @@ $positions: (
} }
&:#{unquote($prop)}(#{$i}) { &:#{unquote($prop)}(#{$i}) {
transition-delay: .05s * $i; transition-delay: 0.05s * $i;
} }
} }
} }

Wyświetl plik

@ -11,6 +11,7 @@
} }
select + span:after { select + span:after {
// stylelint-disable-next-line declaration-no-important
font-size: 2.5em !important; font-size: 2.5em !important;
} }
} }