tailwindcss 0.0.0-insiders.eb8d929 → 0.0.0-insiders.ec0049a

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 (277) hide show
  1. package/README.md +5 -6
  2. package/dist/chunk-AZANAYY2.mjs +1 -0
  3. package/dist/chunk-CH45MXZF.mjs +10 -0
  4. package/dist/chunk-V2K3XTS4.mjs +1 -0
  5. package/dist/colors-b_6i0Oi7.d.ts +295 -0
  6. package/dist/colors.d.mts +295 -0
  7. package/dist/colors.d.ts +5 -0
  8. package/dist/colors.js +1 -0
  9. package/dist/colors.mjs +1 -0
  10. package/dist/default-theme.d.mts +1147 -0
  11. package/dist/default-theme.d.ts +1147 -0
  12. package/dist/default-theme.js +1 -0
  13. package/dist/default-theme.mjs +1 -0
  14. package/dist/flatten-color-palette.d.mts +6 -0
  15. package/dist/flatten-color-palette.d.ts +6 -0
  16. package/dist/flatten-color-palette.js +1 -0
  17. package/dist/flatten-color-palette.mjs +1 -0
  18. package/dist/lib.d.mts +260 -0
  19. package/dist/lib.d.ts +3 -0
  20. package/dist/lib.js +33 -0
  21. package/dist/lib.mjs +24 -0
  22. package/dist/plugin.d.mts +11 -0
  23. package/dist/plugin.d.ts +104 -0
  24. package/dist/plugin.js +1 -0
  25. package/dist/plugin.mjs +1 -0
  26. package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
  27. package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  28. package/dist/types-B254mqw1.d.mts +98 -0
  29. package/index.css +863 -3
  30. package/package.json +73 -102
  31. package/preflight.css +383 -0
  32. package/theme.css +453 -0
  33. package/base.css +0 -1
  34. package/colors.d.ts +0 -3
  35. package/colors.js +0 -2
  36. package/components.css +0 -1
  37. package/defaultConfig.d.ts +0 -3
  38. package/defaultConfig.js +0 -2
  39. package/defaultTheme.d.ts +0 -4
  40. package/defaultTheme.js +0 -2
  41. package/lib/cli/build/index.js +0 -57
  42. package/lib/cli/build/plugin.js +0 -381
  43. package/lib/cli/build/utils.js +0 -88
  44. package/lib/cli/build/watching.js +0 -182
  45. package/lib/cli/help/index.js +0 -73
  46. package/lib/cli/index.js +0 -231
  47. package/lib/cli/init/index.js +0 -63
  48. package/lib/cli.js +0 -3
  49. package/lib/corePluginList.js +0 -188
  50. package/lib/corePlugins.js +0 -4197
  51. package/lib/css/LICENSE +0 -25
  52. package/lib/css/preflight.css +0 -375
  53. package/lib/featureFlags.js +0 -84
  54. package/lib/index.js +0 -2
  55. package/lib/lib/cacheInvalidation.js +0 -92
  56. package/lib/lib/collapseAdjacentRules.js +0 -61
  57. package/lib/lib/collapseDuplicateDeclarations.js +0 -85
  58. package/lib/lib/content.js +0 -207
  59. package/lib/lib/defaultExtractor.js +0 -243
  60. package/lib/lib/detectNesting.js +0 -45
  61. package/lib/lib/evaluateTailwindFunctions.js +0 -238
  62. package/lib/lib/expandApplyAtRules.js +0 -534
  63. package/lib/lib/expandTailwindAtRules.js +0 -314
  64. package/lib/lib/findAtConfigPath.js +0 -46
  65. package/lib/lib/generateRules.js +0 -879
  66. package/lib/lib/getModuleDependencies.js +0 -99
  67. package/lib/lib/handleImportAtRules.js +0 -50
  68. package/lib/lib/load-config.js +0 -42
  69. package/lib/lib/normalizeTailwindDirectives.js +0 -74
  70. package/lib/lib/offsets.js +0 -306
  71. package/lib/lib/partitionApplyAtRules.js +0 -58
  72. package/lib/lib/regex.js +0 -74
  73. package/lib/lib/remap-bitfield.js +0 -89
  74. package/lib/lib/resolveDefaultsAtRules.js +0 -165
  75. package/lib/lib/setupContextUtils.js +0 -1245
  76. package/lib/lib/setupTrackingContext.js +0 -166
  77. package/lib/lib/sharedState.js +0 -79
  78. package/lib/lib/substituteScreenAtRules.js +0 -31
  79. package/lib/plugin.js +0 -116
  80. package/lib/postcss-plugins/nesting/README.md +0 -42
  81. package/lib/postcss-plugins/nesting/index.js +0 -21
  82. package/lib/postcss-plugins/nesting/plugin.js +0 -89
  83. package/lib/processTailwindFeatures.js +0 -64
  84. package/lib/public/colors.js +0 -355
  85. package/lib/public/create-plugin.js +0 -17
  86. package/lib/public/default-config.js +0 -18
  87. package/lib/public/default-theme.js +0 -18
  88. package/lib/public/load-config.js +0 -12
  89. package/lib/public/resolve-config.js +0 -24
  90. package/lib/util/applyImportantSelector.js +0 -36
  91. package/lib/util/bigSign.js +0 -13
  92. package/lib/util/buildMediaQuery.js +0 -27
  93. package/lib/util/cloneDeep.js +0 -22
  94. package/lib/util/cloneNodes.js +0 -34
  95. package/lib/util/color.js +0 -116
  96. package/lib/util/colorNames.js +0 -752
  97. package/lib/util/configurePlugins.js +0 -23
  98. package/lib/util/createPlugin.js +0 -32
  99. package/lib/util/createUtilityPlugin.js +0 -53
  100. package/lib/util/dataTypes.js +0 -304
  101. package/lib/util/defaults.js +0 -27
  102. package/lib/util/escapeClassName.js +0 -24
  103. package/lib/util/escapeCommas.js +0 -13
  104. package/lib/util/flattenColorPalette.js +0 -18
  105. package/lib/util/formatVariantSelector.js +0 -263
  106. package/lib/util/getAllConfigs.js +0 -50
  107. package/lib/util/hashConfig.js +0 -21
  108. package/lib/util/isKeyframeRule.js +0 -13
  109. package/lib/util/isPlainObject.js +0 -17
  110. package/lib/util/isSyntacticallyValidPropertyValue.js +0 -74
  111. package/lib/util/log.js +0 -78
  112. package/lib/util/nameClass.js +0 -49
  113. package/lib/util/negateValue.js +0 -36
  114. package/lib/util/normalizeConfig.js +0 -308
  115. package/lib/util/normalizeScreens.js +0 -178
  116. package/lib/util/parseAnimationValue.js +0 -93
  117. package/lib/util/parseBoxShadowValue.js +0 -88
  118. package/lib/util/parseDependency.js +0 -47
  119. package/lib/util/parseGlob.js +0 -36
  120. package/lib/util/parseObjectStyles.js +0 -36
  121. package/lib/util/pluginUtils.js +0 -274
  122. package/lib/util/prefixSelector.js +0 -39
  123. package/lib/util/pseudoElements.js +0 -229
  124. package/lib/util/removeAlphaVariables.js +0 -31
  125. package/lib/util/resolveConfig.js +0 -256
  126. package/lib/util/resolveConfigPath.js +0 -70
  127. package/lib/util/responsive.js +0 -24
  128. package/lib/util/splitAtTopLevelOnly.js +0 -51
  129. package/lib/util/tap.js +0 -14
  130. package/lib/util/toColorValue.js +0 -13
  131. package/lib/util/toPath.js +0 -32
  132. package/lib/util/transformThemeValue.js +0 -73
  133. package/lib/util/validateConfig.js +0 -48
  134. package/lib/util/validateFormalSyntax.js +0 -26
  135. package/lib/util/withAlphaVariable.js +0 -79
  136. package/lib/value-parser/LICENSE +0 -22
  137. package/lib/value-parser/README.md +0 -3
  138. package/lib/value-parser/index.d.js +0 -2
  139. package/lib/value-parser/index.js +0 -22
  140. package/lib/value-parser/parse.js +0 -259
  141. package/lib/value-parser/stringify.js +0 -38
  142. package/lib/value-parser/unit.js +0 -86
  143. package/lib/value-parser/walk.js +0 -16
  144. package/loadConfig.d.ts +0 -4
  145. package/loadConfig.js +0 -2
  146. package/nesting/index.js +0 -2
  147. package/plugin.d.ts +0 -11
  148. package/plugin.js +0 -2
  149. package/prettier.config.js +0 -19
  150. package/resolveConfig.d.ts +0 -12
  151. package/resolveConfig.js +0 -2
  152. package/screens.css +0 -1
  153. package/scripts/create-plugin-list.js +0 -10
  154. package/scripts/generate-types.js +0 -105
  155. package/scripts/release-channel.js +0 -18
  156. package/scripts/release-notes.js +0 -21
  157. package/scripts/type-utils.js +0 -27
  158. package/src/cli/build/index.js +0 -53
  159. package/src/cli/build/plugin.js +0 -457
  160. package/src/cli/build/utils.js +0 -76
  161. package/src/cli/build/watching.js +0 -229
  162. package/src/cli/help/index.js +0 -70
  163. package/src/cli/index.js +0 -217
  164. package/src/cli/init/index.js +0 -79
  165. package/src/cli.js +0 -3
  166. package/src/corePluginList.js +0 -1
  167. package/src/corePlugins.js +0 -2877
  168. package/src/css/LICENSE +0 -25
  169. package/src/css/preflight.css +0 -375
  170. package/src/featureFlags.js +0 -68
  171. package/src/index.js +0 -1
  172. package/src/lib/cacheInvalidation.js +0 -52
  173. package/src/lib/collapseAdjacentRules.js +0 -58
  174. package/src/lib/collapseDuplicateDeclarations.js +0 -93
  175. package/src/lib/content.js +0 -240
  176. package/src/lib/defaultExtractor.js +0 -217
  177. package/src/lib/detectNesting.js +0 -47
  178. package/src/lib/evaluateTailwindFunctions.js +0 -272
  179. package/src/lib/expandApplyAtRules.js +0 -613
  180. package/src/lib/expandTailwindAtRules.js +0 -315
  181. package/src/lib/findAtConfigPath.js +0 -48
  182. package/src/lib/generateRules.js +0 -923
  183. package/src/lib/getModuleDependencies.js +0 -79
  184. package/src/lib/handleImportAtRules.js +0 -34
  185. package/src/lib/load-config.ts +0 -31
  186. package/src/lib/normalizeTailwindDirectives.js +0 -57
  187. package/src/lib/offsets.js +0 -373
  188. package/src/lib/partitionApplyAtRules.js +0 -52
  189. package/src/lib/regex.js +0 -74
  190. package/src/lib/remap-bitfield.js +0 -82
  191. package/src/lib/resolveDefaultsAtRules.js +0 -163
  192. package/src/lib/setupContextUtils.js +0 -1318
  193. package/src/lib/setupTrackingContext.js +0 -169
  194. package/src/lib/sharedState.js +0 -57
  195. package/src/lib/substituteScreenAtRules.js +0 -19
  196. package/src/plugin.js +0 -124
  197. package/src/postcss-plugins/nesting/README.md +0 -42
  198. package/src/postcss-plugins/nesting/index.js +0 -13
  199. package/src/postcss-plugins/nesting/plugin.js +0 -80
  200. package/src/processTailwindFeatures.js +0 -58
  201. package/src/public/colors.js +0 -322
  202. package/src/public/create-plugin.js +0 -2
  203. package/src/public/default-config.js +0 -4
  204. package/src/public/default-theme.js +0 -4
  205. package/src/public/load-config.js +0 -2
  206. package/src/public/resolve-config.js +0 -7
  207. package/src/util/applyImportantSelector.js +0 -27
  208. package/src/util/bigSign.js +0 -3
  209. package/src/util/buildMediaQuery.js +0 -22
  210. package/src/util/cloneDeep.js +0 -11
  211. package/src/util/cloneNodes.js +0 -28
  212. package/src/util/color.js +0 -88
  213. package/src/util/colorNames.js +0 -150
  214. package/src/util/configurePlugins.js +0 -23
  215. package/src/util/createPlugin.js +0 -27
  216. package/src/util/createUtilityPlugin.js +0 -37
  217. package/src/util/dataTypes.js +0 -292
  218. package/src/util/defaults.js +0 -17
  219. package/src/util/escapeClassName.js +0 -8
  220. package/src/util/escapeCommas.js +0 -3
  221. package/src/util/flattenColorPalette.js +0 -13
  222. package/src/util/formatVariantSelector.js +0 -316
  223. package/src/util/getAllConfigs.js +0 -38
  224. package/src/util/hashConfig.js +0 -5
  225. package/src/util/isKeyframeRule.js +0 -3
  226. package/src/util/isPlainObject.js +0 -8
  227. package/src/util/isSyntacticallyValidPropertyValue.js +0 -61
  228. package/src/util/log.js +0 -53
  229. package/src/util/nameClass.js +0 -30
  230. package/src/util/negateValue.js +0 -24
  231. package/src/util/normalizeConfig.js +0 -328
  232. package/src/util/normalizeScreens.js +0 -140
  233. package/src/util/parseAnimationValue.js +0 -68
  234. package/src/util/parseBoxShadowValue.js +0 -72
  235. package/src/util/parseDependency.js +0 -44
  236. package/src/util/parseGlob.js +0 -24
  237. package/src/util/parseObjectStyles.js +0 -19
  238. package/src/util/pluginUtils.js +0 -287
  239. package/src/util/prefixSelector.js +0 -32
  240. package/src/util/pseudoElements.js +0 -170
  241. package/src/util/removeAlphaVariables.js +0 -24
  242. package/src/util/resolveConfig.js +0 -277
  243. package/src/util/resolveConfigPath.js +0 -66
  244. package/src/util/responsive.js +0 -10
  245. package/src/util/splitAtTopLevelOnly.js +0 -52
  246. package/src/util/tap.js +0 -4
  247. package/src/util/toColorValue.js +0 -3
  248. package/src/util/toPath.js +0 -26
  249. package/src/util/transformThemeValue.js +0 -62
  250. package/src/util/validateConfig.js +0 -36
  251. package/src/util/validateFormalSyntax.js +0 -34
  252. package/src/util/withAlphaVariable.js +0 -49
  253. package/src/value-parser/LICENSE +0 -22
  254. package/src/value-parser/README.md +0 -3
  255. package/src/value-parser/index.d.ts +0 -177
  256. package/src/value-parser/index.js +0 -28
  257. package/src/value-parser/parse.js +0 -303
  258. package/src/value-parser/stringify.js +0 -41
  259. package/src/value-parser/unit.js +0 -118
  260. package/src/value-parser/walk.js +0 -18
  261. package/stubs/.gitignore +0 -1
  262. package/stubs/.prettierrc.json +0 -6
  263. package/stubs/config.full.js +0 -1003
  264. package/stubs/config.simple.js +0 -7
  265. package/stubs/postcss.config.cjs +0 -5
  266. package/stubs/postcss.config.js +0 -5
  267. package/stubs/tailwind.config.cjs +0 -2
  268. package/stubs/tailwind.config.js +0 -2
  269. package/stubs/tailwind.config.ts +0 -3
  270. package/tailwind.css +0 -5
  271. package/types/config.d.ts +0 -369
  272. package/types/generated/.gitkeep +0 -0
  273. package/types/generated/colors.d.ts +0 -298
  274. package/types/generated/corePluginList.d.ts +0 -1
  275. package/types/generated/default-theme.d.ts +0 -372
  276. package/types/index.d.ts +0 -7
  277. package/variants.css +0 -1
@@ -1,879 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- getClassNameFromSelector: function() {
13
- return getClassNameFromSelector;
14
- },
15
- resolveMatches: function() {
16
- return resolveMatches;
17
- },
18
- generateRules: function() {
19
- return generateRules;
20
- }
21
- });
22
- const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
23
- const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
24
- const _parseObjectStyles = /*#__PURE__*/ _interop_require_default(require("../util/parseObjectStyles"));
25
- const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("../util/isPlainObject"));
26
- const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
27
- const _pluginUtils = require("../util/pluginUtils");
28
- const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
29
- const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
30
- const _formatVariantSelector = require("../util/formatVariantSelector");
31
- const _nameClass = require("../util/nameClass");
32
- const _dataTypes = require("../util/dataTypes");
33
- const _setupContextUtils = require("./setupContextUtils");
34
- const _isSyntacticallyValidPropertyValue = /*#__PURE__*/ _interop_require_default(require("../util/isSyntacticallyValidPropertyValue"));
35
- const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly.js");
36
- const _featureFlags = require("../featureFlags");
37
- const _applyImportantSelector = require("../util/applyImportantSelector");
38
- function _interop_require_default(obj) {
39
- return obj && obj.__esModule ? obj : {
40
- default: obj
41
- };
42
- }
43
- function _getRequireWildcardCache(nodeInterop) {
44
- if (typeof WeakMap !== "function") return null;
45
- var cacheBabelInterop = new WeakMap();
46
- var cacheNodeInterop = new WeakMap();
47
- return (_getRequireWildcardCache = function(nodeInterop) {
48
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
49
- })(nodeInterop);
50
- }
51
- function _interop_require_wildcard(obj, nodeInterop) {
52
- if (!nodeInterop && obj && obj.__esModule) {
53
- return obj;
54
- }
55
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
56
- return {
57
- default: obj
58
- };
59
- }
60
- var cache = _getRequireWildcardCache(nodeInterop);
61
- if (cache && cache.has(obj)) {
62
- return cache.get(obj);
63
- }
64
- var newObj = {};
65
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
66
- for(var key in obj){
67
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
68
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
69
- if (desc && (desc.get || desc.set)) {
70
- Object.defineProperty(newObj, key, desc);
71
- } else {
72
- newObj[key] = obj[key];
73
- }
74
- }
75
- }
76
- newObj.default = obj;
77
- if (cache) {
78
- cache.set(obj, newObj);
79
- }
80
- return newObj;
81
- }
82
- let classNameParser = (0, _postcssselectorparser.default)((selectors)=>{
83
- return selectors.first.filter(({ type })=>type === "class").pop().value;
84
- });
85
- function getClassNameFromSelector(selector) {
86
- return classNameParser.transformSync(selector);
87
- }
88
- // Generate match permutations for a class candidate, like:
89
- // ['ring-offset-blue', '100']
90
- // ['ring-offset', 'blue-100']
91
- // ['ring', 'offset-blue-100']
92
- // Example with dynamic classes:
93
- // ['grid-cols', '[[linename],1fr,auto]']
94
- // ['grid', 'cols-[[linename],1fr,auto]']
95
- function* candidatePermutations(candidate) {
96
- let lastIndex = Infinity;
97
- while(lastIndex >= 0){
98
- let dashIdx;
99
- let wasSlash = false;
100
- if (lastIndex === Infinity && candidate.endsWith("]")) {
101
- let bracketIdx = candidate.indexOf("[");
102
- // If character before `[` isn't a dash or a slash, this isn't a dynamic class
103
- // eg. string[]
104
- if (candidate[bracketIdx - 1] === "-") {
105
- dashIdx = bracketIdx - 1;
106
- } else if (candidate[bracketIdx - 1] === "/") {
107
- dashIdx = bracketIdx - 1;
108
- wasSlash = true;
109
- } else {
110
- dashIdx = -1;
111
- }
112
- } else if (lastIndex === Infinity && candidate.includes("/")) {
113
- dashIdx = candidate.lastIndexOf("/");
114
- wasSlash = true;
115
- } else {
116
- dashIdx = candidate.lastIndexOf("-", lastIndex);
117
- }
118
- if (dashIdx < 0) {
119
- break;
120
- }
121
- let prefix = candidate.slice(0, dashIdx);
122
- let modifier = candidate.slice(wasSlash ? dashIdx : dashIdx + 1);
123
- lastIndex = dashIdx - 1;
124
- // TODO: This feels a bit hacky
125
- if (prefix === "" || modifier === "/") {
126
- continue;
127
- }
128
- yield [
129
- prefix,
130
- modifier
131
- ];
132
- }
133
- }
134
- function applyPrefix(matches, context) {
135
- if (matches.length === 0 || context.tailwindConfig.prefix === "") {
136
- return matches;
137
- }
138
- for (let match of matches){
139
- let [meta] = match;
140
- if (meta.options.respectPrefix) {
141
- let container = _postcss.default.root({
142
- nodes: [
143
- match[1].clone()
144
- ]
145
- });
146
- let classCandidate = match[1].raws.tailwind.classCandidate;
147
- container.walkRules((r)=>{
148
- // If this is a negative utility with a dash *before* the prefix we
149
- // have to ensure that the generated selector matches the candidate
150
- // Not doing this will cause `-tw-top-1` to generate the class `.tw--top-1`
151
- // The disconnect between candidate <-> class can cause @apply to hard crash.
152
- let shouldPrependNegative = classCandidate.startsWith("-");
153
- r.selector = (0, _prefixSelector.default)(context.tailwindConfig.prefix, r.selector, shouldPrependNegative);
154
- });
155
- match[1] = container.nodes[0];
156
- }
157
- }
158
- return matches;
159
- }
160
- function applyImportant(matches, classCandidate) {
161
- if (matches.length === 0) {
162
- return matches;
163
- }
164
- let result = [];
165
- for (let [meta, rule] of matches){
166
- let container = _postcss.default.root({
167
- nodes: [
168
- rule.clone()
169
- ]
170
- });
171
- container.walkRules((r)=>{
172
- let ast = (0, _postcssselectorparser.default)().astSync(r.selector);
173
- // Remove extraneous selectors that do not include the base candidate
174
- ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
175
- // Update all instances of the base candidate to include the important marker
176
- (0, _pluginUtils.updateAllClasses)(ast, (className)=>className === classCandidate ? `!${className}` : className);
177
- r.selector = ast.toString();
178
- r.walkDecls((d)=>d.important = true);
179
- });
180
- result.push([
181
- {
182
- ...meta,
183
- important: true
184
- },
185
- container.nodes[0]
186
- ]);
187
- }
188
- return result;
189
- }
190
- // Takes a list of rule tuples and applies a variant like `hover`, sm`,
191
- // whatever to it. We used to do some extra caching here to avoid generating
192
- // a variant of the same rule more than once, but this was never hit because
193
- // we cache at the entire selector level further up the tree.
194
- //
195
- // Technically you can get a cache hit if you have `hover:focus:text-center`
196
- // and `focus:hover:text-center` in the same project, but it doesn't feel
197
- // worth the complexity for that case.
198
- function applyVariant(variant, matches, context) {
199
- if (matches.length === 0) {
200
- return matches;
201
- }
202
- /** @type {{modifier: string | null, value: string | null}} */ let args = {
203
- modifier: null,
204
- value: _sharedState.NONE
205
- };
206
- // Retrieve "modifier"
207
- {
208
- let [baseVariant, ...modifiers] = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(variant, "/");
209
- // This is a hack to support variants with `/` in them, like `ar-1/10/20:text-red-500`
210
- // In this case 1/10 is a value but /20 is a modifier
211
- if (modifiers.length > 1) {
212
- baseVariant = baseVariant + "/" + modifiers.slice(0, -1).join("/");
213
- modifiers = modifiers.slice(-1);
214
- }
215
- if (modifiers.length && !context.variantMap.has(variant)) {
216
- variant = baseVariant;
217
- args.modifier = modifiers[0];
218
- }
219
- }
220
- // Retrieve "arbitrary value"
221
- if (variant.endsWith("]") && !variant.startsWith("[")) {
222
- // We either have:
223
- // @[200px]
224
- // group-[:hover]
225
- //
226
- // But we don't want:
227
- // @-[200px] (`-` is incorrect)
228
- // group[:hover] (`-` is missing)
229
- let match = /(.)(-?)\[(.*)\]/g.exec(variant);
230
- if (match) {
231
- let [, char, separator, value] = match;
232
- // @-[200px] case
233
- if (char === "@" && separator === "-") return [];
234
- // group[:hover] case
235
- if (char !== "@" && separator === "") return [];
236
- variant = variant.replace(`${separator}[${value}]`, "");
237
- args.value = value;
238
- }
239
- }
240
- // Register arbitrary variants
241
- if (isArbitraryValue(variant) && !context.variantMap.has(variant)) {
242
- let sort = context.offsets.recordVariant(variant);
243
- let selector = (0, _dataTypes.normalize)(variant.slice(1, -1));
244
- let selectors = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(selector, ",");
245
- // We do not support multiple selectors for arbitrary variants
246
- if (selectors.length > 1) {
247
- return [];
248
- }
249
- if (!selectors.every(_setupContextUtils.isValidVariantFormatString)) {
250
- return [];
251
- }
252
- let records = selectors.map((sel, idx)=>[
253
- context.offsets.applyParallelOffset(sort, idx),
254
- (0, _setupContextUtils.parseVariant)(sel.trim())
255
- ]);
256
- context.variantMap.set(variant, records);
257
- }
258
- if (context.variantMap.has(variant)) {
259
- let isArbitraryVariant = isArbitraryValue(variant);
260
- let variantFunctionTuples = context.variantMap.get(variant).slice();
261
- let result = [];
262
- for (let [meta, rule] of matches){
263
- // Don't generate variants for user css
264
- if (meta.layer === "user") {
265
- continue;
266
- }
267
- let container = _postcss.default.root({
268
- nodes: [
269
- rule.clone()
270
- ]
271
- });
272
- for (let [variantSort, variantFunction, containerFromArray] of variantFunctionTuples){
273
- let clone = (containerFromArray !== null && containerFromArray !== void 0 ? containerFromArray : container).clone();
274
- let collectedFormats = [];
275
- function prepareBackup() {
276
- // Already prepared, chicken out
277
- if (clone.raws.neededBackup) {
278
- return;
279
- }
280
- clone.raws.neededBackup = true;
281
- clone.walkRules((rule)=>rule.raws.originalSelector = rule.selector);
282
- }
283
- function modifySelectors(modifierFunction) {
284
- prepareBackup();
285
- clone.each((rule)=>{
286
- if (rule.type !== "rule") {
287
- return;
288
- }
289
- rule.selectors = rule.selectors.map((selector)=>{
290
- return modifierFunction({
291
- get className () {
292
- return getClassNameFromSelector(selector);
293
- },
294
- selector
295
- });
296
- });
297
- });
298
- return clone;
299
- }
300
- let ruleWithVariant = variantFunction({
301
- // Public API
302
- get container () {
303
- prepareBackup();
304
- return clone;
305
- },
306
- separator: context.tailwindConfig.separator,
307
- modifySelectors,
308
- // Private API for now
309
- wrap (wrapper) {
310
- let nodes = clone.nodes;
311
- clone.removeAll();
312
- wrapper.append(nodes);
313
- clone.append(wrapper);
314
- },
315
- format (selectorFormat) {
316
- collectedFormats.push({
317
- format: selectorFormat,
318
- isArbitraryVariant
319
- });
320
- },
321
- args
322
- });
323
- // It can happen that a list of format strings is returned from within the function. In that
324
- // case, we have to process them as well. We can use the existing `variantSort`.
325
- if (Array.isArray(ruleWithVariant)) {
326
- for (let [idx, variantFunction] of ruleWithVariant.entries()){
327
- // This is a little bit scary since we are pushing to an array of items that we are
328
- // currently looping over. However, you can also think of it like a processing queue
329
- // where you keep handling jobs until everything is done and each job can queue more
330
- // jobs if needed.
331
- variantFunctionTuples.push([
332
- context.offsets.applyParallelOffset(variantSort, idx),
333
- variantFunction,
334
- // If the clone has been modified we have to pass that back
335
- // though so each rule can use the modified container
336
- clone.clone()
337
- ]);
338
- }
339
- continue;
340
- }
341
- if (typeof ruleWithVariant === "string") {
342
- collectedFormats.push({
343
- format: ruleWithVariant,
344
- isArbitraryVariant
345
- });
346
- }
347
- if (ruleWithVariant === null) {
348
- continue;
349
- }
350
- // We had to backup selectors, therefore we assume that somebody touched
351
- // `container` or `modifySelectors`. Let's see if they did, so that we
352
- // can restore the selectors, and collect the format strings.
353
- if (clone.raws.neededBackup) {
354
- delete clone.raws.neededBackup;
355
- clone.walkRules((rule)=>{
356
- let before = rule.raws.originalSelector;
357
- if (!before) return;
358
- delete rule.raws.originalSelector;
359
- if (before === rule.selector) return; // No mutation happened
360
- let modified = rule.selector;
361
- // Rebuild the base selector, this is what plugin authors would do
362
- // as well. E.g.: `${variant}${separator}${className}`.
363
- // However, plugin authors probably also prepend or append certain
364
- // classes, pseudos, ids, ...
365
- let rebuiltBase = (0, _postcssselectorparser.default)((selectors)=>{
366
- selectors.walkClasses((classNode)=>{
367
- classNode.value = `${variant}${context.tailwindConfig.separator}${classNode.value}`;
368
- });
369
- }).processSync(before);
370
- // Now that we know the original selector, the new selector, and
371
- // the rebuild part in between, we can replace the part that plugin
372
- // authors need to rebuild with `&`, and eventually store it in the
373
- // collectedFormats. Similar to what `format('...')` would do.
374
- //
375
- // E.g.:
376
- // variant: foo
377
- // selector: .markdown > p
378
- // modified (by plugin): .foo .foo\\:markdown > p
379
- // rebuiltBase (internal): .foo\\:markdown > p
380
- // format: .foo &
381
- collectedFormats.push({
382
- format: modified.replace(rebuiltBase, "&"),
383
- isArbitraryVariant
384
- });
385
- rule.selector = before;
386
- });
387
- }
388
- // This tracks the originating layer for the variant
389
- // For example:
390
- // .sm:underline {} is a variant of something in the utilities layer
391
- // .sm:container {} is a variant of the container component
392
- clone.nodes[0].raws.tailwind = {
393
- ...clone.nodes[0].raws.tailwind,
394
- parentLayer: meta.layer
395
- };
396
- var _meta_collectedFormats;
397
- let withOffset = [
398
- {
399
- ...meta,
400
- sort: context.offsets.applyVariantOffset(meta.sort, variantSort, Object.assign(args, context.variantOptions.get(variant))),
401
- collectedFormats: ((_meta_collectedFormats = meta.collectedFormats) !== null && _meta_collectedFormats !== void 0 ? _meta_collectedFormats : []).concat(collectedFormats)
402
- },
403
- clone.nodes[0]
404
- ];
405
- result.push(withOffset);
406
- }
407
- }
408
- return result;
409
- }
410
- return [];
411
- }
412
- function parseRules(rule, cache, options = {}) {
413
- // PostCSS node
414
- if (!(0, _isPlainObject.default)(rule) && !Array.isArray(rule)) {
415
- return [
416
- [
417
- rule
418
- ],
419
- options
420
- ];
421
- }
422
- // Tuple
423
- if (Array.isArray(rule)) {
424
- return parseRules(rule[0], cache, rule[1]);
425
- }
426
- // Simple object
427
- if (!cache.has(rule)) {
428
- cache.set(rule, (0, _parseObjectStyles.default)(rule));
429
- }
430
- return [
431
- cache.get(rule),
432
- options
433
- ];
434
- }
435
- const IS_VALID_PROPERTY_NAME = /^[a-z_-]/;
436
- function isValidPropName(name) {
437
- return IS_VALID_PROPERTY_NAME.test(name);
438
- }
439
- /**
440
- * @param {string} declaration
441
- * @returns {boolean}
442
- */ function looksLikeUri(declaration) {
443
- // Quick bailout for obvious non-urls
444
- // This doesn't support schemes that don't use a leading // but that's unlikely to be a problem
445
- if (!declaration.includes("://")) {
446
- return false;
447
- }
448
- try {
449
- const url = new URL(declaration);
450
- return url.scheme !== "" && url.host !== "";
451
- } catch (err) {
452
- // Definitely not a valid url
453
- return false;
454
- }
455
- }
456
- function isParsableNode(node) {
457
- let isParsable = true;
458
- node.walkDecls((decl)=>{
459
- if (!isParsableCssValue(decl.prop, decl.value)) {
460
- isParsable = false;
461
- return false;
462
- }
463
- });
464
- return isParsable;
465
- }
466
- function isParsableCssValue(property, value) {
467
- // We don't want to to treat [https://example.com] as a custom property
468
- // Even though, according to the CSS grammar, it's a totally valid CSS declaration
469
- // So we short-circuit here by checking if the custom property looks like a url
470
- if (looksLikeUri(`${property}:${value}`)) {
471
- return false;
472
- }
473
- try {
474
- _postcss.default.parse(`a{${property}:${value}}`).toResult();
475
- return true;
476
- } catch (err) {
477
- return false;
478
- }
479
- }
480
- function extractArbitraryProperty(classCandidate, context) {
481
- var _classCandidate_match;
482
- let [, property, value] = (_classCandidate_match = classCandidate.match(/^\[([a-zA-Z0-9-_]+):(\S+)\]$/)) !== null && _classCandidate_match !== void 0 ? _classCandidate_match : [];
483
- if (value === undefined) {
484
- return null;
485
- }
486
- if (!isValidPropName(property)) {
487
- return null;
488
- }
489
- if (!(0, _isSyntacticallyValidPropertyValue.default)(value)) {
490
- return null;
491
- }
492
- let normalized = (0, _dataTypes.normalize)(value);
493
- if (!isParsableCssValue(property, normalized)) {
494
- return null;
495
- }
496
- let sort = context.offsets.arbitraryProperty();
497
- return [
498
- [
499
- {
500
- sort,
501
- layer: "utilities"
502
- },
503
- ()=>({
504
- [(0, _nameClass.asClass)(classCandidate)]: {
505
- [property]: normalized
506
- }
507
- })
508
- ]
509
- ];
510
- }
511
- function* resolveMatchedPlugins(classCandidate, context) {
512
- if (context.candidateRuleMap.has(classCandidate)) {
513
- yield [
514
- context.candidateRuleMap.get(classCandidate),
515
- "DEFAULT"
516
- ];
517
- }
518
- yield* function*(arbitraryPropertyRule) {
519
- if (arbitraryPropertyRule !== null) {
520
- yield [
521
- arbitraryPropertyRule,
522
- "DEFAULT"
523
- ];
524
- }
525
- }(extractArbitraryProperty(classCandidate, context));
526
- let candidatePrefix = classCandidate;
527
- let negative = false;
528
- const twConfigPrefix = context.tailwindConfig.prefix;
529
- const twConfigPrefixLen = twConfigPrefix.length;
530
- const hasMatchingPrefix = candidatePrefix.startsWith(twConfigPrefix) || candidatePrefix.startsWith(`-${twConfigPrefix}`);
531
- if (candidatePrefix[twConfigPrefixLen] === "-" && hasMatchingPrefix) {
532
- negative = true;
533
- candidatePrefix = twConfigPrefix + candidatePrefix.slice(twConfigPrefixLen + 1);
534
- }
535
- if (negative && context.candidateRuleMap.has(candidatePrefix)) {
536
- yield [
537
- context.candidateRuleMap.get(candidatePrefix),
538
- "-DEFAULT"
539
- ];
540
- }
541
- for (let [prefix, modifier] of candidatePermutations(candidatePrefix)){
542
- if (context.candidateRuleMap.has(prefix)) {
543
- yield [
544
- context.candidateRuleMap.get(prefix),
545
- negative ? `-${modifier}` : modifier
546
- ];
547
- }
548
- }
549
- }
550
- function splitWithSeparator(input, separator) {
551
- if (input === _sharedState.NOT_ON_DEMAND) {
552
- return [
553
- _sharedState.NOT_ON_DEMAND
554
- ];
555
- }
556
- return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(input, separator);
557
- }
558
- function* recordCandidates(matches, classCandidate) {
559
- for (const match of matches){
560
- var _match__options;
561
- var _match__options_preserveSource;
562
- match[1].raws.tailwind = {
563
- ...match[1].raws.tailwind,
564
- classCandidate,
565
- preserveSource: (_match__options_preserveSource = (_match__options = match[0].options) === null || _match__options === void 0 ? void 0 : _match__options.preserveSource) !== null && _match__options_preserveSource !== void 0 ? _match__options_preserveSource : false
566
- };
567
- yield match;
568
- }
569
- }
570
- function* resolveMatches(candidate, context, original = candidate) {
571
- let separator = context.tailwindConfig.separator;
572
- let [classCandidate, ...variants] = splitWithSeparator(candidate, separator).reverse();
573
- let important = false;
574
- if (classCandidate.startsWith("!")) {
575
- important = true;
576
- classCandidate = classCandidate.slice(1);
577
- }
578
- if ((0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping")) {
579
- if (classCandidate.startsWith("(") && classCandidate.endsWith(")")) {
580
- let base = variants.slice().reverse().join(separator);
581
- for (let part of (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(classCandidate.slice(1, -1), ",")){
582
- yield* resolveMatches(base + separator + part, context, original);
583
- }
584
- }
585
- }
586
- // TODO: Reintroduce this in ways that doesn't break on false positives
587
- // function sortAgainst(toSort, against) {
588
- // return toSort.slice().sort((a, z) => {
589
- // return bigSign(against.get(a)[0] - against.get(z)[0])
590
- // })
591
- // }
592
- // let sorted = sortAgainst(variants, context.variantMap)
593
- // if (sorted.toString() !== variants.toString()) {
594
- // let corrected = sorted.reverse().concat(classCandidate).join(':')
595
- // throw new Error(`Class ${candidate} should be written as ${corrected}`)
596
- // }
597
- for (let matchedPlugins of resolveMatchedPlugins(classCandidate, context)){
598
- let matches = [];
599
- let typesByMatches = new Map();
600
- let [plugins, modifier] = matchedPlugins;
601
- let isOnlyPlugin = plugins.length === 1;
602
- for (let [sort, plugin] of plugins){
603
- let matchesPerPlugin = [];
604
- if (typeof plugin === "function") {
605
- for (let ruleSet of [].concat(plugin(modifier, {
606
- isOnlyPlugin
607
- }))){
608
- let [rules, options] = parseRules(ruleSet, context.postCssNodeCache);
609
- for (let rule of rules){
610
- matchesPerPlugin.push([
611
- {
612
- ...sort,
613
- options: {
614
- ...sort.options,
615
- ...options
616
- }
617
- },
618
- rule
619
- ]);
620
- }
621
- }
622
- } else if (modifier === "DEFAULT" || modifier === "-DEFAULT") {
623
- let ruleSet = plugin;
624
- let [rules, options] = parseRules(ruleSet, context.postCssNodeCache);
625
- for (let rule of rules){
626
- matchesPerPlugin.push([
627
- {
628
- ...sort,
629
- options: {
630
- ...sort.options,
631
- ...options
632
- }
633
- },
634
- rule
635
- ]);
636
- }
637
- }
638
- if (matchesPerPlugin.length > 0) {
639
- var _sort_options;
640
- var _sort_options_types, _sort_options1;
641
- let matchingTypes = Array.from((0, _pluginUtils.getMatchingTypes)((_sort_options_types = (_sort_options = sort.options) === null || _sort_options === void 0 ? void 0 : _sort_options.types) !== null && _sort_options_types !== void 0 ? _sort_options_types : [], modifier, (_sort_options1 = sort.options) !== null && _sort_options1 !== void 0 ? _sort_options1 : {}, context.tailwindConfig)).map(([_, type])=>type);
642
- if (matchingTypes.length > 0) {
643
- typesByMatches.set(matchesPerPlugin, matchingTypes);
644
- }
645
- matches.push(matchesPerPlugin);
646
- }
647
- }
648
- if (isArbitraryValue(modifier)) {
649
- if (matches.length > 1) {
650
- // Partition plugins in 2 categories so that we can start searching in the plugins that
651
- // don't have `any` as a type first.
652
- let [withAny, withoutAny] = matches.reduce((group, plugin)=>{
653
- let hasAnyType = plugin.some(([{ options }])=>options.types.some(({ type })=>type === "any"));
654
- if (hasAnyType) {
655
- group[0].push(plugin);
656
- } else {
657
- group[1].push(plugin);
658
- }
659
- return group;
660
- }, [
661
- [],
662
- []
663
- ]);
664
- function findFallback(matches) {
665
- // If only a single plugin matches, let's take that one
666
- if (matches.length === 1) {
667
- return matches[0];
668
- }
669
- // Otherwise, find the plugin that creates a valid rule given the arbitrary value, and
670
- // also has the correct type which preferOnConflicts the plugin in case of clashes.
671
- return matches.find((rules)=>{
672
- let matchingTypes = typesByMatches.get(rules);
673
- return rules.some(([{ options }, rule])=>{
674
- if (!isParsableNode(rule)) {
675
- return false;
676
- }
677
- return options.types.some(({ type , preferOnConflict })=>matchingTypes.includes(type) && preferOnConflict);
678
- });
679
- });
680
- }
681
- var _findFallback;
682
- // Try to find a fallback plugin, because we already know that multiple plugins matched for
683
- // the given arbitrary value.
684
- let fallback = (_findFallback = findFallback(withoutAny)) !== null && _findFallback !== void 0 ? _findFallback : findFallback(withAny);
685
- if (fallback) {
686
- matches = [
687
- fallback
688
- ];
689
- } else {
690
- var _typesByMatches_get;
691
- let typesPerPlugin = matches.map((match)=>new Set([
692
- ...(_typesByMatches_get = typesByMatches.get(match)) !== null && _typesByMatches_get !== void 0 ? _typesByMatches_get : []
693
- ]));
694
- // Remove duplicates, so that we can detect proper unique types for each plugin.
695
- for (let pluginTypes of typesPerPlugin){
696
- for (let type of pluginTypes){
697
- let removeFromOwnGroup = false;
698
- for (let otherGroup of typesPerPlugin){
699
- if (pluginTypes === otherGroup) continue;
700
- if (otherGroup.has(type)) {
701
- otherGroup.delete(type);
702
- removeFromOwnGroup = true;
703
- }
704
- }
705
- if (removeFromOwnGroup) pluginTypes.delete(type);
706
- }
707
- }
708
- let messages = [];
709
- for (let [idx, group] of typesPerPlugin.entries()){
710
- for (let type of group){
711
- let rules = matches[idx].map(([, rule])=>rule).flat().map((rule)=>rule.toString().split("\n").slice(1, -1) // Remove selector and closing '}'
712
- .map((line)=>line.trim()).map((x)=>` ${x}`) // Re-indent
713
- .join("\n")).join("\n\n");
714
- messages.push(` Use \`${candidate.replace("[", `[${type}:`)}\` for \`${rules.trim()}\``);
715
- break;
716
- }
717
- }
718
- _log.default.warn([
719
- `The class \`${candidate}\` is ambiguous and matches multiple utilities.`,
720
- ...messages,
721
- `If this is content and not a class, replace it with \`${candidate.replace("[", "&lsqb;").replace("]", "&rsqb;")}\` to silence this warning.`
722
- ]);
723
- continue;
724
- }
725
- }
726
- matches = matches.map((list)=>list.filter((match)=>isParsableNode(match[1])));
727
- }
728
- matches = matches.flat();
729
- matches = Array.from(recordCandidates(matches, classCandidate));
730
- matches = applyPrefix(matches, context);
731
- if (important) {
732
- matches = applyImportant(matches, classCandidate);
733
- }
734
- for (let variant of variants){
735
- matches = applyVariant(variant, matches, context);
736
- }
737
- for (let match of matches){
738
- match[1].raws.tailwind = {
739
- ...match[1].raws.tailwind,
740
- candidate
741
- };
742
- // Apply final format selector
743
- match = applyFinalFormat(match, {
744
- context,
745
- candidate,
746
- original
747
- });
748
- // Skip rules with invalid selectors
749
- // This will cause the candidate to be added to the "not class"
750
- // cache skipping it entirely for future builds
751
- if (match === null) {
752
- continue;
753
- }
754
- yield match;
755
- }
756
- }
757
- }
758
- function applyFinalFormat(match, { context , candidate , original }) {
759
- if (!match[0].collectedFormats) {
760
- return match;
761
- }
762
- let isValid = true;
763
- let finalFormat;
764
- try {
765
- finalFormat = (0, _formatVariantSelector.formatVariantSelector)(match[0].collectedFormats, {
766
- context,
767
- candidate
768
- });
769
- } catch {
770
- // The format selector we produced is invalid
771
- // This could be because:
772
- // - A bug exists
773
- // - A plugin introduced an invalid variant selector (ex: `addVariant('foo', '&;foo')`)
774
- // - The user used an invalid arbitrary variant (ex: `[&;foo]:underline`)
775
- // Either way the build will fail because of this
776
- // We would rather that the build pass "silently" given that this could
777
- // happen because of picking up invalid things when scanning content
778
- // So we'll throw out the candidate instead
779
- return null;
780
- }
781
- let container = _postcss.default.root({
782
- nodes: [
783
- match[1].clone()
784
- ]
785
- });
786
- container.walkRules((rule)=>{
787
- if (inKeyframes(rule)) {
788
- return;
789
- }
790
- try {
791
- rule.selector = (0, _formatVariantSelector.finalizeSelector)(rule.selector, finalFormat, {
792
- candidate: original,
793
- context
794
- });
795
- } catch {
796
- // If this selector is invalid we also want to skip it
797
- // But it's likely that being invalid here means there's a bug in a plugin rather than too loosely matching content
798
- isValid = false;
799
- return false;
800
- }
801
- });
802
- if (!isValid) {
803
- return null;
804
- }
805
- match[1] = container.nodes[0];
806
- return match;
807
- }
808
- function inKeyframes(rule) {
809
- return rule.parent && rule.parent.type === "atrule" && rule.parent.name === "keyframes";
810
- }
811
- function getImportantStrategy(important) {
812
- if (important === true) {
813
- return (rule)=>{
814
- if (inKeyframes(rule)) {
815
- return;
816
- }
817
- rule.walkDecls((d)=>{
818
- if (d.parent.type === "rule" && !inKeyframes(d.parent)) {
819
- d.important = true;
820
- }
821
- });
822
- };
823
- }
824
- if (typeof important === "string") {
825
- return (rule)=>{
826
- if (inKeyframes(rule)) {
827
- return;
828
- }
829
- rule.selectors = rule.selectors.map((selector)=>{
830
- return (0, _applyImportantSelector.applyImportantSelector)(selector, important);
831
- });
832
- };
833
- }
834
- }
835
- function generateRules(candidates, context) {
836
- let allRules = [];
837
- let strategy = getImportantStrategy(context.tailwindConfig.important);
838
- for (let candidate of candidates){
839
- if (context.notClassCache.has(candidate)) {
840
- continue;
841
- }
842
- if (context.candidateRuleCache.has(candidate)) {
843
- allRules = allRules.concat(Array.from(context.candidateRuleCache.get(candidate)));
844
- continue;
845
- }
846
- let matches = Array.from(resolveMatches(candidate, context));
847
- if (matches.length === 0) {
848
- context.notClassCache.add(candidate);
849
- continue;
850
- }
851
- context.classCache.set(candidate, matches);
852
- var _context_candidateRuleCache_get;
853
- let rules = (_context_candidateRuleCache_get = context.candidateRuleCache.get(candidate)) !== null && _context_candidateRuleCache_get !== void 0 ? _context_candidateRuleCache_get : new Set();
854
- context.candidateRuleCache.set(candidate, rules);
855
- for (const match of matches){
856
- let [{ sort , options }, rule] = match;
857
- if (options.respectImportant && strategy) {
858
- let container = _postcss.default.root({
859
- nodes: [
860
- rule.clone()
861
- ]
862
- });
863
- container.walkRules(strategy);
864
- rule = container.nodes[0];
865
- }
866
- let newEntry = [
867
- sort,
868
- rule
869
- ];
870
- rules.add(newEntry);
871
- context.ruleCache.add(newEntry);
872
- allRules.push(newEntry);
873
- }
874
- }
875
- return allRules;
876
- }
877
- function isArbitraryValue(input) {
878
- return input.startsWith("[") && input.endsWith("]");
879
- }