@primer/stylelint-config 12.7.1-rc.d8a889b → 12.7.1-rc.ff27b7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/plugins/borders.js +4 -2
- package/plugins/box-shadow.js +4 -2
- package/plugins/colors.js +10 -4
- package/plugins/lib/primitives-v8.json +57 -25
- package/plugins/no-deprecated-colors.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,16 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- [#338](https://github.com/primer/stylelint-config/pull/338) [`7cc4c08`](https://github.com/primer/stylelint-config/commit/7cc4c08f6465f495df89fc0609d3cdf012480dec) Thanks [@langermank](https://github.com/langermank)! - Add more tests to `no-deprecated-colors`
|
|
8
|
+
|
|
7
9
|
- [#328](https://github.com/primer/stylelint-config/pull/328) [`5ae7400`](https://github.com/primer/stylelint-config/commit/5ae7400340afc2cd21006093ce7b33206a00372e) Thanks [@langermank](https://github.com/langermank)! - Fix failing tests in no-deprecated-colors
|
|
8
10
|
|
|
11
|
+
- [#337](https://github.com/primer/stylelint-config/pull/337) [`6bf0fd6`](https://github.com/primer/stylelint-config/commit/6bf0fd624a69b21e48803ba62a5b2b9dc21b8d8c) Thanks [@langermank](https://github.com/langermank)! - Remove inline fallback var for no-deprecated-colors
|
|
12
|
+
|
|
9
13
|
- [#332](https://github.com/primer/stylelint-config/pull/332) [`6485cf0`](https://github.com/primer/stylelint-config/commit/6485cf053f502d71a8ce8c407ad01a939038959c) Thanks [@langermank](https://github.com/langermank)! - Updated deprecated json color file
|
|
10
14
|
|
|
11
15
|
- [#333](https://github.com/primer/stylelint-config/pull/333) [`485ce04`](https://github.com/primer/stylelint-config/commit/485ce047d75a635134919678a776ea808604cf4a) Thanks [@langermank](https://github.com/langermank)! - Adding more color replacements for deprecated colors
|
|
12
16
|
|
|
17
|
+
- [#340](https://github.com/primer/stylelint-config/pull/340) [`4688bb4`](https://github.com/primer/stylelint-config/commit/4688bb4c0ea7975672b76af8706b80278f00f1a4) Thanks [@langermank](https://github.com/langermank)! - add inlineFallback prop to no-deprecated-colors
|
|
18
|
+
|
|
13
19
|
- [#322](https://github.com/primer/stylelint-config/pull/322) [`726d7d1`](https://github.com/primer/stylelint-config/commit/726d7d1bf4eac82a032c448cb0be32d5bf66b29a) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating no-deprecated-colors for primitives v8
|
|
14
20
|
|
|
15
21
|
- [#334](https://github.com/primer/stylelint-config/pull/334) [`b14c154`](https://github.com/primer/stylelint-config/commit/b14c154174ddd7190e62fe1d26698fc9cfe75c17) Thanks [@langermank](https://github.com/langermank)! - More tests for `no-deprecated-colors`
|
|
16
22
|
|
|
23
|
+
- [#339](https://github.com/primer/stylelint-config/pull/339) [`36fade4`](https://github.com/primer/stylelint-config/commit/36fade45bdc431d223165f5d7226c10cf6591d83) Thanks [@langermank](https://github.com/langermank)! - Update plugins to support Primitives v8
|
|
24
|
+
|
|
17
25
|
## 12.7.0
|
|
18
26
|
|
|
19
27
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/stylelint-config",
|
|
3
|
-
"version": "12.7.1-rc.
|
|
3
|
+
"version": "12.7.1-rc.ff27b7e",
|
|
4
4
|
"description": "Sharable stylelint config used by GitHub's CSS",
|
|
5
5
|
"homepage": "http://primer.style/css/tools/linting",
|
|
6
6
|
"author": "GitHub, Inc.",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@changesets/cli": "2.26.1",
|
|
43
43
|
"@github/prettier-config": "0.0.4",
|
|
44
44
|
"@primer/css": "^20.0.0",
|
|
45
|
-
"@primer/primitives": "^7.
|
|
45
|
+
"@primer/primitives": "^7.11.11",
|
|
46
46
|
"dedent": "0.7.0",
|
|
47
47
|
"eslint": "8.39.0",
|
|
48
48
|
"eslint-plugin-github": "4.3.5",
|
package/plugins/borders.js
CHANGED
|
@@ -31,9 +31,11 @@ module.exports = createVariableRule(
|
|
|
31
31
|
'$border-*',
|
|
32
32
|
'transparent',
|
|
33
33
|
'currentColor',
|
|
34
|
-
// Match variables in any of the following formats: --color-border-*, --color-*-border-*, --color-*-border
|
|
34
|
+
// Match variables in any of the following formats: --color-border-*, --color-*-border-*, --color-*-border, --borderColor-, *borderColor*
|
|
35
35
|
/var\(--color-(.+-)*border(-.+)*\)/,
|
|
36
|
-
/var\(--color-[^)]+\)
|
|
36
|
+
/var\(--color-[^)]+\)/,
|
|
37
|
+
/var\(--borderColor-[^)]+\)/,
|
|
38
|
+
/var\((.+-)*borderColor(-.+)*\)/
|
|
37
39
|
],
|
|
38
40
|
replacements: {
|
|
39
41
|
'$border-gray': '$border-color'
|
package/plugins/box-shadow.js
CHANGED
|
@@ -10,8 +10,10 @@ module.exports = createVariableRule(
|
|
|
10
10
|
'$box-shadow*',
|
|
11
11
|
'$*-shadow',
|
|
12
12
|
'none',
|
|
13
|
-
// Match variables in any of the following formats: --color-shadow-*, --color-*-shadow-*, --color-*-shadow
|
|
14
|
-
/var\(--color-(.+-)*shadow(-.+)*\)
|
|
13
|
+
// Match variables in any of the following formats: --color-shadow-*, --color-*-shadow-*, --color-*-shadow, --shadow-*, *shadow*
|
|
14
|
+
/var\(--color-(.+-)*shadow(-.+)*\)/,
|
|
15
|
+
/var\(--shadow(-.+)*\)/,
|
|
16
|
+
/var\((.+-)*shadow(-.+)*\)/
|
|
15
17
|
],
|
|
16
18
|
singular: true
|
|
17
19
|
}
|
package/plugins/colors.js
CHANGED
|
@@ -3,9 +3,13 @@ const {createVariableRule} = require('./lib/variable-rules')
|
|
|
3
3
|
const bgVars = [
|
|
4
4
|
'$bg-*',
|
|
5
5
|
'$tooltip-background-color',
|
|
6
|
-
// Match variables in any of the following formats: --color-bg-*, --color-*-bg-*, --color-*-bg
|
|
6
|
+
// Match variables in any of the following formats: --color-bg-*, --color-*-bg-*, --color-*-bg, *bgColor*, *fgColor*, *borderColor*, *iconColor*
|
|
7
7
|
/var\(--color-(.+-)*bg(-.+)*\)/,
|
|
8
|
-
/var\(--color-[^)]+\)
|
|
8
|
+
/var\(--color-[^)]+\)/,
|
|
9
|
+
/var\((.+-)*bgColor(-.+)*\)/,
|
|
10
|
+
/var\((.+-)*fgColor(-.+)*\)/,
|
|
11
|
+
/var\((.+-)*borderColor(-.+)*\)/,
|
|
12
|
+
/var\((.+-)*iconColor(-.+)*\)/
|
|
9
13
|
]
|
|
10
14
|
|
|
11
15
|
module.exports = createVariableRule(
|
|
@@ -26,10 +30,12 @@ module.exports = createVariableRule(
|
|
|
26
30
|
'$text-*',
|
|
27
31
|
'$tooltip-text-color',
|
|
28
32
|
'inherit',
|
|
29
|
-
// Match variables in any of the following formats: --color-text-*, --color-*-text-*, --color-*-text
|
|
33
|
+
// Match variables in any of the following formats: --color-text-*, --color-*-text-*, --color-*-text, *fgColor*, *iconColor*
|
|
30
34
|
/var\(--color-(.+-)*text(-.+)*\)/,
|
|
31
35
|
/var\(--color-(.+-)*fg(-.+)*\)/,
|
|
32
|
-
/var\(--color-[^)]+\)
|
|
36
|
+
/var\(--color-[^)]+\)/,
|
|
37
|
+
/var\((.+-)*fgColor(-.+)*\)/,
|
|
38
|
+
/var\((.+-)*iconColor(-.+)*\)/
|
|
33
39
|
]
|
|
34
40
|
}
|
|
35
41
|
},
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
],
|
|
220
220
|
"--color-header-divider": [
|
|
221
221
|
{
|
|
222
|
-
"props": ["border", "background"],
|
|
222
|
+
"props": ["border", "background", "color"],
|
|
223
223
|
"replacement": "--header-borderColor-divider"
|
|
224
224
|
}
|
|
225
225
|
],
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
],
|
|
232
232
|
"--color-header-search-bg": [
|
|
233
233
|
{
|
|
234
|
-
"props": ["background"],
|
|
234
|
+
"props": ["background", "background-color"],
|
|
235
235
|
"replacement": "--headerSearch-bgColor"
|
|
236
236
|
}
|
|
237
237
|
],
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
],
|
|
250
250
|
"--color-avatar-border": [
|
|
251
251
|
{
|
|
252
|
-
"props": ["border", "background"],
|
|
252
|
+
"props": ["border", "background", "box-shadow"],
|
|
253
253
|
"replacement": "--avatar-borderColor"
|
|
254
254
|
}
|
|
255
255
|
],
|
|
@@ -730,7 +730,7 @@
|
|
|
730
730
|
"--color-switch-track-checked-border": [
|
|
731
731
|
{
|
|
732
732
|
"props": ["border"],
|
|
733
|
-
"replacement": "transparent"
|
|
733
|
+
"replacement": "--borderColor-transparent"
|
|
734
734
|
}
|
|
735
735
|
],
|
|
736
736
|
"--color-switch-knob-bg": [
|
|
@@ -813,8 +813,12 @@
|
|
|
813
813
|
],
|
|
814
814
|
"--color-canvas-default-transparent": [
|
|
815
815
|
{
|
|
816
|
-
"props": ["background"],
|
|
817
|
-
"replacement": "transparent"
|
|
816
|
+
"props": ["background", "color"],
|
|
817
|
+
"replacement": "--bgColor-transparent"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"props": ["border"],
|
|
821
|
+
"replacement": "--borderColor-transparent"
|
|
818
822
|
}
|
|
819
823
|
],
|
|
820
824
|
"--color-fg-default": [
|
|
@@ -835,6 +839,10 @@
|
|
|
835
839
|
{
|
|
836
840
|
"props": ["background"],
|
|
837
841
|
"replacement": "--bgColor-neutral-emphasis"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"props": ["border"],
|
|
845
|
+
"replacement": "--borderColor-neutral-emphasis"
|
|
838
846
|
}
|
|
839
847
|
],
|
|
840
848
|
"--color-fg-subtle": [
|
|
@@ -855,11 +863,7 @@
|
|
|
855
863
|
],
|
|
856
864
|
"--color-canvas-default": [
|
|
857
865
|
{
|
|
858
|
-
"props": ["background"],
|
|
859
|
-
"replacement": "--bgColor-default"
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
"props": ["border", "box-shadow"],
|
|
866
|
+
"props": ["background", "border", "box-shadow", "fill", "stroke"],
|
|
863
867
|
"replacement": "--bgColor-default"
|
|
864
868
|
}
|
|
865
869
|
],
|
|
@@ -877,19 +881,19 @@
|
|
|
877
881
|
],
|
|
878
882
|
"--color-canvas-subtle": [
|
|
879
883
|
{
|
|
880
|
-
"props": ["background"],
|
|
884
|
+
"props": ["background", "fill", "border"],
|
|
881
885
|
"replacement": "--bgColor-muted"
|
|
882
886
|
}
|
|
883
887
|
],
|
|
884
888
|
"--color-border-default": [
|
|
885
889
|
{
|
|
886
|
-
"props": ["border", "background", "box-shadow"],
|
|
890
|
+
"props": ["border", "background", "box-shadow", "stroke", "outline", "fill"],
|
|
887
891
|
"replacement": "--borderColor-default"
|
|
888
892
|
}
|
|
889
893
|
],
|
|
890
894
|
"--color-border-muted": [
|
|
891
895
|
{
|
|
892
|
-
"props": ["border", "background", "outline"],
|
|
896
|
+
"props": ["border", "background", "outline", "box-shadow", "stroke"],
|
|
893
897
|
"replacement": "--borderColor-muted"
|
|
894
898
|
}
|
|
895
899
|
],
|
|
@@ -901,7 +905,7 @@
|
|
|
901
905
|
],
|
|
902
906
|
"--color-neutral-emphasis-plus": [
|
|
903
907
|
{
|
|
904
|
-
"props": ["background", "border", "color"],
|
|
908
|
+
"props": ["background", "border", "color", "stroke"],
|
|
905
909
|
"replacement": "--bgColor-emphasis"
|
|
906
910
|
}
|
|
907
911
|
],
|
|
@@ -915,7 +919,7 @@
|
|
|
915
919
|
"replacement": "--borderColor-neutral-emphasis"
|
|
916
920
|
},
|
|
917
921
|
{
|
|
918
|
-
"props": ["color"],
|
|
922
|
+
"props": ["color", "fill"],
|
|
919
923
|
"replacement": "--fgColor-neutral"
|
|
920
924
|
}
|
|
921
925
|
],
|
|
@@ -933,11 +937,15 @@
|
|
|
933
937
|
{
|
|
934
938
|
"props": ["background"],
|
|
935
939
|
"replacement": "--bgColor-neutral-muted"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"props": ["border", "box-shadow"],
|
|
943
|
+
"replacement": "--borderColor-neutral-muted"
|
|
936
944
|
}
|
|
937
945
|
],
|
|
938
946
|
"--color-accent-fg": [
|
|
939
947
|
{
|
|
940
|
-
"props": ["color", "fill"],
|
|
948
|
+
"props": ["color", "fill", "stroke"],
|
|
941
949
|
"replacement": "--fgColor-accent"
|
|
942
950
|
},
|
|
943
951
|
{
|
|
@@ -947,6 +955,10 @@
|
|
|
947
955
|
{
|
|
948
956
|
"props": ["background"],
|
|
949
957
|
"replacement": "--bgColor-accent-emphasis"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"props": ["outline"],
|
|
961
|
+
"replacement": "--focus-outlineColor"
|
|
950
962
|
}
|
|
951
963
|
],
|
|
952
964
|
"--color-accent-emphasis": [
|
|
@@ -959,8 +971,12 @@
|
|
|
959
971
|
"replacement": "--borderColor-accent-emphasis"
|
|
960
972
|
},
|
|
961
973
|
{
|
|
962
|
-
"props": ["color", "fill"],
|
|
974
|
+
"props": ["color", "fill", "stroke"],
|
|
963
975
|
"replacement": "--fgColor-accent"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"props": ["outline"],
|
|
979
|
+
"replacement": "--focus-outlineColor"
|
|
964
980
|
}
|
|
965
981
|
],
|
|
966
982
|
"--color-accent-muted": [
|
|
@@ -977,11 +993,15 @@
|
|
|
977
993
|
{
|
|
978
994
|
"props": ["background"],
|
|
979
995
|
"replacement": "--bgColor-accent-muted"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"props": ["border", "box-shadow"],
|
|
999
|
+
"replacement": "--borderColor-accent-muted"
|
|
980
1000
|
}
|
|
981
1001
|
],
|
|
982
1002
|
"--color-success-fg": [
|
|
983
1003
|
{
|
|
984
|
-
"props": ["color", "fill"],
|
|
1004
|
+
"props": ["color", "fill", "stroke"],
|
|
985
1005
|
"replacement": "--fgColor-success"
|
|
986
1006
|
},
|
|
987
1007
|
{
|
|
@@ -1007,6 +1027,10 @@
|
|
|
1007
1027
|
{
|
|
1008
1028
|
"props": ["border", "box-shadow"],
|
|
1009
1029
|
"replacement": "--borderColor-success-muted"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"props": ["background"],
|
|
1033
|
+
"replacement": "--bgColor-success-muted"
|
|
1010
1034
|
}
|
|
1011
1035
|
],
|
|
1012
1036
|
"--color-success-subtle": [
|
|
@@ -1035,7 +1059,7 @@
|
|
|
1035
1059
|
"replacement": "--borderColor-attention-emphasis"
|
|
1036
1060
|
},
|
|
1037
1061
|
{
|
|
1038
|
-
"props": ["color"],
|
|
1062
|
+
"props": ["color", "fill"],
|
|
1039
1063
|
"replacement": "--fgColor-attention"
|
|
1040
1064
|
}
|
|
1041
1065
|
],
|
|
@@ -1071,7 +1095,7 @@
|
|
|
1071
1095
|
"replacement": "--borderColor-severe-emphasis"
|
|
1072
1096
|
},
|
|
1073
1097
|
{
|
|
1074
|
-
"props": ["color"],
|
|
1098
|
+
"props": ["color", "fill", "stroke"],
|
|
1075
1099
|
"replacement": "--fgColor-severe"
|
|
1076
1100
|
}
|
|
1077
1101
|
],
|
|
@@ -1103,11 +1127,11 @@
|
|
|
1103
1127
|
"replacement": "--bgColor-danger-emphasis"
|
|
1104
1128
|
},
|
|
1105
1129
|
{
|
|
1106
|
-
"props": ["border", "box-shadow"],
|
|
1130
|
+
"props": ["border", "box-shadow", "outline"],
|
|
1107
1131
|
"replacement": "--borderColor-danger-emphasis"
|
|
1108
1132
|
},
|
|
1109
1133
|
{
|
|
1110
|
-
"props": ["color"],
|
|
1134
|
+
"props": ["color", "fill"],
|
|
1111
1135
|
"replacement": "--fgColor-danger"
|
|
1112
1136
|
}
|
|
1113
1137
|
],
|
|
@@ -1115,6 +1139,10 @@
|
|
|
1115
1139
|
{
|
|
1116
1140
|
"props": ["border", "box-shadow"],
|
|
1117
1141
|
"replacement": "--borderColor-danger-muted"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"props": ["background"],
|
|
1145
|
+
"replacement": "--bgColor-danger-muted"
|
|
1118
1146
|
}
|
|
1119
1147
|
],
|
|
1120
1148
|
"--color-danger-subtle": [
|
|
@@ -1215,7 +1243,7 @@
|
|
|
1215
1243
|
"replacement": "--borderColor-done-emphasis"
|
|
1216
1244
|
},
|
|
1217
1245
|
{
|
|
1218
|
-
"props": ["color"],
|
|
1246
|
+
"props": ["color", "fill", "stroke"],
|
|
1219
1247
|
"replacement": "--fgColor-done"
|
|
1220
1248
|
}
|
|
1221
1249
|
],
|
|
@@ -1223,6 +1251,10 @@
|
|
|
1223
1251
|
{
|
|
1224
1252
|
"props": ["border", "box-shadow"],
|
|
1225
1253
|
"replacement": "--borderColor-done-muted"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"props": ["background"],
|
|
1257
|
+
"replacement": "--bgColor-done-muted"
|
|
1226
1258
|
}
|
|
1227
1259
|
],
|
|
1228
1260
|
"--color-done-subtle": [
|
|
@@ -1297,7 +1329,7 @@
|
|
|
1297
1329
|
"replacement": "--avatar-shadow"
|
|
1298
1330
|
}
|
|
1299
1331
|
],
|
|
1300
|
-
"color-btn-text": [
|
|
1332
|
+
"--color-btn-text": [
|
|
1301
1333
|
{
|
|
1302
1334
|
"props": ["color"],
|
|
1303
1335
|
"replacement": "--button-default-fgColor-rest"
|
|
@@ -20,6 +20,8 @@ const replacedVars = {}
|
|
|
20
20
|
const newVars = {}
|
|
21
21
|
|
|
22
22
|
module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, context) => {
|
|
23
|
+
const {inlineFallback = false} = options
|
|
24
|
+
|
|
23
25
|
if (!enabled) {
|
|
24
26
|
return noop
|
|
25
27
|
}
|
|
@@ -67,7 +69,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
if (context.fix && replacement !== null) {
|
|
70
|
-
replacement = `${replacement}
|
|
72
|
+
replacement = `${replacement}${inlineFallback ? `, var(${variableName})` : ''}`
|
|
71
73
|
replacedVars[variableName] = true
|
|
72
74
|
newVars[replacement] = true
|
|
73
75
|
if (node.type === 'atrule') {
|