From d681922215be87c074195edd4c8f326ac2c78205 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 23 Jun 2023 16:15:03 +0200 Subject: [PATCH 1/5] Adds stylelint rule to forbid irregular whitespaces --- .stylelintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index beadb8352cd..3e1dbceb51c 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -7,6 +7,7 @@ ], "ignoreFiles": ["node_modules/**/*", "vendor/**/*", "tests/**/*", "tmp/**/*", "misc/**/*", "plugins/*/vue/dist/*"], "rules": { - "color-no-invalid-hex": true + "color-no-invalid-hex": true, + "no-irregular-whitespace": true } } \ No newline at end of file From d32b43d72eb2d1845f5126b1161ba6b672b28310 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 23 Jun 2023 16:16:06 +0200 Subject: [PATCH 2/5] Disallow appending unit to zero values --- .stylelintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 3e1dbceb51c..53eec17efb6 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -8,6 +8,7 @@ "ignoreFiles": ["node_modules/**/*", "vendor/**/*", "tests/**/*", "tmp/**/*", "misc/**/*", "plugins/*/vue/dist/*"], "rules": { "color-no-invalid-hex": true, - "no-irregular-whitespace": true + "no-irregular-whitespace": true, + "length-zero-no-unit": true } } \ No newline at end of file From f11536d5a5795df1276bf82498f862e54fb3b52d Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 23 Jun 2023 16:21:07 +0200 Subject: [PATCH 3/5] apply new rule using automatic fix --- plugins/API/css/styles.css | 8 ++++---- plugins/Annotations/stylesheets/annotations.less | 2 +- plugins/CoreHome/stylesheets/layout.less | 6 +++--- .../src/MenuItemsDropdown/MenuItemsDropdown.less | 12 ++++++------ plugins/Feedback/stylesheets/feedback.less | 14 +++++++------- .../SegmentEditor/stylesheets/segmentation.less | 8 ++++---- plugins/Transitions/stylesheets/transitions.less | 6 +++--- plugins/UsersManager/stylesheets/usersManager.less | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/plugins/API/css/styles.css b/plugins/API/css/styles.css index 3b52ba995a0..d92f0229dba 100644 --- a/plugins/API/css/styles.css +++ b/plugins/API/css/styles.css @@ -3,7 +3,7 @@ border-color:#00CC3A; border-style: solid; border-width: 1px; - margin: 0pt 0pt 16px 8px; + margin: 0 0 16px 8px; padding: 12px; line-height:4em; } @@ -12,14 +12,14 @@ } .page_api{ - padding:0px 15px 0 15px; + padding:0 15px 0 15px; font-size:13px; } .page_api h2 { border-bottom:1px solid #DADADA; - margin:10px -15px 15px 0px; - padding:0pt 0px 5px 0pt; + margin:10px -15px 15px 0; + padding:0 0 5px 0; font-size:24px; } diff --git a/plugins/Annotations/stylesheets/annotations.less b/plugins/Annotations/stylesheets/annotations.less index 1411d3d95cb..a634f81ac4b 100644 --- a/plugins/Annotations/stylesheets/annotations.less +++ b/plugins/Annotations/stylesheets/annotations.less @@ -73,7 +73,7 @@ span.annotation { .annotation-controls { display: inline-block; margin:0; - padding: 50px 0px 10px 10px; + padding: 50px 0 10px 10px; color: transparent; } diff --git a/plugins/CoreHome/stylesheets/layout.less b/plugins/CoreHome/stylesheets/layout.less index b2ae3ff8c25..bdc15ca8962 100644 --- a/plugins/CoreHome/stylesheets/layout.less +++ b/plugins/CoreHome/stylesheets/layout.less @@ -134,7 +134,7 @@ nav { &>.top_controls { .icon-arrowup:before, .icon-arrowdown:before { - padding: 17px 0 0 0px; + padding: 17px 0 0 0; display: inline-block; cursor: pointer; @@ -229,7 +229,7 @@ nav { opacity: 0.2; position: absolute; right: 21px; - top: 0px; + top: 0; line-height: 13px; padding-left: 16px; padding-right: 16px; @@ -517,7 +517,7 @@ nav { #root{ #secondNavBar + .pageWrap { - margin-left: 0px; + margin-left: 0; } .top_controls{ diff --git a/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.less b/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.less index 9371fd90b48..ec1e5f0e6d1 100644 --- a/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.less +++ b/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.less @@ -30,7 +30,7 @@ position: absolute; right: 25px; top: 32px; - margin: 0px; + margin: 0; left: initial; color: @theme-color-text-lighter; } @@ -38,7 +38,7 @@ position: absolute; top: 34px; cursor: pointer; - margin: 0px; + margin: 0; right: 21px; left: initial; font-size: 12px; @@ -46,7 +46,7 @@ } input { - margin: 0px; + margin: 0; width: 100%; &::-ms-clear { @@ -78,9 +78,9 @@ } &.separator { - padding: 0px !important; - border-bottom: 0px; - margin: 0px; + padding: 0 !important; + border-bottom: 0; + margin: 0; } &.separator, diff --git a/plugins/Feedback/stylesheets/feedback.less b/plugins/Feedback/stylesheets/feedback.less index aaa34cda67d..01aa72d2aef 100644 --- a/plugins/Feedback/stylesheets/feedback.less +++ b/plugins/Feedback/stylesheets/feedback.less @@ -25,22 +25,22 @@ } .piwik-donate-call { - border: 0px; - padding-left: 0px; - padding-top: 0px; + border: 0; + padding-left: 0; + padding-top: 0; } .donate-form-instructions { - margin: 0 1.25em 0 0em; + margin: 0 1.25em 0 0; color: #5E5E5C; } .piwik-donate-slider { - margin: 1em 0 1em 0em; + margin: 1em 0 1em 0; } #piwik-worth { - margin: 0 1em 0 0em; + margin: 0 1em 0 0; font-size: 1em; font-style: normal; } @@ -96,7 +96,7 @@ margin-top: 45px; background-color: @color-silver-l90; height: 1px; - border: 0px; + border: 0; } } diff --git a/plugins/SegmentEditor/stylesheets/segmentation.less b/plugins/SegmentEditor/stylesheets/segmentation.less index b14dadf334b..f703fa2101a 100644 --- a/plugins/SegmentEditor/stylesheets/segmentation.less +++ b/plugins/SegmentEditor/stylesheets/segmentation.less @@ -6,11 +6,11 @@ } .searchFound { - border: 0px solid red; + border: 0 solid red; } .others { - border: 0px solid green; + border: 0 solid green; } .clear { @@ -29,7 +29,7 @@ .hovered { border-radius: 4px; border: 2px dashed #000 !important; - padding: 0px; + padding: 0; } .metricListBlock { @@ -547,7 +547,7 @@ a.metric_category { .segment-element .segment-top a.dropdown:after { content: " \25BC"; - font-size: 0px; + font-size: 0; color: @theme-color-brand; border-left: 4px solid rgba(0, 0, 0, 0); border-right: 4px solid rgba(0, 0, 0, 0); diff --git a/plugins/Transitions/stylesheets/transitions.less b/plugins/Transitions/stylesheets/transitions.less index cec09f230a8..10371fc3c64 100644 --- a/plugins/Transitions/stylesheets/transitions.less +++ b/plugins/Transitions/stylesheets/transitions.less @@ -50,9 +50,9 @@ background: #f7f7f7; border: 1px solid #a9a399; border-radius: 10px; - -webkit-box-shadow: 0px 0px 9px 0px #999; - -moz-box-shadow: 0px 0px 9px 0px #999; - box-shadow: 0px 0px 9px 0px #999; + -webkit-box-shadow: 0 0 9px 0 #999; + -moz-box-shadow: 0 0 9px 0 #999; + box-shadow: 0 0 9px 0 #999; z-index: 1507; } diff --git a/plugins/UsersManager/stylesheets/usersManager.less b/plugins/UsersManager/stylesheets/usersManager.less index 6ee6903ed2b..b814dc90aa6 100644 --- a/plugins/UsersManager/stylesheets/usersManager.less +++ b/plugins/UsersManager/stylesheets/usersManager.less @@ -28,7 +28,7 @@ .modal-title { font-size: 20px; line-height: 20px; - padding-top: 0px; + padding-top: 0; font-weight: 600; } p { From 32f1022ee9e58f4fa40d76654908ac63e66d8d09 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 23 Jun 2023 16:22:20 +0200 Subject: [PATCH 4/5] Adds stylelint rule to disallow empty blocks, comments and sources --- .stylelintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 53eec17efb6..cfa6919ebff 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -9,6 +9,9 @@ "rules": { "color-no-invalid-hex": true, "no-irregular-whitespace": true, - "length-zero-no-unit": true + "length-zero-no-unit": true, + "block-no-empty": true, + "comment-no-empty": true, + "no-empty-source": true } } \ No newline at end of file From 46cd64904eb44f05c6e2e543498e51c430da0127 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 23 Jun 2023 16:24:30 +0200 Subject: [PATCH 5/5] remove empty css source file --- plugins/Morpheus/stylesheets/base/font.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 plugins/Morpheus/stylesheets/base/font.css diff --git a/plugins/Morpheus/stylesheets/base/font.css b/plugins/Morpheus/stylesheets/base/font.css deleted file mode 100644 index e69de29bb2d..00000000000