Skip to content

Commit 532f166

Browse files
authored
Enable shorthands in declaration-strict-value linter (go-gitea#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); ```
1 parent 3e9a379 commit 532f166

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.stylelintrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ rules:
103103
property-no-vendor-prefix: null
104104
rule-empty-line-before: null
105105
rule-selector-property-disallowed-list: null
106-
scale-unlimited/declaration-strict-value: [[color, background-color, border-color, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true}]
106+
scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}]
107107
selector-attribute-name-disallowed-list: null
108108
selector-attribute-operator-allowed-list: null
109109
selector-attribute-operator-disallowed-list: null

web_src/css/base.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ a.ui.basic.label:hover {
18011801

18021802
table th[data-sortt-asc]:hover,
18031803
table th[data-sortt-desc]:hover {
1804-
background: rgba(0, 0, 0, 0.1) !important;
1804+
background: var(--color-hover) !important;
18051805
cursor: pointer !important;
18061806
}
18071807

0 commit comments

Comments
 (0)