@primer/stylelint-config 13.0.0-rc.99be5f2 → 13.0.0-rc.b40b184
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/README.md +0 -1
- package/dist/index.cjs +19 -600
- package/dist/index.mjs +19 -600
- package/package.json +1 -1
- package/plugins/README.md +0 -26
- package/plugins/lib/primer-utilities.js +0 -526
- package/plugins/utilities.js +0 -52
package/dist/index.mjs
CHANGED
|
@@ -419,7 +419,7 @@ function closest(node, test) {
|
|
|
419
419
|
function createVariableRule(ruleName, rules, url) {
|
|
420
420
|
const plugin = stylelint.createPlugin(ruleName, (enabled, options = {}, context) => {
|
|
421
421
|
if (enabled === false) {
|
|
422
|
-
return noop$
|
|
422
|
+
return noop$2
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
let actualRules = rules;
|
|
@@ -496,7 +496,7 @@ function createVariableRule(ruleName, rules, url) {
|
|
|
496
496
|
return plugin
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
function noop$
|
|
499
|
+
function noop$2() {}
|
|
500
500
|
|
|
501
501
|
var borders = createVariableRule(
|
|
502
502
|
'primer/borders',
|
|
@@ -624,9 +624,9 @@ var colors = createVariableRule(
|
|
|
624
624
|
'https://primer.style/primitives/colors',
|
|
625
625
|
);
|
|
626
626
|
|
|
627
|
-
const ruleName$
|
|
627
|
+
const ruleName$2 = 'primer/responsive-widths';
|
|
628
628
|
|
|
629
|
-
const messages$
|
|
629
|
+
const messages$2 = stylelint.utils.ruleMessages(ruleName$2, {
|
|
630
630
|
rejected: value => {
|
|
631
631
|
return `A value larger than the smallest viewport could break responsive pages. Use a width value smaller than ${value}. https://primer.style/css/support/breakpoints`
|
|
632
632
|
},
|
|
@@ -646,9 +646,9 @@ const walkGroups$1 = (root, validate) => {
|
|
|
646
646
|
};
|
|
647
647
|
|
|
648
648
|
// eslint-disable-next-line no-unused-vars
|
|
649
|
-
var responsiveWidths = stylelint.createPlugin(ruleName$
|
|
649
|
+
var responsiveWidths = stylelint.createPlugin(ruleName$2, (enabled, options = {}, context) => {
|
|
650
650
|
if (!enabled) {
|
|
651
|
-
return noop$
|
|
651
|
+
return noop$1
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
const lintResult = (root, result) => {
|
|
@@ -659,7 +659,7 @@ var responsiveWidths = stylelint.createPlugin(ruleName$3, (enabled, options = {}
|
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
if (decl.type !== 'decl' || !decl.prop.match(/^(min-width|width)/)) {
|
|
662
|
-
return noop$
|
|
662
|
+
return noop$1
|
|
663
663
|
}
|
|
664
664
|
|
|
665
665
|
const problems = [];
|
|
@@ -682,7 +682,7 @@ var responsiveWidths = stylelint.createPlugin(ruleName$3, (enabled, options = {}
|
|
|
682
682
|
if (parseInt(valueUnit.number) > 320) {
|
|
683
683
|
problems.push({
|
|
684
684
|
index: declarationValueIndex(decl) + node.sourceIndex,
|
|
685
|
-
message: messages$
|
|
685
|
+
message: messages$2.rejected(node.value),
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
break
|
|
@@ -690,7 +690,7 @@ var responsiveWidths = stylelint.createPlugin(ruleName$3, (enabled, options = {}
|
|
|
690
690
|
if (parseInt(valueUnit.number) > 100) {
|
|
691
691
|
problems.push({
|
|
692
692
|
index: declarationValueIndex(decl) + node.sourceIndex,
|
|
693
|
-
message: messages$
|
|
693
|
+
message: messages$2.rejected(node.value),
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
break
|
|
@@ -704,7 +704,7 @@ var responsiveWidths = stylelint.createPlugin(ruleName$3, (enabled, options = {}
|
|
|
704
704
|
message: err.message,
|
|
705
705
|
node: decl,
|
|
706
706
|
result,
|
|
707
|
-
ruleName: ruleName$
|
|
707
|
+
ruleName: ruleName$2,
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
710
|
}
|
|
@@ -714,7 +714,7 @@ var responsiveWidths = stylelint.createPlugin(ruleName$3, (enabled, options = {}
|
|
|
714
714
|
return lintResult
|
|
715
715
|
});
|
|
716
716
|
|
|
717
|
-
function noop$
|
|
717
|
+
function noop$1() {}
|
|
718
718
|
|
|
719
719
|
const require$1 = createRequire(import.meta.url);
|
|
720
720
|
|
|
@@ -764,8 +764,8 @@ const walkGroups = (root, validate) => {
|
|
|
764
764
|
return root
|
|
765
765
|
};
|
|
766
766
|
|
|
767
|
-
const ruleName$
|
|
768
|
-
const messages$
|
|
767
|
+
const ruleName$1 = 'primer/spacing';
|
|
768
|
+
const messages$1 = ruleMessages(ruleName$1, {
|
|
769
769
|
rejected: (value, replacement) => {
|
|
770
770
|
if (!replacement) {
|
|
771
771
|
return `Please use a primer size variable instead of '${value}'. Consult the primer docs for a suitable replacement. https://primer.style/foundations/primitives/size`
|
|
@@ -789,7 +789,7 @@ const ruleFunction = (primary, secondaryOptions, context) => {
|
|
|
789
789
|
|
|
790
790
|
const sizes = await primitivesVariables('size');
|
|
791
791
|
|
|
792
|
-
const validOptions = validateOptions(result, ruleName$
|
|
792
|
+
const validOptions = validateOptions(result, ruleName$1, {
|
|
793
793
|
actual: primary,
|
|
794
794
|
possible: [true],
|
|
795
795
|
});
|
|
@@ -844,7 +844,7 @@ const ruleFunction = (primary, secondaryOptions, context) => {
|
|
|
844
844
|
problems.push({
|
|
845
845
|
index: declarationValueIndex(declNode) + node.sourceIndex,
|
|
846
846
|
endIndex: declarationValueIndex(declNode) + node.sourceIndex + node.value.length,
|
|
847
|
-
message: messages$
|
|
847
|
+
message: messages$1.rejected(node.value, replacement),
|
|
848
848
|
});
|
|
849
849
|
}
|
|
850
850
|
|
|
@@ -863,7 +863,7 @@ const ruleFunction = (primary, secondaryOptions, context) => {
|
|
|
863
863
|
message: err.message,
|
|
864
864
|
node: declNode,
|
|
865
865
|
result,
|
|
866
|
-
ruleName: ruleName$
|
|
866
|
+
ruleName: ruleName$1,
|
|
867
867
|
});
|
|
868
868
|
}
|
|
869
869
|
}
|
|
@@ -871,11 +871,11 @@ const ruleFunction = (primary, secondaryOptions, context) => {
|
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
873
|
|
|
874
|
-
ruleFunction.ruleName = ruleName$
|
|
875
|
-
ruleFunction.messages = messages$
|
|
874
|
+
ruleFunction.ruleName = ruleName$1;
|
|
875
|
+
ruleFunction.messages = messages$1;
|
|
876
876
|
ruleFunction.meta = meta;
|
|
877
877
|
|
|
878
|
-
var spacing = createPlugin(ruleName$
|
|
878
|
+
var spacing = createPlugin(ruleName$1, ruleFunction);
|
|
879
879
|
|
|
880
880
|
var typography = createVariableRule(
|
|
881
881
|
'primer/typography',
|
|
@@ -900,583 +900,6 @@ var typography = createVariableRule(
|
|
|
900
900
|
'https://primer.style/css/utilities/typography',
|
|
901
901
|
);
|
|
902
902
|
|
|
903
|
-
// Meant as temp until we can move to primitives or css
|
|
904
|
-
const colorTypes = ['accent', 'success', 'attention', 'severe', 'danger', 'open', 'closed', 'done', 'sponsors'];
|
|
905
|
-
|
|
906
|
-
var utilities$1 = {
|
|
907
|
-
color: [
|
|
908
|
-
{
|
|
909
|
-
value: 'var(--color-fg-default)',
|
|
910
|
-
utilityClass: 'color-fg-default',
|
|
911
|
-
},
|
|
912
|
-
{
|
|
913
|
-
value: 'var(--color-fg-muted)',
|
|
914
|
-
utilityClass: 'color-fg-muted',
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
value: 'var(--color-fg-subtle)',
|
|
918
|
-
utilityClass: 'color-fg-subtle',
|
|
919
|
-
},
|
|
920
|
-
].concat(
|
|
921
|
-
colorTypes.map(type => {
|
|
922
|
-
return {
|
|
923
|
-
value: `var(--color-${type}-fg)`,
|
|
924
|
-
utilityClass: `color-fg-${type}`,
|
|
925
|
-
}
|
|
926
|
-
}),
|
|
927
|
-
),
|
|
928
|
-
'background-color': [
|
|
929
|
-
{
|
|
930
|
-
value: 'var(--color-canvas-default)',
|
|
931
|
-
utilityClass: 'color-bg-default',
|
|
932
|
-
},
|
|
933
|
-
{
|
|
934
|
-
value: 'var(--color-canvas-overlay)',
|
|
935
|
-
utilityClass: 'color-bg-overlay',
|
|
936
|
-
},
|
|
937
|
-
{
|
|
938
|
-
value: 'var(--color-canvas-inset)',
|
|
939
|
-
utilityClass: 'color-bg-inset',
|
|
940
|
-
},
|
|
941
|
-
{
|
|
942
|
-
value: 'var(--color-canvas-subtle)',
|
|
943
|
-
utilityClass: 'color-bg-subtle',
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
value: 'transparent',
|
|
947
|
-
utilityClass: 'color-bg-transparent',
|
|
948
|
-
},
|
|
949
|
-
]
|
|
950
|
-
.concat(
|
|
951
|
-
colorTypes.map(type => {
|
|
952
|
-
return {
|
|
953
|
-
value: `var(--color-${type}-subtle)`,
|
|
954
|
-
utilityClass: `color-bg-${type}`,
|
|
955
|
-
}
|
|
956
|
-
}),
|
|
957
|
-
)
|
|
958
|
-
.concat(
|
|
959
|
-
colorTypes.map(type => {
|
|
960
|
-
return {
|
|
961
|
-
value: `var(--color-${type}-emphasis)`,
|
|
962
|
-
utilityClass: `color-bg-${type}-emphasis`,
|
|
963
|
-
}
|
|
964
|
-
}),
|
|
965
|
-
),
|
|
966
|
-
'border-color': [
|
|
967
|
-
{
|
|
968
|
-
value: 'var(--color-border-default',
|
|
969
|
-
utilityClass: 'color-border-default',
|
|
970
|
-
},
|
|
971
|
-
{
|
|
972
|
-
value: 'var(--color-border-muted',
|
|
973
|
-
utilityClass: 'color-border-muted',
|
|
974
|
-
},
|
|
975
|
-
{
|
|
976
|
-
value: 'var(--color-border-subtle',
|
|
977
|
-
utilityClass: 'color-border-subtle',
|
|
978
|
-
},
|
|
979
|
-
]
|
|
980
|
-
.concat(
|
|
981
|
-
colorTypes.map(type => {
|
|
982
|
-
return {
|
|
983
|
-
value: `var(--color-${type}-muted)`,
|
|
984
|
-
utilityClass: `color-border-${type}`,
|
|
985
|
-
}
|
|
986
|
-
}),
|
|
987
|
-
)
|
|
988
|
-
.concat(
|
|
989
|
-
colorTypes.map(type => {
|
|
990
|
-
return {
|
|
991
|
-
value: `var(--color-${type}-emphasis)`,
|
|
992
|
-
utilityClass: `color-border-${type}-emphasis`,
|
|
993
|
-
}
|
|
994
|
-
}),
|
|
995
|
-
),
|
|
996
|
-
margin: Array.from(new Array(6)).map((_, i) => {
|
|
997
|
-
return {
|
|
998
|
-
value: `$spacer-${i + 1}`,
|
|
999
|
-
utilityClass: `m-${i + 1}`,
|
|
1000
|
-
}
|
|
1001
|
-
}),
|
|
1002
|
-
'margin-top': Array.from(new Array(6)).map((_, i) => {
|
|
1003
|
-
return {
|
|
1004
|
-
value: `$spacer-${i + 1}`,
|
|
1005
|
-
utilityClass: `mt-${i + 1}`,
|
|
1006
|
-
}
|
|
1007
|
-
}),
|
|
1008
|
-
'margin-right': Array.from(new Array(6)).map((_, i) => {
|
|
1009
|
-
return {
|
|
1010
|
-
value: `$spacer-${i + 1}`,
|
|
1011
|
-
utilityClass: `mr-${i + 1}`,
|
|
1012
|
-
}
|
|
1013
|
-
}),
|
|
1014
|
-
'margin-bottom': Array.from(new Array(6)).map((_, i) => {
|
|
1015
|
-
return {
|
|
1016
|
-
value: `$spacer-${i + 1}`,
|
|
1017
|
-
utilityClass: `mb-${i + 1}`,
|
|
1018
|
-
}
|
|
1019
|
-
}),
|
|
1020
|
-
'margin-left': Array.from(new Array(6)).map((_, i) => {
|
|
1021
|
-
return {
|
|
1022
|
-
value: `$spacer-${i + 1}`,
|
|
1023
|
-
utilityClass: `ml-${i + 1}`,
|
|
1024
|
-
}
|
|
1025
|
-
}),
|
|
1026
|
-
padding: Array.from(new Array(6)).map((_, i) => {
|
|
1027
|
-
return {
|
|
1028
|
-
value: `$spacer-${i + 1}`,
|
|
1029
|
-
utilityClass: `p-${i + 1}`,
|
|
1030
|
-
}
|
|
1031
|
-
}),
|
|
1032
|
-
'padding-top': Array.from(new Array(6)).map((_, i) => {
|
|
1033
|
-
return {
|
|
1034
|
-
value: `$spacer-${i + 1}`,
|
|
1035
|
-
utilityClass: `pt-${i + 1}`,
|
|
1036
|
-
}
|
|
1037
|
-
}),
|
|
1038
|
-
'padding-right': Array.from(new Array(6)).map((_, i) => {
|
|
1039
|
-
return {
|
|
1040
|
-
value: `$spacer-${i + 1}`,
|
|
1041
|
-
utilityClass: `pr-${i + 1}`,
|
|
1042
|
-
}
|
|
1043
|
-
}),
|
|
1044
|
-
'padding-bottom': Array.from(new Array(6)).map((_, i) => {
|
|
1045
|
-
return {
|
|
1046
|
-
value: `$spacer-${i + 1}`,
|
|
1047
|
-
utilityClass: `pb-${i + 1}`,
|
|
1048
|
-
}
|
|
1049
|
-
}),
|
|
1050
|
-
'padding-left': Array.from(new Array(6)).map((_, i) => {
|
|
1051
|
-
return {
|
|
1052
|
-
value: `$spacer-${i + 1}`,
|
|
1053
|
-
utilityClass: `pl-${i + 1}`,
|
|
1054
|
-
}
|
|
1055
|
-
}),
|
|
1056
|
-
'line-height': [
|
|
1057
|
-
{
|
|
1058
|
-
value: '$lh-condensed-ultra',
|
|
1059
|
-
utilityClass: 'lh-condensed-ultra',
|
|
1060
|
-
},
|
|
1061
|
-
{
|
|
1062
|
-
value: '$lh-condensed',
|
|
1063
|
-
utilityClass: 'lh-condensed',
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
value: '$lh-default',
|
|
1067
|
-
utilityClass: 'lh-default',
|
|
1068
|
-
},
|
|
1069
|
-
{
|
|
1070
|
-
value: '0',
|
|
1071
|
-
utilityClass: 'lh-0',
|
|
1072
|
-
},
|
|
1073
|
-
],
|
|
1074
|
-
'text-align': [
|
|
1075
|
-
{
|
|
1076
|
-
value: 'left',
|
|
1077
|
-
utilityClass: 'text-left',
|
|
1078
|
-
},
|
|
1079
|
-
{
|
|
1080
|
-
value: 'right',
|
|
1081
|
-
utilityClass: 'text-right',
|
|
1082
|
-
},
|
|
1083
|
-
{
|
|
1084
|
-
value: 'center',
|
|
1085
|
-
utilityClass: 'text-center',
|
|
1086
|
-
},
|
|
1087
|
-
],
|
|
1088
|
-
'font-style': [
|
|
1089
|
-
{
|
|
1090
|
-
value: 'italic',
|
|
1091
|
-
utilityClass: 'text-italic',
|
|
1092
|
-
},
|
|
1093
|
-
],
|
|
1094
|
-
'text-transform': [
|
|
1095
|
-
{
|
|
1096
|
-
value: 'uppercase',
|
|
1097
|
-
utilityClass: 'text-uppercase',
|
|
1098
|
-
},
|
|
1099
|
-
],
|
|
1100
|
-
'text-decoration': [
|
|
1101
|
-
{
|
|
1102
|
-
value: 'underline',
|
|
1103
|
-
utilityClass: 'text-underline',
|
|
1104
|
-
},
|
|
1105
|
-
{
|
|
1106
|
-
value: 'none',
|
|
1107
|
-
utilityClass: 'no-underline',
|
|
1108
|
-
},
|
|
1109
|
-
],
|
|
1110
|
-
'white-space': [
|
|
1111
|
-
{
|
|
1112
|
-
value: 'nowrap',
|
|
1113
|
-
utilityClass: 'no-wrap',
|
|
1114
|
-
},
|
|
1115
|
-
{
|
|
1116
|
-
value: 'normal',
|
|
1117
|
-
utilityClass: 'ws-normal',
|
|
1118
|
-
},
|
|
1119
|
-
],
|
|
1120
|
-
'word-break': [
|
|
1121
|
-
{
|
|
1122
|
-
value: 'break-all',
|
|
1123
|
-
utilityClass: 'wb-break-all',
|
|
1124
|
-
},
|
|
1125
|
-
],
|
|
1126
|
-
width: [
|
|
1127
|
-
{
|
|
1128
|
-
value: '100%',
|
|
1129
|
-
utilityClass: 'width-full',
|
|
1130
|
-
},
|
|
1131
|
-
{
|
|
1132
|
-
value: 'auto%',
|
|
1133
|
-
utilityClass: 'width-auto',
|
|
1134
|
-
},
|
|
1135
|
-
],
|
|
1136
|
-
overflow: [
|
|
1137
|
-
{
|
|
1138
|
-
value: 'visible',
|
|
1139
|
-
utilityClass: 'overflow-visible',
|
|
1140
|
-
},
|
|
1141
|
-
{
|
|
1142
|
-
value: 'hidden',
|
|
1143
|
-
utilityClass: 'overflow-hidden',
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
value: 'auto',
|
|
1147
|
-
utilityClass: 'overflow-auto',
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
value: 'scroll',
|
|
1151
|
-
utilityClass: 'overflow-scroll',
|
|
1152
|
-
},
|
|
1153
|
-
],
|
|
1154
|
-
'overflow-x': [
|
|
1155
|
-
{
|
|
1156
|
-
value: 'visible',
|
|
1157
|
-
utilityClass: 'overflow-x-visible',
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
value: 'hidden',
|
|
1161
|
-
utilityClass: 'overflow-x-hidden',
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
value: 'auto',
|
|
1165
|
-
utilityClass: 'overflow-x-auto',
|
|
1166
|
-
},
|
|
1167
|
-
{
|
|
1168
|
-
value: 'scroll',
|
|
1169
|
-
utilityClass: 'overflow-x-scroll',
|
|
1170
|
-
},
|
|
1171
|
-
],
|
|
1172
|
-
'overflow-y': [
|
|
1173
|
-
{
|
|
1174
|
-
value: 'visible',
|
|
1175
|
-
utilityClass: 'overflow-y-visible',
|
|
1176
|
-
},
|
|
1177
|
-
{
|
|
1178
|
-
value: 'hidden',
|
|
1179
|
-
utilityClass: 'overflow-y-hidden',
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
value: 'auto',
|
|
1183
|
-
utilityClass: 'overflow-y-auto',
|
|
1184
|
-
},
|
|
1185
|
-
{
|
|
1186
|
-
value: 'scroll',
|
|
1187
|
-
utilityClass: 'overflow-y-scroll',
|
|
1188
|
-
},
|
|
1189
|
-
],
|
|
1190
|
-
height: [
|
|
1191
|
-
{
|
|
1192
|
-
value: '100%',
|
|
1193
|
-
utilityClass: 'height-full',
|
|
1194
|
-
},
|
|
1195
|
-
],
|
|
1196
|
-
'max-width': [
|
|
1197
|
-
{
|
|
1198
|
-
value: '100%',
|
|
1199
|
-
utilityClass: 'width-fit',
|
|
1200
|
-
},
|
|
1201
|
-
],
|
|
1202
|
-
'max-height': [
|
|
1203
|
-
{
|
|
1204
|
-
value: '100%',
|
|
1205
|
-
utilityClass: 'height-fit',
|
|
1206
|
-
},
|
|
1207
|
-
],
|
|
1208
|
-
'min-width': [
|
|
1209
|
-
{
|
|
1210
|
-
value: '0',
|
|
1211
|
-
utilityClass: 'min-width-0',
|
|
1212
|
-
},
|
|
1213
|
-
],
|
|
1214
|
-
float: [
|
|
1215
|
-
{
|
|
1216
|
-
value: 'left',
|
|
1217
|
-
utilityClass: 'float-left',
|
|
1218
|
-
},
|
|
1219
|
-
{
|
|
1220
|
-
value: 'right',
|
|
1221
|
-
utilityClass: 'float-right',
|
|
1222
|
-
},
|
|
1223
|
-
{
|
|
1224
|
-
value: 'none',
|
|
1225
|
-
utilityClass: 'float-none',
|
|
1226
|
-
},
|
|
1227
|
-
],
|
|
1228
|
-
'list-style': [
|
|
1229
|
-
{
|
|
1230
|
-
value: 'none',
|
|
1231
|
-
utilityClass: 'list-style-none',
|
|
1232
|
-
},
|
|
1233
|
-
],
|
|
1234
|
-
'user-select': [
|
|
1235
|
-
{
|
|
1236
|
-
value: 'none',
|
|
1237
|
-
utilityClass: 'user-select-none',
|
|
1238
|
-
},
|
|
1239
|
-
],
|
|
1240
|
-
visibility: [
|
|
1241
|
-
{
|
|
1242
|
-
value: 'hidden',
|
|
1243
|
-
utilityClass: 'v-hidden',
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
value: 'visible',
|
|
1247
|
-
utilityClass: 'v-visible',
|
|
1248
|
-
},
|
|
1249
|
-
],
|
|
1250
|
-
'vertical-align': [
|
|
1251
|
-
{
|
|
1252
|
-
value: 'middle',
|
|
1253
|
-
utilityClass: 'v-align-middle',
|
|
1254
|
-
},
|
|
1255
|
-
{
|
|
1256
|
-
value: 'top',
|
|
1257
|
-
utilityClass: 'v-align-top',
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
value: 'bottom',
|
|
1261
|
-
utilityClass: 'v-align-bottom',
|
|
1262
|
-
},
|
|
1263
|
-
{
|
|
1264
|
-
value: 'text-top',
|
|
1265
|
-
utilityClass: 'v-align-text-top',
|
|
1266
|
-
},
|
|
1267
|
-
{
|
|
1268
|
-
value: 'text-bottom',
|
|
1269
|
-
utilityClass: 'v-align-text-bottom',
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
value: 'text-baseline',
|
|
1273
|
-
utilityClass: 'v-align-baseline',
|
|
1274
|
-
},
|
|
1275
|
-
],
|
|
1276
|
-
'font-weight': [
|
|
1277
|
-
{
|
|
1278
|
-
value: '$font-weight-normal',
|
|
1279
|
-
utilityClass: 'text-normal',
|
|
1280
|
-
},
|
|
1281
|
-
{
|
|
1282
|
-
value: '$font-weight-bold',
|
|
1283
|
-
utilityClass: 'text-bold',
|
|
1284
|
-
},
|
|
1285
|
-
{
|
|
1286
|
-
value: '$font-weight-semibold',
|
|
1287
|
-
utilityClass: 'text-semibold',
|
|
1288
|
-
},
|
|
1289
|
-
{
|
|
1290
|
-
value: '$font-weight-light',
|
|
1291
|
-
utilityClass: 'text-light',
|
|
1292
|
-
},
|
|
1293
|
-
],
|
|
1294
|
-
top: [
|
|
1295
|
-
{
|
|
1296
|
-
value: '0',
|
|
1297
|
-
utilityClass: 'top-0',
|
|
1298
|
-
},
|
|
1299
|
-
{
|
|
1300
|
-
value: 'auto',
|
|
1301
|
-
utilityClass: 'top-auto',
|
|
1302
|
-
},
|
|
1303
|
-
],
|
|
1304
|
-
right: [
|
|
1305
|
-
{
|
|
1306
|
-
value: '0',
|
|
1307
|
-
utilityClass: 'right-0',
|
|
1308
|
-
},
|
|
1309
|
-
{
|
|
1310
|
-
value: 'auto',
|
|
1311
|
-
utilityClass: 'right-auto',
|
|
1312
|
-
},
|
|
1313
|
-
],
|
|
1314
|
-
bottom: [
|
|
1315
|
-
{
|
|
1316
|
-
value: '0',
|
|
1317
|
-
utilityClass: 'bottom-0',
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
value: 'auto',
|
|
1321
|
-
utilityClass: 'bottom-auto',
|
|
1322
|
-
},
|
|
1323
|
-
],
|
|
1324
|
-
left: [
|
|
1325
|
-
{
|
|
1326
|
-
value: '0',
|
|
1327
|
-
utilityClass: 'left-0',
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
value: 'auto',
|
|
1331
|
-
utilityClass: 'left-auto',
|
|
1332
|
-
},
|
|
1333
|
-
],
|
|
1334
|
-
position: [
|
|
1335
|
-
{
|
|
1336
|
-
value: 'static',
|
|
1337
|
-
utilityClass: 'position-static',
|
|
1338
|
-
},
|
|
1339
|
-
{
|
|
1340
|
-
value: 'relative',
|
|
1341
|
-
utilityClass: 'position-relative',
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
value: 'absolute',
|
|
1345
|
-
utilityClass: 'position-absolute',
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
value: 'fixed',
|
|
1349
|
-
utilityClass: 'position-fixed',
|
|
1350
|
-
},
|
|
1351
|
-
{
|
|
1352
|
-
value: 'sticky',
|
|
1353
|
-
utilityClass: 'position-sticky',
|
|
1354
|
-
},
|
|
1355
|
-
],
|
|
1356
|
-
'box-shadow': [
|
|
1357
|
-
{
|
|
1358
|
-
value: 'none',
|
|
1359
|
-
utilityClass: 'box-shadow-none',
|
|
1360
|
-
},
|
|
1361
|
-
{
|
|
1362
|
-
value: 'var(--color-shadow-small)',
|
|
1363
|
-
utilityClass: 'box-shadow-small',
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
value: 'var(--color-shadow-medium)',
|
|
1367
|
-
utilityClass: 'box-shadow-medium',
|
|
1368
|
-
},
|
|
1369
|
-
{
|
|
1370
|
-
value: 'var(--color-shadow-large)',
|
|
1371
|
-
utilityClass: 'box-shadow-large',
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
value: 'var(--color-shadow-extra-large)',
|
|
1375
|
-
utilityClass: 'box-shadow-extra-large',
|
|
1376
|
-
},
|
|
1377
|
-
],
|
|
1378
|
-
border: [
|
|
1379
|
-
{
|
|
1380
|
-
value: '$border',
|
|
1381
|
-
utilityClass: 'border',
|
|
1382
|
-
},
|
|
1383
|
-
{
|
|
1384
|
-
value: '0',
|
|
1385
|
-
utilityClass: 'border-0',
|
|
1386
|
-
},
|
|
1387
|
-
],
|
|
1388
|
-
'border-top': [
|
|
1389
|
-
{
|
|
1390
|
-
value: '$border',
|
|
1391
|
-
utilityClass: 'border-top',
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
value: '0',
|
|
1395
|
-
utilityClass: 'border-top-0',
|
|
1396
|
-
},
|
|
1397
|
-
],
|
|
1398
|
-
'border-right': [
|
|
1399
|
-
{
|
|
1400
|
-
value: '$border',
|
|
1401
|
-
utilityClass: 'border-right',
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
value: '0',
|
|
1405
|
-
utilityClass: 'border-right-0',
|
|
1406
|
-
},
|
|
1407
|
-
],
|
|
1408
|
-
'border-bottom': [
|
|
1409
|
-
{
|
|
1410
|
-
value: '$border',
|
|
1411
|
-
utilityClass: 'border-bottom',
|
|
1412
|
-
},
|
|
1413
|
-
{
|
|
1414
|
-
value: '0',
|
|
1415
|
-
utilityClass: 'border-bottom-0',
|
|
1416
|
-
},
|
|
1417
|
-
],
|
|
1418
|
-
'border-left': [
|
|
1419
|
-
{
|
|
1420
|
-
value: '$border',
|
|
1421
|
-
utilityClass: 'border-left',
|
|
1422
|
-
},
|
|
1423
|
-
{
|
|
1424
|
-
value: '0',
|
|
1425
|
-
utilityClass: 'border-left-0',
|
|
1426
|
-
},
|
|
1427
|
-
],
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
const ruleName$1 = 'primer/utilities';
|
|
1431
|
-
|
|
1432
|
-
const messages$1 = stylelint.utils.ruleMessages(ruleName$1, {
|
|
1433
|
-
rejected: (selector, utilityClass) => {
|
|
1434
|
-
return `Consider using the Primer utility '.${utilityClass}' instead of the selector '${selector}' in your html. https://primer.style/css/utilities`
|
|
1435
|
-
},
|
|
1436
|
-
});
|
|
1437
|
-
|
|
1438
|
-
// eslint-disable-next-line no-unused-vars
|
|
1439
|
-
var utilities = stylelint.createPlugin(ruleName$1, (enabled, options = {}, context) => {
|
|
1440
|
-
if (!enabled) {
|
|
1441
|
-
return noop$1
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
const utilityReplacement = (declaration, value) => {
|
|
1445
|
-
const declarationUtilities = utilities$1[declaration];
|
|
1446
|
-
if (declarationUtilities) {
|
|
1447
|
-
return declarationUtilities.find(utility => {
|
|
1448
|
-
return utility.value === value
|
|
1449
|
-
})
|
|
1450
|
-
}
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
|
-
const lintResult = (root, result) => {
|
|
1454
|
-
root.walkRules(rule => {
|
|
1455
|
-
if (!/^\.[\w\-_]+$/.exec(rule.selector)) {
|
|
1456
|
-
return
|
|
1457
|
-
}
|
|
1458
|
-
const decls = rule.nodes.filter(decl => decl.type === 'decl');
|
|
1459
|
-
|
|
1460
|
-
if (decls.length === 1) {
|
|
1461
|
-
const replacement = utilityReplacement(decls[0].prop, decls[0].value);
|
|
1462
|
-
if (replacement) {
|
|
1463
|
-
stylelint.utils.report({
|
|
1464
|
-
index: rule.sourceIndex,
|
|
1465
|
-
message: messages$1.rejected(rule.selector, replacement.utilityClass),
|
|
1466
|
-
node: rule,
|
|
1467
|
-
result,
|
|
1468
|
-
ruleName: ruleName$1,
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
});
|
|
1473
|
-
};
|
|
1474
|
-
|
|
1475
|
-
return lintResult
|
|
1476
|
-
});
|
|
1477
|
-
|
|
1478
|
-
function noop$1() {}
|
|
1479
|
-
|
|
1480
903
|
const ruleName = 'primer/no-display-colors';
|
|
1481
904
|
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
1482
905
|
rejected: varName => `${varName} is in alpha and should be used with caution with approval from the Primer team`,
|
|
@@ -1542,7 +965,6 @@ var index = {
|
|
|
1542
965
|
responsiveWidths,
|
|
1543
966
|
spacing,
|
|
1544
967
|
typography,
|
|
1545
|
-
utilities,
|
|
1546
968
|
noDisplayColors,
|
|
1547
969
|
],
|
|
1548
970
|
rules: {
|
|
@@ -1610,7 +1032,6 @@ var index = {
|
|
|
1610
1032
|
'primer/responsive-widths': true,
|
|
1611
1033
|
'primer/spacing': true,
|
|
1612
1034
|
'primer/typography': true,
|
|
1613
|
-
'primer/utilities': null,
|
|
1614
1035
|
'primer/no-display-colors': true,
|
|
1615
1036
|
'property-no-unknown': [
|
|
1616
1037
|
true,
|
|
@@ -1665,7 +1086,6 @@ var index = {
|
|
|
1665
1086
|
'primer/borders': null,
|
|
1666
1087
|
'primer/typography': null,
|
|
1667
1088
|
'primer/box-shadow': null,
|
|
1668
|
-
'primer/utilities': null,
|
|
1669
1089
|
},
|
|
1670
1090
|
},
|
|
1671
1091
|
{
|
|
@@ -1720,7 +1140,6 @@ var index = {
|
|
|
1720
1140
|
'primer/borders': null,
|
|
1721
1141
|
'primer/typography': null,
|
|
1722
1142
|
'primer/box-shadow': null,
|
|
1723
|
-
'primer/utilities': null,
|
|
1724
1143
|
},
|
|
1725
1144
|
},
|
|
1726
1145
|
],
|