From 823af17933f8cf3ac2b7d6f574ebeeda4b075d6e Mon Sep 17 00:00:00 2001 From: rubenmoya Date: Fri, 22 Dec 2017 18:38:49 +0100 Subject: [PATCH] Fix stylelint errors --- .stylelintrc | 6 +++++- src/components/buttons.css | 4 ---- src/components/forms/checkbox.css | 18 +++++++++--------- src/components/forms/radio.css | 16 ++++++++-------- src/components/forms/textarea.css | 2 +- src/components/menu.css | 2 -- src/components/shapes/dataset.css | 24 +++++++++++------------- src/components/shapes/error-circle.css | 1 - src/components/typography.css | 2 +- src/utilities/fonts.css | 9 ++++++--- src/utilities/helpers.css | 11 ++--------- 11 files changed, 43 insertions(+), 52 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index c5c617d..3bdc04e 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -3,12 +3,16 @@ "stylelint-config-standard", "stylelint-config-property-sort-order-smacss" ], + "ignoreFiles": [ + "src/vendor/reset.css", + ], "rules": { "selector-pseudo-element-colon-notation": "double", "color-hex-case": "upper", "declaration-empty-line-before": null, "block-no-empty": true, "shorthand-property-no-redundant-values": true, - "custom-property-empty-line-before": null + "custom-property-empty-line-before": null, + "no-descending-specificity": null } } diff --git a/src/components/buttons.css b/src/components/buttons.css index 053196c..2dbb0c6 100644 --- a/src/components/buttons.css +++ b/src/components/buttons.css @@ -6,7 +6,6 @@ border-radius: 4px; cursor: pointer; - .CDB-Button-Text { display: block; } @@ -59,7 +58,6 @@ } } - .CDB-Button--small { padding: 4px 12px; border-radius: 3px; @@ -118,7 +116,6 @@ } } - .CDB-Button--error, .CDB-Button--negative { background: var(--color-error); @@ -153,7 +150,6 @@ } } - .CDB-Button--secondary { box-shadow: inset 0 0 0 1px var(--color-blue); color: var(--color-blue); diff --git a/src/components/forms/checkbox.css b/src/components/forms/checkbox.css index a90e887..81becf8 100644 --- a/src/components/forms/checkbox.css +++ b/src/components/forms/checkbox.css @@ -54,15 +54,6 @@ } } -.CDB-Checkbox:checked:hover + .CDB-Checkbox-face { - border: 1px solid var(--color-blue); - - &::before, - &::after { - background: white; - } -} - .CDB-Checkbox:hover + .CDB-Checkbox-face { border: 1px solid var(--color-blue-hover); @@ -90,3 +81,12 @@ opacity: 0; } } + +.CDB-Checkbox:checked:hover + .CDB-Checkbox-face { + border: 1px solid var(--color-blue); + + &::before, + &::after { + background: white; + } +} diff --git a/src/components/forms/radio.css b/src/components/forms/radio.css index feee77f..d77cca9 100644 --- a/src/components/forms/radio.css +++ b/src/components/forms/radio.css @@ -51,8 +51,10 @@ } } -.CDB-Radio:disabled:hover + .CDB-Radio-face { - border: 1px solid var(--color-line-hover); +.CDB-Radio:active + .CDB-Radio-face { + &::before { + background: var(--color-blue); + } } .CDB-Radio:hover + .CDB-Radio-face { @@ -68,14 +70,12 @@ border: 1px solid var(--color-blue); } +.CDB-Radio:disabled:hover + .CDB-Radio-face { + border: 1px solid var(--color-line-hover); +} + .CDB-Radio:checked:hover + .CDB-Radio-face { &::before { background: white; } } - -.CDB-Radio:active + .CDB-Radio-face { - &::before { - background: var(--color-blue); - } -} diff --git a/src/components/forms/textarea.css b/src/components/forms/textarea.css index 2a8202c..51ffaec 100644 --- a/src/components/forms/textarea.css +++ b/src/components/forms/textarea.css @@ -23,7 +23,7 @@ background: var(--color-softgray); } - &:has-error { + &.has-error { border: 1px solid color(var(--color-error) alpha(0.48)); background: color(var(--color-error) alpha(0.04)); color: var(--color-error); diff --git a/src/components/menu.css b/src/components/menu.css index f4ac334..cb84615 100644 --- a/src/components/menu.css +++ b/src/components/menu.css @@ -20,7 +20,6 @@ } } - .CDB-NavMenu-link { display: block; margin-bottom: -1px; @@ -83,7 +82,6 @@ } } - .CDB-NavSubmenu-item.is-selected .CDB-NavSubmenu-link { border-bottom: 2px solid var(--color-line); color: var(--color-text-primary); diff --git a/src/components/shapes/dataset.css b/src/components/shapes/dataset.css index 969877c..6549802 100644 --- a/src/components/shapes/dataset.css +++ b/src/components/shapes/dataset.css @@ -3,6 +3,17 @@ &.is-small { padding-top: 0; + + .CDB-Shape-DatasetItem { + width: 6px; + height: 6px; + margin-left: -7px; + + &:first-child { + margin-left: 0; + box-shadow: 2px 0 0 white; + } + } } } @@ -23,19 +34,6 @@ } } -.CDB-Shape-Dataset.is-small { - .CDB-Shape-DatasetItem { - width: 6px; - height: 6px; - margin-left: -7px; - - &:first-child { - margin-left: 0; - box-shadow: 2px 0 0 white; - } - } -} - .CDB-Shape-Dataset.is-blue { .CDB-Shape-DatasetItem { border: 1px solid var(--color-blue); diff --git a/src/components/shapes/error-circle.css b/src/components/shapes/error-circle.css index d27b0d1..b61b2c9 100644 --- a/src/components/shapes/error-circle.css +++ b/src/components/shapes/error-circle.css @@ -27,7 +27,6 @@ } } - .CDB-Shape-CircleItem--fill { &.is-blue { border: 1px solid var(--color-blue); diff --git a/src/components/typography.css b/src/components/typography.css index 00140f8..ec4b649 100644 --- a/src/components/typography.css +++ b/src/components/typography.css @@ -1,5 +1,5 @@ .CDB-Text { - font-family: 'Open Sans'; + font-family: 'Open Sans', Helvetica, Arial, sans-serif; $sFontWeight-normal: 400; &.is-semibold { diff --git a/src/utilities/fonts.css b/src/utilities/fonts.css index f9d8f71..6117594 100644 --- a/src/utilities/fonts.css +++ b/src/utilities/fonts.css @@ -3,7 +3,8 @@ font-style: normal; font-weight: 300; src: url('../fonts/OpenSans-Light.eot'); - src: url('../fonts/OpenSans-Light.eot?#iefix') format('embedded-opentype'), + src: + url('../fonts/OpenSans-Light.eot?#iefix') format('embedded-opentype'), url('../fonts/OpenSans-Light.woff') format('woff'), url('../fonts/OpenSans-Light.ttf') format('truetype'); } @@ -13,7 +14,8 @@ font-style: normal; font-weight: 400; src: url('../fonts/OpenSans-Regular.eot'); - src: url('../fonts/OpenSans-Regular.eot?#iefix') format('embedded-opentype'), + src: + url('../fonts/OpenSans-Regular.eot?#iefix') format('embedded-opentype'), url('../fonts/OpenSans-Regular.woff') format('woff'), url('../fonts/OpenSans-Regular.ttf') format('truetype'); } @@ -23,7 +25,8 @@ font-style: normal; font-weight: 600; src: url('../fonts/OpenSans-Semibold.eot'); - src: url('../fonts/OpenSans-Semibold.eot?#iefix') format('embedded-opentype'), + src: + url('../fonts/OpenSans-Semibold.eot?#iefix') format('embedded-opentype'), url('../fonts/OpenSans-Semibold.woff') format('woff'), url('../fonts/OpenSans-Semibold.ttf') format('truetype'); } diff --git a/src/utilities/helpers.css b/src/utilities/helpers.css index ec94712..ab431ce 100644 --- a/src/utilities/helpers.css +++ b/src/utilities/helpers.css @@ -162,9 +162,9 @@ align-items: flex-end; } +/* Media queries */ -/* Media queries*/ -@include media-query-mobile() { +@media only screen and (max-width: 600px) { .u-showDesktop { display: none !important; } @@ -173,10 +173,3 @@ display: block !important; } } - -/* helper mixins */ -@mixin default-form-error-style() { - border: 1px solid rgba(var(--color-error), 0.48); - background: rgba(var(--color-error), 0.04); - color: var(--color-error); -}