stylelint-browser-compat 1.0.0-beta.1

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.
Files changed (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/lib/at-rules/at_rules_name_set.js +16 -0
  4. package/lib/at-rules/collect_features.js +145 -0
  5. package/lib/at-rules/counter-style/collect_features.js +41 -0
  6. package/lib/at-rules/counter-style/descriptor_name_set.js +16 -0
  7. package/lib/at-rules/document/collect_features.js +46 -0
  8. package/lib/at-rules/document/regexp/collect_features.js +30 -0
  9. package/lib/at-rules/font-face/__font_type/collect_features.js +79 -0
  10. package/lib/at-rules/font-face/collect_features.js +67 -0
  11. package/lib/at-rules/font-face/descriptor_name_set.js +16 -0
  12. package/lib/at-rules/font-feature-values/at_rules_name_set.js +16 -0
  13. package/lib/at-rules/font-feature-values/collect_features.js +30 -0
  14. package/lib/at-rules/keyframes/collect_features.js +29 -0
  15. package/lib/at-rules/media/collect_features.js +118 -0
  16. package/lib/at-rules/media/media_feature_name_map.js +8 -0
  17. package/lib/at-rules/page/collect_features.js +82 -0
  18. package/lib/at-rules/page/descriptor_name_set.js +16 -0
  19. package/lib/at-rules/page/size/collect_features.js +55 -0
  20. package/lib/at-rules/property/collect_features.js +60 -0
  21. package/lib/at-rules/property/descriptor_name_set.js +16 -0
  22. package/lib/at-rules/scroll-timeline/collect_features.js +60 -0
  23. package/lib/at-rules/scroll-timeline/descriptor_name_set.js +16 -0
  24. package/lib/collect_features.js +69 -0
  25. package/lib/index.js +5 -0
  26. package/lib/is_supported.js +75 -0
  27. package/lib/options.js +20 -0
  28. package/lib/parse_browserslist_version.js +132 -0
  29. package/lib/properties/-moz-orient/collect_features.js +61 -0
  30. package/lib/properties/-moz-user-input/collect_features.js +71 -0
  31. package/lib/properties/animation-direction/collect_features.js +53 -0
  32. package/lib/properties/animation-timing-function/collect_features.js +51 -0
  33. package/lib/properties/appearance/collect_features.js +76 -0
  34. package/lib/properties/background/background-clip/collect_features.js +59 -0
  35. package/lib/properties/background/background-origin/collect_features.js +59 -0
  36. package/lib/properties/background/background-size/collect_features.js +106 -0
  37. package/lib/properties/background/collect_features.js +104 -0
  38. package/lib/properties/background/multiple_backgrounds/collect_features.js +39 -0
  39. package/lib/properties/background-attachment/collect_features.js +70 -0
  40. package/lib/properties/background-clip/collect_features.js +55 -0
  41. package/lib/properties/background-image/collect_features.js +133 -0
  42. package/lib/properties/background-image/svg_images/collect_features.js +58 -0
  43. package/lib/properties/background-origin/collect_features.js +42 -0
  44. package/lib/properties/background-position/collect_features.js +117 -0
  45. package/lib/properties/background-position-x/collect_features.js +36 -0
  46. package/lib/properties/background-position-y/collect_features.js +36 -0
  47. package/lib/properties/background-repeat/collect_features.js +102 -0
  48. package/lib/properties/background-repeat/round_space/collect_features.js +54 -0
  49. package/lib/properties/background-size/collect_features.js +38 -0
  50. package/lib/properties/block-size/collect_features.js +77 -0
  51. package/lib/properties/border-bottom-left-radius/border-bottom-right-radius/collect_features.js +57 -0
  52. package/lib/properties/border-bottom-left-radius/collect_features.js +57 -0
  53. package/lib/properties/border-bottom-right-radius/collect_features.js +57 -0
  54. package/lib/properties/border-radius/collect_features.js +61 -0
  55. package/lib/properties/border-top-left-radius/collect_features.js +57 -0
  56. package/lib/properties/border-top-right-radius/collect_features.js +57 -0
  57. package/lib/properties/box-shadow/collect_features.js +92 -0
  58. package/lib/properties/box-sizing/collect_features.js +39 -0
  59. package/lib/properties/caption-side/collect_features.js +38 -0
  60. package/lib/properties/clear/collect_features.js +38 -0
  61. package/lib/properties/clip-path/collect_features.js +65 -0
  62. package/lib/properties/collect_features.js +452 -0
  63. package/lib/properties/color-scheme/collect_features.js +52 -0
  64. package/lib/properties/property_name_set.js +16 -0
  65. package/lib/properties/transition/collect_features.js +33 -0
  66. package/lib/properties/transition-property/collect_features.js +38 -0
  67. package/lib/rule.js +125 -0
  68. package/lib/selectors/__attributes/collect_features.js +44 -0
  69. package/lib/selectors/__classes/collect_features.js +23 -0
  70. package/lib/selectors/__combinators/collect_features.js +91 -0
  71. package/lib/selectors/__ids/collect_features.js +23 -0
  72. package/lib/selectors/__pseudos/collect_features.js +228 -0
  73. package/lib/selectors/__pseudos/pseudo_selector_name_set.js +18 -0
  74. package/lib/selectors/__tags/collect_features.js +48 -0
  75. package/lib/selectors/__universal/collect_features.js +37 -0
  76. package/lib/selectors/active/non_a_elements/collect_features.js +38 -0
  77. package/lib/selectors/after/animation_and_transition_support/collect_features.js +43 -0
  78. package/lib/selectors/backdrop/dialog/collect_features.js +38 -0
  79. package/lib/selectors/before/animation_and_transition_support/collect_features.js +43 -0
  80. package/lib/selectors/collect_features.js +120 -0
  81. package/lib/selectors/cue/selector_argument/collect_features.js +26 -0
  82. package/lib/selectors/hostfunction/collect_features.js +26 -0
  83. package/lib/selectors/hover/collect_features.js +61 -0
  84. package/lib/selectors/invalid/collect_features.js +39 -0
  85. package/lib/selectors/marker/animation_and_transition_support/collect_features.js +43 -0
  86. package/lib/selectors/not/selector_list/collect_features.js +31 -0
  87. package/lib/selectors/nth-child/of_syntax/collect_features.js +32 -0
  88. package/lib/selectors/nth-last-child/of_syntax/collect_features.js +32 -0
  89. package/lib/selectors/valid/collect_features.js +39 -0
  90. package/lib/types/__function/collect_features.js +187 -0
  91. package/lib/types/attr/collect_features.js +69 -0
  92. package/lib/types/attr/type_unit_name_map.js +8 -0
  93. package/lib/types/calc/collect_features.js +70 -0
  94. package/lib/types/collect_features.js +139 -0
  95. package/lib/types/color/__alpha_parameter/collect_features.js +37 -0
  96. package/lib/types/color/__float_values/collect_features.js +44 -0
  97. package/lib/types/color/__space_separated_parameters/collect_features.js +37 -0
  98. package/lib/types/color/rgb_hexadecimal_notation/collect_features.js +42 -0
  99. package/lib/types/easing-function/steps/jump/collect_features.js +37 -0
  100. package/lib/types/function_name_map.js +8 -0
  101. package/lib/types/image/gradient/__linear-gradient/collect_features.js +77 -0
  102. package/lib/types/image/gradient/__linear-gradient/doubleposition/collect_features.js +43 -0
  103. package/lib/types/image/gradient/__linear-gradient/interpolation_hints/collect_features.js +42 -0
  104. package/lib/types/image/gradient/__linear-gradient/to/collect_features.js +39 -0
  105. package/lib/types/image/gradient/__linear-gradient/unitless_0_angle/collect_features.js +40 -0
  106. package/lib/types/image/gradient/__radial-gradient/at/collect_features.js +44 -0
  107. package/lib/types/image/gradient/__radial-gradient/collect_features.js +68 -0
  108. package/lib/types/image/gradient/__radial-gradient/doubleposition/collect_features.js +47 -0
  109. package/lib/types/image/gradient/__radial-gradient/interpolation_hints/collect_features.js +42 -0
  110. package/lib/types/image/gradient/conic-gradient/collect_features.js +48 -0
  111. package/lib/types/image/gradient/conic-gradient/doubleposition/collect_features.js +43 -0
  112. package/lib/types/number/scientific_notation/collect_features.js +31 -0
  113. package/lib/types/unit_name_map.js +8 -0
  114. package/lib/types/value_name_map.js +8 -0
  115. package/lib/types.js +5 -0
  116. package/package.json +75 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectFeatures = collectFeatures;
7
+
8
+ var _postcssValueParser = require("postcss-value-parser");
9
+
10
+ async function collectFeatures({
11
+ nodes,
12
+ parent
13
+ }) {
14
+ var _parent$raws$between;
15
+
16
+ const prop = parent.prop.replace(/^-(webkit|moz|ms|o)-/, '');
17
+
18
+ if (prop !== 'box-shadow') {
19
+ return [];
20
+ }
21
+
22
+ const features = [];
23
+ const boxShadowList = [[]];
24
+
25
+ for (const node of nodes) {
26
+ if (node.type === 'div' && node.value === ',') {
27
+ boxShadowList.push([]);
28
+ } else {
29
+ const boxShadow = boxShadowList[boxShadowList.length - 1];
30
+ boxShadow === null || boxShadow === void 0 ? void 0 : boxShadow.push(node);
31
+ }
32
+ }
33
+
34
+ const offset = parent.prop.length + (((_parent$raws$between = parent.raws.between) === null || _parent$raws$between === void 0 ? void 0 : _parent$raws$between.length) ?? 0);
35
+
36
+ if (boxShadowList.length >= 2) {
37
+ const index = offset;
38
+ const endIndex = offset + parent.value.length;
39
+ features.push({
40
+ endIndex,
41
+ id: `properties.box-shadow.multiple_shadows`,
42
+ index,
43
+ name: `Multiple shadows`,
44
+ node: parent
45
+ });
46
+ }
47
+
48
+ let hasLengthValue = false;
49
+
50
+ for (const boxShadow of boxShadowList) {
51
+ for (let idx = 0; idx < boxShadow.length; idx++) {
52
+ const first = boxShadow[idx];
53
+
54
+ if ((first === null || first === void 0 ? void 0 : first.type) === 'word' && first.value === 'inset') {
55
+ const index = offset + first.sourceIndex;
56
+ const endIndex = offset + first.sourceEndIndex;
57
+ features.push({
58
+ endIndex,
59
+ id: `properties.box-shadow.inset`,
60
+ index,
61
+ name: `"inset" value specified as box-shadow`,
62
+ node: parent
63
+ });
64
+ continue;
65
+ }
66
+
67
+ if (hasLengthValue) {
68
+ continue;
69
+ }
70
+
71
+ if ((first === null || first === void 0 ? void 0 : first.type) === 'word' && (0, _postcssValueParser.unit)(first.value) !== false) {
72
+ hasLengthValue = true;
73
+ const fourth = boxShadow[idx + 6];
74
+
75
+ if ((fourth === null || fourth === void 0 ? void 0 : fourth.type) === 'word' && (0, _postcssValueParser.unit)(fourth.value) !== false) {
76
+ const index = offset + fourth.sourceIndex;
77
+ const endIndex = offset + fourth.sourceEndIndex;
78
+ features.push({
79
+ endIndex,
80
+ id: `properties.box-shadow.spread_radius`,
81
+ index,
82
+ name: `Spread radius value specified as box-shadow`,
83
+ node: parent
84
+ });
85
+ continue;
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ return features;
92
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectFeatures = collectFeatures;
7
+
8
+ async function collectFeatures({
9
+ nodes,
10
+ parent
11
+ }) {
12
+ var _parent$raws$between;
13
+
14
+ const prop = parent.prop.replace(/^-(webkit|moz|ms|o)-/, '');
15
+
16
+ if (prop !== 'box-sizing') {
17
+ return [];
18
+ }
19
+
20
+ const features = [];
21
+ const offset = parent.prop.length + (((_parent$raws$between = parent.raws.between) === null || _parent$raws$between === void 0 ? void 0 : _parent$raws$between.length) ?? 0);
22
+
23
+ for (const node of nodes) {
24
+ if (node.type === 'word' && node.value === 'padding-box') {
25
+ const index = offset + node.sourceIndex;
26
+ const endIndex = offset + node.sourceEndIndex;
27
+ features.push({
28
+ endIndex,
29
+ id: `properties.box-sizing.padding-box`,
30
+ index,
31
+ name: `"padding-box" value specified as box-sizing`,
32
+ node: parent
33
+ });
34
+ break;
35
+ }
36
+ }
37
+
38
+ return features;
39
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectFeatures = collectFeatures;
7
+ const NON_STANDARD_VALUE_LIST = ['left', 'right', 'top-outside', 'bottom-outside'];
8
+
9
+ async function collectFeatures({
10
+ nodes,
11
+ parent
12
+ }) {
13
+ var _parent$raws$between;
14
+
15
+ const prop = parent.prop.replace(/^-(webkit|moz|ms|o)-/, '');
16
+
17
+ if (prop !== 'caption-side') {
18
+ return [];
19
+ }
20
+
21
+ const features = [];
22
+ const offset = parent.prop.length + (((_parent$raws$between = parent.raws.between) === null || _parent$raws$between === void 0 ? void 0 : _parent$raws$between.length) ?? 0);
23
+ const node = nodes[0];
24
+
25
+ if ((node === null || node === void 0 ? void 0 : node.type) === 'word' && NON_STANDARD_VALUE_LIST.includes(node.value)) {
26
+ const index = offset + node.sourceIndex;
27
+ const endIndex = offset + node.sourceEndIndex;
28
+ features.push({
29
+ endIndex,
30
+ id: `properties.caption-side.non_standard_values`,
31
+ index,
32
+ name: `"${node.value}" value specified as caption-side`,
33
+ node: parent
34
+ });
35
+ }
36
+
37
+ return features;
38
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectFeatures = collectFeatures;
7
+ const FLOW_RELATIVE_VALUE_LIST = ['inline-start', 'inline-end'];
8
+
9
+ async function collectFeatures({
10
+ nodes,
11
+ parent
12
+ }) {
13
+ var _parent$raws$between;
14
+
15
+ const prop = parent.prop.replace(/^-(webkit|moz|ms|o)-/, '');
16
+
17
+ if (prop !== 'clear') {
18
+ return [];
19
+ }
20
+
21
+ const features = [];
22
+ const offset = parent.prop.length + (((_parent$raws$between = parent.raws.between) === null || _parent$raws$between === void 0 ? void 0 : _parent$raws$between.length) ?? 0);
23
+ const node = nodes[0];
24
+
25
+ if ((node === null || node === void 0 ? void 0 : node.type) === 'word' && FLOW_RELATIVE_VALUE_LIST.includes(node.value)) {
26
+ const index = offset + node.sourceIndex;
27
+ const endIndex = offset + node.sourceEndIndex;
28
+ features.push({
29
+ endIndex,
30
+ id: `properties.clear.flow_relative_values`,
31
+ index,
32
+ name: `"${node.value}" value specified as clear`,
33
+ node: parent
34
+ });
35
+ }
36
+
37
+ return features;
38
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectFeatures = collectFeatures;
7
+ const BASIC_SHAPE_FUNCTION_NAME_LIST = ['inset', 'circle', 'ellipse', 'polygon', 'path'];
8
+
9
+ async function collectFeatures({
10
+ nodes,
11
+ parent
12
+ }) {
13
+ var _parent$raws$between;
14
+
15
+ const prop = parent.prop.replace(/^-(webkit|moz|ms|o)-/, '');
16
+
17
+ if (prop !== 'clip-path') {
18
+ return [];
19
+ }
20
+
21
+ const features = [];
22
+ const offset = parent.prop.length + (((_parent$raws$between = parent.raws.between) === null || _parent$raws$between === void 0 ? void 0 : _parent$raws$between.length) ?? 0);
23
+
24
+ for (const node of nodes) {
25
+ if (node.type === 'function') {
26
+ if (node.value === 'path') {
27
+ const index = offset + node.sourceIndex;
28
+ const endIndex = offset + node.sourceEndIndex;
29
+ features.push({
30
+ endIndex,
31
+ id: `properties.clip-path.path`,
32
+ index,
33
+ name: `"path()" function specified as clip-path`,
34
+ node: parent
35
+ });
36
+ } else if (BASIC_SHAPE_FUNCTION_NAME_LIST.includes(node.value)) {
37
+ const index = offset + node.sourceIndex;
38
+ const endIndex = offset + node.sourceEndIndex;
39
+ features.push({
40
+ endIndex,
41
+ id: `properties.clip-path.basic_shape`,
42
+ index,
43
+ name: `"${node.value}()" function specified as clip-path`,
44
+ node: parent
45
+ });
46
+ }
47
+ }
48
+
49
+ if (node.type === 'word') {
50
+ if (node.value === 'fill-box' || node.value === 'stroke-box') {
51
+ const index = offset + node.sourceIndex;
52
+ const endIndex = offset + node.sourceEndIndex;
53
+ features.push({
54
+ endIndex,
55
+ id: `properties.clip-path.fill_and_stroke_box`,
56
+ index,
57
+ name: `"${node.value}" value specified as clip-path`,
58
+ node: parent
59
+ });
60
+ }
61
+ }
62
+ }
63
+
64
+ return features;
65
+ }