From 532f166c4dc7087a98e86aa1de5b697e6b5c6e4f Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 13 Oct 2023 10:19:21 +0200 Subject: [PATCH] Enable shorthands in `declaration-strict-value` linter (#27597) Enable [shorthand matching](https://github.com/AndyOGo/stylelint-declaration-strict-value#expandshorthand) in this lint rule and match color properties by regex. Patterns like this will now fail lint: ```css background: #123456; border: 1px sold rgba(0,0,0,0); ``` --- .stylelintrc.yaml | 2 +- web_src/css/base.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index f30d79d71..f889a6867 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -103,7 +103,7 @@ rules: property-no-vendor-prefix: null rule-empty-line-before: null rule-selector-property-disallowed-list: null - scale-unlimited/declaration-strict-value: [[color, background-color, border-color, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true}] + scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}] selector-attribute-name-disallowed-list: null selector-attribute-operator-allowed-list: null selector-attribute-operator-disallowed-list: null diff --git a/web_src/css/base.css b/web_src/css/base.css index efb2553db..9661cdeca 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1801,7 +1801,7 @@ a.ui.basic.label:hover { table th[data-sortt-asc]:hover, table th[data-sortt-desc]:hover { - background: rgba(0, 0, 0, 0.1) !important; + background: var(--color-hover) !important; cursor: pointer !important; }