@primer/stylelint-config 12.7.1-rc.c4a4e27 → 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 CHANGED
@@ -4,12 +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
 
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
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
+
11
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
12
20
 
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`
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
+
13
25
  ## 12.7.0
14
26
 
15
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.c4a4e27",
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,9 +42,9 @@
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.8.3",
45
+ "@primer/primitives": "^7.11.11",
46
46
  "dedent": "0.7.0",
47
- "eslint": "8.22.0",
47
+ "eslint": "8.39.0",
48
48
  "eslint-plugin-github": "4.3.5",
49
49
  "eslint-plugin-jest": "27.0.1",
50
50
  "eslint-plugin-prettier": "4.2.1",
@@ -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'
@@ -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
  ],
@@ -604,7 +604,7 @@
604
604
  "--color-action-list-item-inline-divider": [
605
605
  {
606
606
  "props": ["border", "background"],
607
- "replacement": "--borderColor-decorative"
607
+ "replacement": "--borderColor-muted"
608
608
  }
609
609
  ],
610
610
  "--color-action-list-item-default-hover-bg": [
@@ -727,7 +727,12 @@
727
727
  "replacement": "--control-checked-fgColor-disabled"
728
728
  }
729
729
  ],
730
- "--color-switch-track-checked-border": [],
730
+ "--color-switch-track-checked-border": [
731
+ {
732
+ "props": ["border"],
733
+ "replacement": "--borderColor-transparent"
734
+ }
735
+ ],
731
736
  "--color-switch-knob-bg": [
732
737
  {
733
738
  "props": ["background"],
@@ -806,34 +811,59 @@
806
811
  "replacement": "--treeViewItem-leadingVisual-bgColor-rest"
807
812
  }
808
813
  ],
809
- "--color-canvas-default-transparent": [],
814
+ "--color-canvas-default-transparent": [
815
+ {
816
+ "props": ["background", "color"],
817
+ "replacement": "--bgColor-transparent"
818
+ },
819
+ {
820
+ "props": ["border"],
821
+ "replacement": "--borderColor-transparent"
822
+ }
823
+ ],
810
824
  "--color-fg-default": [
811
825
  {
812
826
  "props": ["color", "fill"],
813
827
  "replacement": "--fgColor-default"
828
+ },
829
+ {
830
+ "props": ["background"],
831
+ "replacement": "--fgColor-default"
814
832
  }
815
833
  ],
816
834
  "--color-fg-muted": [
817
835
  {
818
836
  "props": ["color", "fill"],
819
837
  "replacement": "--fgColor-muted"
838
+ },
839
+ {
840
+ "props": ["background"],
841
+ "replacement": "--bgColor-neutral-emphasis"
842
+ },
843
+ {
844
+ "props": ["border"],
845
+ "replacement": "--borderColor-neutral-emphasis"
820
846
  }
821
847
  ],
822
848
  "--color-fg-subtle": [
823
849
  {
824
850
  "props": ["color", "fill"],
825
851
  "replacement": "--fgColor-muted"
852
+ },
853
+ {
854
+ "props": ["border"],
855
+ "replacement": "--borderColor-neutral-emphasis"
826
856
  }
827
857
  ],
828
858
  "--color-fg-on-emphasis": [
829
859
  {
830
- "props": ["color", "fill"],
860
+ "props": ["color", "fill", "border"],
831
861
  "replacement": "--fgColor-onEmphasis"
832
862
  }
833
863
  ],
834
864
  "--color-canvas-default": [
835
865
  {
836
- "props": ["background"],
866
+ "props": ["background", "border", "box-shadow", "fill", "stroke"],
837
867
  "replacement": "--bgColor-default"
838
868
  }
839
869
  ],
@@ -851,31 +881,31 @@
851
881
  ],
852
882
  "--color-canvas-subtle": [
853
883
  {
854
- "props": ["background"],
884
+ "props": ["background", "fill", "border"],
855
885
  "replacement": "--bgColor-muted"
856
886
  }
857
887
  ],
858
888
  "--color-border-default": [
859
889
  {
860
- "props": ["border", "background", "box-shadow"],
890
+ "props": ["border", "background", "box-shadow", "stroke", "outline", "fill"],
861
891
  "replacement": "--borderColor-default"
862
892
  }
863
893
  ],
864
894
  "--color-border-muted": [
865
895
  {
866
- "props": ["border", "background"],
896
+ "props": ["border", "background", "outline", "box-shadow", "stroke"],
867
897
  "replacement": "--borderColor-muted"
868
898
  }
869
899
  ],
870
900
  "--color-border-subtle": [
871
901
  {
872
- "props": ["border", "background"],
902
+ "props": ["border", "background", "outline"],
873
903
  "replacement": "--borderColor-muted"
874
904
  }
875
905
  ],
876
906
  "--color-neutral-emphasis-plus": [
877
907
  {
878
- "props": ["background", "border", "color"],
908
+ "props": ["background", "border", "color", "stroke"],
879
909
  "replacement": "--bgColor-emphasis"
880
910
  }
881
911
  ],
@@ -885,13 +915,17 @@
885
915
  "replacement": "--bgColor-neutral-emphasis"
886
916
  },
887
917
  {
888
- "props": ["border"],
918
+ "props": ["border", "box-shadow"],
889
919
  "replacement": "--borderColor-neutral-emphasis"
920
+ },
921
+ {
922
+ "props": ["color", "fill"],
923
+ "replacement": "--fgColor-neutral"
890
924
  }
891
925
  ],
892
926
  "--color-neutral-muted": [
893
927
  {
894
- "props": ["border"],
928
+ "props": ["border", "box-shadow"],
895
929
  "replacement": "--borderColor-neutral-muted"
896
930
  },
897
931
  {
@@ -903,16 +937,28 @@
903
937
  {
904
938
  "props": ["background"],
905
939
  "replacement": "--bgColor-neutral-muted"
940
+ },
941
+ {
942
+ "props": ["border", "box-shadow"],
943
+ "replacement": "--borderColor-neutral-muted"
906
944
  }
907
945
  ],
908
946
  "--color-accent-fg": [
909
947
  {
910
- "props": ["color", "fill"],
948
+ "props": ["color", "fill", "stroke"],
911
949
  "replacement": "--fgColor-accent"
912
950
  },
913
951
  {
914
- "props": ["border"],
952
+ "props": ["border", "box-shadow"],
915
953
  "replacement": "--borderColor-accent-emphasis"
954
+ },
955
+ {
956
+ "props": ["background"],
957
+ "replacement": "--bgColor-accent-emphasis"
958
+ },
959
+ {
960
+ "props": ["outline"],
961
+ "replacement": "--focus-outlineColor"
916
962
  }
917
963
  ],
918
964
  "--color-accent-emphasis": [
@@ -921,30 +967,46 @@
921
967
  "replacement": "--bgColor-accent-emphasis"
922
968
  },
923
969
  {
924
- "props": ["border"],
970
+ "props": ["border", "box-shadow"],
925
971
  "replacement": "--borderColor-accent-emphasis"
926
972
  },
927
973
  {
928
- "props": ["color", "fill"],
974
+ "props": ["color", "fill", "stroke"],
929
975
  "replacement": "--fgColor-accent"
976
+ },
977
+ {
978
+ "props": ["outline"],
979
+ "replacement": "--focus-outlineColor"
930
980
  }
931
981
  ],
932
982
  "--color-accent-muted": [
933
983
  {
934
- "props": ["border"],
984
+ "props": ["border", "box-shadow"],
935
985
  "replacement": "--borderColor-accent-muted"
986
+ },
987
+ {
988
+ "props": ["background"],
989
+ "replacement": "--bgColor-accent-muted"
936
990
  }
937
991
  ],
938
992
  "--color-accent-subtle": [
939
993
  {
940
994
  "props": ["background"],
941
995
  "replacement": "--bgColor-accent-muted"
996
+ },
997
+ {
998
+ "props": ["border", "box-shadow"],
999
+ "replacement": "--borderColor-accent-muted"
942
1000
  }
943
1001
  ],
944
1002
  "--color-success-fg": [
945
1003
  {
946
- "props": ["color", "fill"],
1004
+ "props": ["color", "fill", "stroke"],
947
1005
  "replacement": "--fgColor-success"
1006
+ },
1007
+ {
1008
+ "props": ["background"],
1009
+ "replacement": "--bgColor-success-emphasis"
948
1010
  }
949
1011
  ],
950
1012
  "--color-success-emphasis": [
@@ -953,14 +1015,22 @@
953
1015
  "replacement": "--bgColor-success-emphasis"
954
1016
  },
955
1017
  {
956
- "props": ["border"],
1018
+ "props": ["border", "box-shadow"],
957
1019
  "replacement": "--borderColor-success-emphasis"
1020
+ },
1021
+ {
1022
+ "props": ["color"],
1023
+ "replacement": "--fgColor-success"
958
1024
  }
959
1025
  ],
960
1026
  "--color-success-muted": [
961
1027
  {
962
- "props": ["border"],
1028
+ "props": ["border", "box-shadow"],
963
1029
  "replacement": "--borderColor-success-muted"
1030
+ },
1031
+ {
1032
+ "props": ["background"],
1033
+ "replacement": "--bgColor-success-muted"
964
1034
  }
965
1035
  ],
966
1036
  "--color-success-subtle": [
@@ -973,6 +1043,10 @@
973
1043
  {
974
1044
  "props": ["color", "fill"],
975
1045
  "replacement": "--fgColor-attention"
1046
+ },
1047
+ {
1048
+ "props": ["background"],
1049
+ "replacement": "--bgColor-attention-emphasis"
976
1050
  }
977
1051
  ],
978
1052
  "--color-attention-emphasis": [
@@ -981,13 +1055,17 @@
981
1055
  "replacement": "--bgColor-attention-emphasis"
982
1056
  },
983
1057
  {
984
- "props": ["border"],
1058
+ "props": ["border", "box-shadow"],
985
1059
  "replacement": "--borderColor-attention-emphasis"
1060
+ },
1061
+ {
1062
+ "props": ["color", "fill"],
1063
+ "replacement": "--fgColor-attention"
986
1064
  }
987
1065
  ],
988
1066
  "--color-attention-muted": [
989
1067
  {
990
- "props": ["border"],
1068
+ "props": ["border", "box-shadow"],
991
1069
  "replacement": "--borderColor-attention-muted"
992
1070
  }
993
1071
  ],
@@ -1001,6 +1079,10 @@
1001
1079
  {
1002
1080
  "props": ["color", "fill"],
1003
1081
  "replacement": "--fgColor-severe"
1082
+ },
1083
+ {
1084
+ "props": ["background"],
1085
+ "replacement": "--bgColor-severe-emphasis"
1004
1086
  }
1005
1087
  ],
1006
1088
  "--color-severe-emphasis": [
@@ -1009,13 +1091,17 @@
1009
1091
  "replacement": "--bgColor-severe-emphasis"
1010
1092
  },
1011
1093
  {
1012
- "props": ["border"],
1094
+ "props": ["border", "box-shadow"],
1013
1095
  "replacement": "--borderColor-severe-emphasis"
1096
+ },
1097
+ {
1098
+ "props": ["color", "fill", "stroke"],
1099
+ "replacement": "--fgColor-severe"
1014
1100
  }
1015
1101
  ],
1016
1102
  "--color-severe-muted": [
1017
1103
  {
1018
- "props": ["border"],
1104
+ "props": ["border", "box-shadow"],
1019
1105
  "replacement": "--borderColor-severe-muted"
1020
1106
  }
1021
1107
  ],
@@ -1029,6 +1115,10 @@
1029
1115
  {
1030
1116
  "props": ["color", "fill"],
1031
1117
  "replacement": "--fgColor-danger"
1118
+ },
1119
+ {
1120
+ "props": ["background"],
1121
+ "replacement": "--bgColor-danger-emphasis"
1032
1122
  }
1033
1123
  ],
1034
1124
  "--color-danger-emphasis": [
@@ -1037,14 +1127,22 @@
1037
1127
  "replacement": "--bgColor-danger-emphasis"
1038
1128
  },
1039
1129
  {
1040
- "props": ["border"],
1130
+ "props": ["border", "box-shadow", "outline"],
1041
1131
  "replacement": "--borderColor-danger-emphasis"
1132
+ },
1133
+ {
1134
+ "props": ["color", "fill"],
1135
+ "replacement": "--fgColor-danger"
1042
1136
  }
1043
1137
  ],
1044
1138
  "--color-danger-muted": [
1045
1139
  {
1046
- "props": ["border"],
1140
+ "props": ["border", "box-shadow"],
1047
1141
  "replacement": "--borderColor-danger-muted"
1142
+ },
1143
+ {
1144
+ "props": ["background"],
1145
+ "replacement": "--bgColor-danger-muted"
1048
1146
  }
1049
1147
  ],
1050
1148
  "--color-danger-subtle": [
@@ -1057,6 +1155,10 @@
1057
1155
  {
1058
1156
  "props": ["color", "fill"],
1059
1157
  "replacement": "--fgColor-open"
1158
+ },
1159
+ {
1160
+ "props": ["background"],
1161
+ "replacement": "--bgColor-open-emphasis"
1060
1162
  }
1061
1163
  ],
1062
1164
  "--color-open-emphasis": [
@@ -1065,13 +1167,17 @@
1065
1167
  "replacement": "--bgColor-open-emphasis"
1066
1168
  },
1067
1169
  {
1068
- "props": ["border"],
1170
+ "props": ["border", "box-shadow"],
1069
1171
  "replacement": "--borderColor-open-emphasis"
1172
+ },
1173
+ {
1174
+ "props": ["color"],
1175
+ "replacement": "--fgColor-open"
1070
1176
  }
1071
1177
  ],
1072
1178
  "--color-open-muted": [
1073
1179
  {
1074
- "props": ["border"],
1180
+ "props": ["border", "box-shadow"],
1075
1181
  "replacement": "--borderColor-open-muted"
1076
1182
  }
1077
1183
  ],
@@ -1085,6 +1191,10 @@
1085
1191
  {
1086
1192
  "props": ["color", "fill"],
1087
1193
  "replacement": "--fgColor-closed"
1194
+ },
1195
+ {
1196
+ "props": ["background"],
1197
+ "replacement": "--bgColor-closed-emphasis"
1088
1198
  }
1089
1199
  ],
1090
1200
  "--color-closed-emphasis": [
@@ -1093,13 +1203,17 @@
1093
1203
  "replacement": "--bgColor-closed-emphasis"
1094
1204
  },
1095
1205
  {
1096
- "props": ["border"],
1206
+ "props": ["border", "box-shadow"],
1097
1207
  "replacement": "--borderColor-closed-emphasis"
1208
+ },
1209
+ {
1210
+ "props": ["color"],
1211
+ "replacement": "--fgColor-closed"
1098
1212
  }
1099
1213
  ],
1100
1214
  "--color-closed-muted": [
1101
1215
  {
1102
- "props": ["border"],
1216
+ "props": ["border", "box-shadow"],
1103
1217
  "replacement": "--borderColor-closed-muted"
1104
1218
  }
1105
1219
  ],
@@ -1113,6 +1227,10 @@
1113
1227
  {
1114
1228
  "props": ["color", "fill"],
1115
1229
  "replacement": "--fgColor-done"
1230
+ },
1231
+ {
1232
+ "props": ["background"],
1233
+ "replacement": "--bgColor-done-emphasis"
1116
1234
  }
1117
1235
  ],
1118
1236
  "--color-done-emphasis": [
@@ -1121,14 +1239,22 @@
1121
1239
  "replacement": "--bgColor-done-emphasis"
1122
1240
  },
1123
1241
  {
1124
- "props": ["border"],
1242
+ "props": ["border", "box-shadow"],
1125
1243
  "replacement": "--borderColor-done-emphasis"
1244
+ },
1245
+ {
1246
+ "props": ["color", "fill", "stroke"],
1247
+ "replacement": "--fgColor-done"
1126
1248
  }
1127
1249
  ],
1128
1250
  "--color-done-muted": [
1129
1251
  {
1130
- "props": ["border"],
1252
+ "props": ["border", "box-shadow"],
1131
1253
  "replacement": "--borderColor-done-muted"
1254
+ },
1255
+ {
1256
+ "props": ["background"],
1257
+ "replacement": "--bgColor-done-muted"
1132
1258
  }
1133
1259
  ],
1134
1260
  "--color-done-subtle": [
@@ -1141,6 +1267,10 @@
1141
1267
  {
1142
1268
  "props": ["color", "fill"],
1143
1269
  "replacement": "--fgColor-sponsors"
1270
+ },
1271
+ {
1272
+ "props": ["background"],
1273
+ "replacement": "--bgColor-sponsors-emphasis"
1144
1274
  }
1145
1275
  ],
1146
1276
  "--color-sponsors-emphasis": [
@@ -1149,13 +1279,17 @@
1149
1279
  "replacement": "--bgColor-sponsors-emphasis"
1150
1280
  },
1151
1281
  {
1152
- "props": ["border"],
1282
+ "props": ["border", "box-shadow"],
1153
1283
  "replacement": "--borderColor-sponsors-emphasis"
1284
+ },
1285
+ {
1286
+ "props": ["color"],
1287
+ "replacement": "--fgColor-sponsors"
1154
1288
  }
1155
1289
  ],
1156
1290
  "--color-sponsors-muted": [
1157
1291
  {
1158
- "props": ["border"],
1292
+ "props": ["border", "box-shadow"],
1159
1293
  "replacement": "--borderColor-sponsors-muted"
1160
1294
  }
1161
1295
  ],
@@ -1195,6 +1329,12 @@
1195
1329
  "replacement": "--avatar-shadow"
1196
1330
  }
1197
1331
  ],
1332
+ "--color-btn-text": [
1333
+ {
1334
+ "props": ["color"],
1335
+ "replacement": "--button-default-fgColor-rest"
1336
+ }
1337
+ ],
1198
1338
  "--color-btn-shadow": [
1199
1339
  {
1200
1340
  "props": ["box-shadow"],
@@ -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
  }
@@ -44,14 +46,11 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
44
46
  }
45
47
 
46
48
  // walk these nodes
47
- if (!(node.type === 'decl' || node.type === 'atrule')) {
49
+ if (node.type !== 'decl') {
48
50
  return
49
51
  }
50
52
 
51
- for (const [, variableName] of matchAll(
52
- node.type === 'atrule' ? node.params : node.value,
53
- variableReferenceRegex
54
- )) {
53
+ for (const [, variableName] of matchAll(node.value, variableReferenceRegex)) {
55
54
  if (variableName in variableChecks) {
56
55
  let replacement = variableChecks[variableName]
57
56
  if (typeof replacement === 'object') {
@@ -70,7 +69,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
70
69
  }
71
70
 
72
71
  if (context.fix && replacement !== null) {
73
- replacement = `${replacement}, var(${variableName})`
72
+ replacement = `${replacement}${inlineFallback ? `, var(${variableName})` : ''}`
74
73
  replacedVars[variableName] = true
75
74
  newVars[replacement] = true
76
75
  if (node.type === 'atrule') {