tailwindcss 3.2.3 → 3.2.5

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 (103) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +1 -1
  3. package/lib/cli/build/index.js +5 -1
  4. package/lib/cli/build/plugin.js +50 -34
  5. package/lib/cli/build/watching.js +6 -3
  6. package/lib/cli/index.js +231 -10
  7. package/lib/cli/init/index.js +2 -2
  8. package/lib/cli.js +4 -226
  9. package/lib/corePlugins.js +45 -27
  10. package/lib/featureFlags.js +8 -8
  11. package/lib/index.js +4 -46
  12. package/lib/lib/collapseAdjacentRules.js +2 -2
  13. package/lib/lib/collapseDuplicateDeclarations.js +2 -2
  14. package/lib/lib/content.js +16 -16
  15. package/lib/lib/defaultExtractor.js +10 -5
  16. package/lib/lib/detectNesting.js +7 -1
  17. package/lib/lib/evaluateTailwindFunctions.js +4 -4
  18. package/lib/lib/expandApplyAtRules.js +2 -2
  19. package/lib/lib/expandTailwindAtRules.js +35 -9
  20. package/lib/lib/findAtConfigPath.js +3 -3
  21. package/lib/lib/generateRules.js +105 -50
  22. package/lib/lib/offsets.js +88 -1
  23. package/lib/lib/remap-bitfield.js +87 -0
  24. package/lib/lib/resolveDefaultsAtRules.js +4 -4
  25. package/lib/lib/setupContextUtils.js +122 -79
  26. package/lib/lib/setupTrackingContext.js +25 -4
  27. package/lib/lib/sharedState.js +19 -1
  28. package/lib/oxide/cli/build/deps.js +81 -0
  29. package/lib/oxide/cli/build/index.js +47 -0
  30. package/lib/oxide/cli/build/plugin.js +364 -0
  31. package/lib/oxide/cli/build/utils.js +77 -0
  32. package/lib/oxide/cli/build/watching.js +177 -0
  33. package/lib/oxide/cli/help/index.js +70 -0
  34. package/lib/oxide/cli/index.js +220 -0
  35. package/lib/oxide/cli/init/index.js +35 -0
  36. package/lib/oxide/cli.js +5 -0
  37. package/lib/oxide/postcss-plugin.js +2 -0
  38. package/lib/plugin.js +98 -0
  39. package/lib/postcss-plugins/nesting/plugin.js +2 -2
  40. package/lib/util/cloneNodes.js +2 -2
  41. package/lib/util/color.js +20 -6
  42. package/lib/util/createUtilityPlugin.js +2 -2
  43. package/lib/util/dataTypes.js +26 -2
  44. package/lib/util/defaults.js +4 -4
  45. package/lib/util/escapeClassName.js +3 -3
  46. package/lib/util/formatVariantSelector.js +171 -105
  47. package/lib/util/getAllConfigs.js +2 -2
  48. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +2 -2
  49. package/lib/util/negateValue.js +2 -2
  50. package/lib/util/normalizeConfig.js +36 -22
  51. package/lib/util/pluginUtils.js +38 -40
  52. package/lib/util/prefixSelector.js +22 -8
  53. package/lib/util/resolveConfig.js +8 -10
  54. package/oxide-node-api-shim/index.js +21 -0
  55. package/oxide-node-api-shim/package.json +5 -0
  56. package/package.json +32 -19
  57. package/peers/index.js +61 -42
  58. package/resolveConfig.d.ts +11 -2
  59. package/scripts/swap-engines.js +40 -0
  60. package/src/cli/build/index.js +6 -2
  61. package/src/cli/build/plugin.js +31 -9
  62. package/src/cli/build/watching.js +6 -3
  63. package/src/cli/index.js +234 -3
  64. package/src/cli.js +4 -220
  65. package/src/corePlugins.js +31 -3
  66. package/src/index.js +4 -46
  67. package/src/lib/content.js +12 -17
  68. package/src/lib/defaultExtractor.js +9 -3
  69. package/src/lib/detectNesting.js +9 -1
  70. package/src/lib/expandTailwindAtRules.js +37 -6
  71. package/src/lib/generateRules.js +90 -28
  72. package/src/lib/offsets.js +104 -1
  73. package/src/lib/remap-bitfield.js +82 -0
  74. package/src/lib/setupContextUtils.js +99 -56
  75. package/src/lib/setupTrackingContext.js +31 -6
  76. package/src/lib/sharedState.js +17 -0
  77. package/src/oxide/cli/build/deps.ts +91 -0
  78. package/src/oxide/cli/build/index.ts +47 -0
  79. package/src/oxide/cli/build/plugin.ts +436 -0
  80. package/src/oxide/cli/build/utils.ts +74 -0
  81. package/src/oxide/cli/build/watching.ts +225 -0
  82. package/src/oxide/cli/help/index.ts +69 -0
  83. package/src/oxide/cli/index.ts +212 -0
  84. package/src/oxide/cli/init/index.ts +32 -0
  85. package/src/oxide/cli.ts +1 -0
  86. package/src/oxide/postcss-plugin.ts +1 -0
  87. package/src/plugin.js +107 -0
  88. package/src/util/color.js +17 -2
  89. package/src/util/dataTypes.js +29 -4
  90. package/src/util/formatVariantSelector.js +215 -122
  91. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  92. package/src/util/negateValue.js +1 -1
  93. package/src/util/normalizeConfig.js +18 -0
  94. package/src/util/pluginUtils.js +22 -19
  95. package/src/util/prefixSelector.js +28 -10
  96. package/src/util/resolveConfig.js +0 -2
  97. package/stubs/defaultConfig.stub.js +149 -165
  98. package/types/config.d.ts +7 -2
  99. package/types/generated/default-theme.d.ts +77 -77
  100. package/lib/cli/shared.js +0 -12
  101. package/scripts/install-integrations.js +0 -27
  102. package/scripts/rebuildFixtures.js +0 -68
  103. package/src/cli/shared.js +0 -5
@@ -9,9 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- selectorFunctions: ()=>selectorFunctions,
13
12
  formatVariantSelector: ()=>formatVariantSelector,
14
- finalizeSelector: ()=>finalizeSelector
13
+ finalizeSelector: ()=>finalizeSelector,
14
+ handleMergePseudo: ()=>handleMergePseudo
15
15
  });
16
16
  const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
17
17
  const _unesc = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc"));
@@ -22,28 +22,39 @@ function _interopRequireDefault(obj) {
22
22
  default: obj
23
23
  };
24
24
  }
25
- var ref;
26
- let MERGE = ":merge";
27
- let PARENT = "&";
28
- let selectorFunctions = new Set([
29
- MERGE
30
- ]);
31
- function formatVariantSelector(current, ...others) {
32
- for (let other of others){
33
- let incomingValue = resolveFunctionArgument(other, MERGE);
34
- if (incomingValue !== null) {
35
- let existingValue = resolveFunctionArgument(current, MERGE, incomingValue);
36
- if (existingValue !== null) {
37
- let existingTarget = `${MERGE}(${incomingValue})`;
38
- let splitIdx = other.indexOf(existingTarget);
39
- let addition = other.slice(splitIdx + existingTarget.length).split(" ")[0];
40
- current = current.replace(existingTarget, existingTarget + addition);
41
- continue;
42
- }
43
- }
44
- current = other.replace(PARENT, current);
25
+ /** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ /** @typedef {{format: string, isArbitraryVariant: boolean}[]} RawFormats */ /** @typedef {import('postcss-selector-parser').Root} ParsedFormats */ /** @typedef {RawFormats | ParsedFormats} AcceptedFormats */ let MERGE = ":merge";
26
+ function formatVariantSelector(formats, { context , candidate }) {
27
+ var _context_tailwindConfig_prefix;
28
+ let prefix = (_context_tailwindConfig_prefix = context === null || context === void 0 ? void 0 : context.tailwindConfig.prefix) !== null && _context_tailwindConfig_prefix !== void 0 ? _context_tailwindConfig_prefix : "";
29
+ // Parse the format selector into an AST
30
+ let parsedFormats = formats.map((format)=>{
31
+ let ast = (0, _postcssSelectorParser.default)().astSync(format.format);
32
+ return {
33
+ ...format,
34
+ ast: format.isArbitraryVariant ? ast : (0, _prefixSelector.default)(prefix, ast)
35
+ };
36
+ });
37
+ // We start with the candidate selector
38
+ let formatAst = _postcssSelectorParser.default.root({
39
+ nodes: [
40
+ _postcssSelectorParser.default.selector({
41
+ nodes: [
42
+ _postcssSelectorParser.default.className({
43
+ value: (0, _escapeClassName.default)(candidate)
44
+ })
45
+ ]
46
+ })
47
+ ]
48
+ });
49
+ // And iteratively merge each format selector into the candidate selector
50
+ for (let { ast } of parsedFormats){
51
+ [formatAst, ast] = handleMergePseudo(formatAst, ast);
52
+ // 2. Merge the format selector into the current selector AST
53
+ ast.walkNesting((nesting)=>nesting.replaceWith(...formatAst.nodes[0].nodes));
54
+ // 3. Keep going!
55
+ formatAst = ast;
45
56
  }
46
- return current;
57
+ return formatAst;
47
58
  }
48
59
  /**
49
60
  * Given any node in a selector this gets the "simple" selector it's a part of
@@ -51,10 +62,10 @@ function formatVariantSelector(current, ...others) {
51
62
  * Technically :is(), :not(), :has(), etc… can have combinators but those are nested
52
63
  * inside the relevant node and won't be picked up so they're fine to ignore
53
64
  *
54
- * @param {import('postcss-selector-parser').Node} node
55
- * @returns {import('postcss-selector-parser').Node[]}
65
+ * @param {Node} node
66
+ * @returns {Node[]}
56
67
  **/ function simpleSelectorForNode(node) {
57
- /** @type {import('postcss-selector-parser').Node[]} */ let nodes = [];
68
+ /** @type {Node[]} */ let nodes = [];
58
69
  // Walk backwards until we hit a combinator node (or the start)
59
70
  while(node.prev() && node.prev().type !== "combinator"){
60
71
  node = node.prev();
@@ -70,8 +81,8 @@ function formatVariantSelector(current, ...others) {
70
81
  * Resorts the nodes in a selector to ensure they're in the correct order
71
82
  * Tags go before classes, and pseudo classes go after classes
72
83
  *
73
- * @param {import('postcss-selector-parser').Selector} sel
74
- * @returns {import('postcss-selector-parser').Selector}
84
+ * @param {Selector} sel
85
+ * @returns {Selector}
75
86
  **/ function resortSelector(sel) {
76
87
  sel.sort((a, b)=>{
77
88
  if (a.type === "tag" && b.type === "class") {
@@ -87,7 +98,18 @@ function formatVariantSelector(current, ...others) {
87
98
  });
88
99
  return sel;
89
100
  }
90
- function eliminateIrrelevantSelectors(sel, base) {
101
+ /**
102
+ * Remove extraneous selectors that do not include the base class/candidate
103
+ *
104
+ * Example:
105
+ * Given the utility `.a, .b { color: red}`
106
+ * Given the candidate `sm:b`
107
+ *
108
+ * The final selector should be `.sm\:b` and not `.a, .sm\:b`
109
+ *
110
+ * @param {Selector} ast
111
+ * @param {string} base
112
+ */ function eliminateIrrelevantSelectors(sel, base) {
91
113
  let hasClassesMatchingCandidate = false;
92
114
  sel.walk((child)=>{
93
115
  if (child.type === "class" && child.value === base) {
@@ -106,27 +128,20 @@ function eliminateIrrelevantSelectors(sel, base) {
106
128
  // meaning of the selector.
107
129
  // TODO: Can we do this for :matches, :is, and :where?
108
130
  }
109
- var ref1;
110
- function finalizeSelector(format, { selector , candidate , context , isArbitraryVariant , // Split by the separator, but ignore the separator inside square brackets:
111
- //
112
- // E.g.: dark:lg:hover:[paint-order:markers]
113
- // ┬ ┬ ┬ ┬
114
- // │ │ │ ╰── We will not split here
115
- // ╰──┴─────┴─────────────── We will split here
116
- //
117
- base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === void 0 ? void 0 : (ref = context.tailwindConfig) === null || ref === void 0 ? void 0 : ref.separator) !== null && ref1 !== void 0 ? ref1 : ":"}(?![^[]*\\])`)).pop() }) {
118
- var ref2;
119
- let ast = (0, _postcssSelectorParser.default)().astSync(selector);
120
- // We explicitly DO NOT prefix classes in arbitrary variants
121
- if ((context === null || context === void 0 ? void 0 : (ref2 = context.tailwindConfig) === null || ref2 === void 0 ? void 0 : ref2.prefix) && !isArbitraryVariant) {
122
- format = (0, _prefixSelector.default)(context.tailwindConfig.prefix, format);
123
- }
124
- format = format.replace(PARENT, `.${(0, _escapeClassName.default)(candidate)}`);
125
- let formatAst = (0, _postcssSelectorParser.default)().astSync(format);
126
- // Remove extraneous selectors that do not include the base class/candidate being matched against
127
- // For example if we have a utility defined `.a, .b { color: red}`
128
- // And the formatted variant is sm:b then we want the final selector to be `.sm\:b` and not `.a, .sm\:b`
129
- ast.each((sel)=>eliminateIrrelevantSelectors(sel, base));
131
+ function finalizeSelector(current, formats, { context , candidate , base }) {
132
+ var _context_tailwindConfig;
133
+ var _context_tailwindConfig_separator;
134
+ let separator = (_context_tailwindConfig_separator = context === null || context === void 0 ? void 0 : (_context_tailwindConfig = context.tailwindConfig) === null || _context_tailwindConfig === void 0 ? void 0 : _context_tailwindConfig.separator) !== null && _context_tailwindConfig_separator !== void 0 ? _context_tailwindConfig_separator : ":";
135
+ // Split by the separator, but ignore the separator inside square brackets:
136
+ //
137
+ // E.g.: dark:lg:hover:[paint-order:markers]
138
+ // ┬ ┬ ┬ ┬
139
+ // │ │ │ ╰── We will not split here
140
+ // ╰──┴─────┴─────────────── We will split here
141
+ //
142
+ base = base !== null && base !== void 0 ? base : candidate.split(new RegExp(`\\${separator}(?![^[]*\\])`)).pop();
143
+ // Parse the selector into an AST
144
+ let selector = (0, _postcssSelectorParser.default)().astSync(current);
130
145
  // Normalize escaped classes, e.g.:
131
146
  //
132
147
  // The idea would be to replace the escaped `base` in the selector with the
@@ -138,11 +153,22 @@ base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === vo
138
153
  // base in selector: bg-\\[rgb\\(255\\,0\\,0\\)\\]
139
154
  // escaped base: bg-\\[rgb\\(255\\2c 0\\2c 0\\)\\]
140
155
  //
141
- ast.walkClasses((node)=>{
156
+ selector.walkClasses((node)=>{
142
157
  if (node.raws && node.value.includes(base)) {
143
158
  node.raws.value = (0, _escapeClassName.default)((0, _unesc.default)(node.raws.value));
144
159
  }
145
160
  });
161
+ // Remove extraneous selectors that do not include the base candidate
162
+ selector.each((sel)=>eliminateIrrelevantSelectors(sel, base));
163
+ // If there are no formats that means there were no variants added to the candidate
164
+ // so we can just return the selector as-is
165
+ let formatAst = Array.isArray(formats) ? formatVariantSelector(formats, {
166
+ context,
167
+ candidate
168
+ }) : formats;
169
+ if (formatAst === null) {
170
+ return selector.toString();
171
+ }
146
172
  let simpleStart = _postcssSelectorParser.default.comment({
147
173
  value: "/*__simple__*/"
148
174
  });
@@ -151,7 +177,7 @@ base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === vo
151
177
  });
152
178
  // We can safely replace the escaped base now, since the `base` section is
153
179
  // now in a normalized escaped value.
154
- ast.walkClasses((node)=>{
180
+ selector.walkClasses((node)=>{
155
181
  if (node.value !== base) {
156
182
  return;
157
183
  }
@@ -166,7 +192,7 @@ base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === vo
166
192
  parent.insertBefore(simpleSelector[0], simpleStart);
167
193
  parent.insertAfter(simpleSelector[simpleSelector.length - 1], simpleEnd);
168
194
  for (let child of formatNodes){
169
- parent.insertBefore(simpleSelector[0], child);
195
+ parent.insertBefore(simpleSelector[0], child.clone());
170
196
  }
171
197
  node.remove();
172
198
  // Re-sort the simple selector to ensure it's in the correct order
@@ -178,41 +204,68 @@ base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === vo
178
204
  simpleStart.remove();
179
205
  simpleEnd.remove();
180
206
  });
181
- // This will make sure to move pseudo's to the correct spot (the end for
182
- // pseudo elements) because otherwise the selector will never work
183
- // anyway.
184
- //
185
- // E.g.:
186
- // - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
187
- // - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
188
- //
189
- // `::before:hover` doesn't work, which means that we can make it work for you by flipping the order.
190
- function collectPseudoElements(selector) {
191
- let nodes = [];
192
- for (let node of selector.nodes){
193
- if (isPseudoElement(node)) {
194
- nodes.push(node);
195
- selector.removeChild(node);
196
- }
197
- if (node === null || node === void 0 ? void 0 : node.nodes) {
198
- nodes.push(...collectPseudoElements(node));
199
- }
200
- }
201
- return nodes;
202
- }
203
207
  // Remove unnecessary pseudo selectors that we used as placeholders
204
- ast.each((selector)=>{
205
- selector.walkPseudos((p)=>{
206
- if (selectorFunctions.has(p.value)) {
207
- p.replaceWith(p.nodes);
208
- }
209
- });
210
- let pseudoElements = collectPseudoElements(selector);
208
+ selector.walkPseudos((p)=>{
209
+ if (p.value === MERGE) {
210
+ p.replaceWith(p.nodes);
211
+ }
212
+ });
213
+ // Move pseudo elements to the end of the selector (if necessary)
214
+ selector.each((sel)=>{
215
+ let pseudoElements = collectPseudoElements(sel);
211
216
  if (pseudoElements.length > 0) {
212
- selector.nodes.push(pseudoElements.sort(sortSelector));
217
+ sel.nodes.push(pseudoElements.sort(sortSelector));
213
218
  }
214
219
  });
215
- return ast.toString();
220
+ return selector.toString();
221
+ }
222
+ function handleMergePseudo(selector, format) {
223
+ /** @type {{pseudo: Pseudo, value: string}[]} */ let merges = [];
224
+ // Find all :merge() pseudo-classes in `selector`
225
+ selector.walkPseudos((pseudo)=>{
226
+ if (pseudo.value === MERGE) {
227
+ merges.push({
228
+ pseudo,
229
+ value: pseudo.nodes[0].toString()
230
+ });
231
+ }
232
+ });
233
+ // Find all :merge() "attachments" in `format` and attach them to the matching selector in `selector`
234
+ format.walkPseudos((pseudo)=>{
235
+ if (pseudo.value !== MERGE) {
236
+ return;
237
+ }
238
+ let value = pseudo.nodes[0].toString();
239
+ // Does `selector` contain a :merge() pseudo-class with the same value?
240
+ let existing = merges.find((merge)=>merge.value === value);
241
+ // Nope so there's nothing to do
242
+ if (!existing) {
243
+ return;
244
+ }
245
+ // Everything after `:merge()` up to the next combinator is what is attached to the merged selector
246
+ let attachments = [];
247
+ let next = pseudo.next();
248
+ while(next && next.type !== "combinator"){
249
+ attachments.push(next);
250
+ next = next.next();
251
+ }
252
+ let combinator = next;
253
+ existing.pseudo.parent.insertAfter(existing.pseudo, _postcssSelectorParser.default.selector({
254
+ nodes: attachments.map((node)=>node.clone())
255
+ }));
256
+ pseudo.remove();
257
+ attachments.forEach((node)=>node.remove());
258
+ // What about this case:
259
+ // :merge(.group):focus > &
260
+ // :merge(.group):hover &
261
+ if (combinator && combinator.type === "combinator") {
262
+ combinator.remove();
263
+ }
264
+ });
265
+ return [
266
+ selector,
267
+ format
268
+ ];
216
269
  }
217
270
  // Note: As a rule, double colons (::) should be used instead of a single colon
218
271
  // (:). This distinguishes pseudo-classes from pseudo-elements. However, since
@@ -226,8 +279,41 @@ let pseudoElementsBC = [
226
279
  ];
227
280
  // These pseudo-elements _can_ be combined with other pseudo selectors AND the order does matter.
228
281
  let pseudoElementExceptions = [
229
- "::file-selector-button"
282
+ "::file-selector-button",
283
+ // Webkit scroll bar pseudo elements can be combined with user-action pseudo classes
284
+ "::-webkit-scrollbar",
285
+ "::-webkit-scrollbar-button",
286
+ "::-webkit-scrollbar-thumb",
287
+ "::-webkit-scrollbar-track",
288
+ "::-webkit-scrollbar-track-piece",
289
+ "::-webkit-scrollbar-corner",
290
+ "::-webkit-resizer"
230
291
  ];
292
+ /**
293
+ * This will make sure to move pseudo's to the correct spot (the end for
294
+ * pseudo elements) because otherwise the selector will never work
295
+ * anyway.
296
+ *
297
+ * E.g.:
298
+ * - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
299
+ * - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
300
+ *
301
+ * `::before:hover` doesn't work, which means that we can make it work for you by flipping the order.
302
+ *
303
+ * @param {Selector} selector
304
+ **/ function collectPseudoElements(selector) {
305
+ /** @type {Node[]} */ let nodes = [];
306
+ for (let node of selector.nodes){
307
+ if (isPseudoElement(node)) {
308
+ nodes.push(node);
309
+ selector.removeChild(node);
310
+ }
311
+ if (node === null || node === void 0 ? void 0 : node.nodes) {
312
+ nodes.push(...collectPseudoElements(node));
313
+ }
314
+ }
315
+ return nodes;
316
+ }
231
317
  // This will make sure to move pseudo's to the correct spot (the end for
232
318
  // pseudo elements) because otherwise the selector will never work
233
319
  // anyway.
@@ -263,23 +349,3 @@ function isPseudoElement(node) {
263
349
  if (pseudoElementExceptions.includes(node.value)) return false;
264
350
  return node.value.startsWith("::") || pseudoElementsBC.includes(node.value);
265
351
  }
266
- function resolveFunctionArgument(haystack, needle, arg) {
267
- let startIdx = haystack.indexOf(arg ? `${needle}(${arg})` : needle);
268
- if (startIdx === -1) return null;
269
- // Start inside the `(`
270
- startIdx += needle.length + 1;
271
- let target = "";
272
- let count = 0;
273
- for (let char of haystack.slice(startIdx)){
274
- if (char !== "(" && char !== ")") {
275
- target += char;
276
- } else if (char === "(") {
277
- target += char;
278
- count++;
279
- } else if (char === ")") {
280
- if (--count < 0) break; // unbalanced
281
- target += char;
282
- }
283
- }
284
- return target;
285
- }
@@ -14,8 +14,8 @@ function _interopRequireDefault(obj) {
14
14
  };
15
15
  }
16
16
  function getAllConfigs(config) {
17
- var ref;
18
- const configs = ((ref = config === null || config === void 0 ? void 0 : config.presets) !== null && ref !== void 0 ? ref : [
17
+ var _config_presets;
18
+ const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
19
19
  _defaultConfigStubJs.default
20
20
  ]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
21
21
  const features = {
@@ -10,7 +10,7 @@ Object.defineProperty(exports, // Arbitrary values must contain balanced bracket
10
10
  // E.g.: content-['this-is-also-valid]-weirdly-enough']
11
11
  "default", {
12
12
  enumerable: true,
13
- get: ()=>isValidArbitraryValue
13
+ get: ()=>isSyntacticallyValidPropertyValue
14
14
  });
15
15
  let matchingBrackets = new Map([
16
16
  [
@@ -35,7 +35,7 @@ let quotes = new Set([
35
35
  "'",
36
36
  "`"
37
37
  ]);
38
- function isValidArbitraryValue(value) {
38
+ function isSyntacticallyValidPropertyValue(value) {
39
39
  let stack = [];
40
40
  let inQuotes = false;
41
41
  for(let i = 0; i < value.length; i++){
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: ()=>negateValue
8
8
  });
9
- function _default(value) {
9
+ function negateValue(value) {
10
10
  value = `${value}`;
11
11
  if (value === "0") {
12
12
  return "0";
@@ -154,12 +154,26 @@ function normalizeConfig(config) {
154
154
  }
155
155
  // Normalize the `safelist`
156
156
  config.safelist = (()=>{
157
- var ref;
157
+ var _purge_options;
158
158
  let { content , purge , safelist } = config;
159
159
  if (Array.isArray(safelist)) return safelist;
160
160
  if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
161
161
  if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return purge.safelist;
162
- if (Array.isArray(purge === null || purge === void 0 ? void 0 : (ref = purge.options) === null || ref === void 0 ? void 0 : ref.safelist)) return purge.options.safelist;
162
+ if (Array.isArray(purge === null || purge === void 0 ? void 0 : (_purge_options = purge.options) === null || _purge_options === void 0 ? void 0 : _purge_options.safelist)) return purge.options.safelist;
163
+ return [];
164
+ })();
165
+ // Normalize the `blocklist`
166
+ config.blocklist = (()=>{
167
+ let { blocklist } = config;
168
+ if (Array.isArray(blocklist)) {
169
+ if (blocklist.every((item)=>typeof item === "string")) {
170
+ return blocklist;
171
+ }
172
+ _log.default.warn("blocklist-invalid", [
173
+ "The `blocklist` option must be an array of strings.",
174
+ "https://tailwindcss.com/docs/content-configuration#discarding-classes"
175
+ ]);
176
+ }
163
177
  return [];
164
178
  })();
165
179
  // Normalize prefix option
@@ -171,19 +185,19 @@ function normalizeConfig(config) {
171
185
  ]);
172
186
  config.prefix = "";
173
187
  } else {
174
- var _prefix;
175
- config.prefix = (_prefix = config.prefix) !== null && _prefix !== void 0 ? _prefix : "";
188
+ var _config_prefix;
189
+ config.prefix = (_config_prefix = config.prefix) !== null && _config_prefix !== void 0 ? _config_prefix : "";
176
190
  }
177
191
  // Normalize the `content`
178
192
  config.content = {
179
193
  relative: (()=>{
180
- var ref;
194
+ var _config_future;
181
195
  let { content } = config;
182
196
  if (content === null || content === void 0 ? void 0 : content.relative) {
183
197
  return content.relative;
184
198
  }
185
- var ref1;
186
- return (ref1 = (ref = config.future) === null || ref === void 0 ? void 0 : ref.relativeContentPathsByDefault) !== null && ref1 !== void 0 ? ref1 : false;
199
+ var _config_future_relativeContentPathsByDefault;
200
+ return (_config_future_relativeContentPathsByDefault = (_config_future = config.future) === null || _config_future === void 0 ? void 0 : _config_future.relativeContentPathsByDefault) !== null && _config_future_relativeContentPathsByDefault !== void 0 ? _config_future_relativeContentPathsByDefault : false;
187
201
  })(),
188
202
  files: (()=>{
189
203
  let { content , purge } = config;
@@ -196,22 +210,22 @@ function normalizeConfig(config) {
196
210
  })(),
197
211
  extract: (()=>{
198
212
  let extract = (()=>{
199
- var ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9;
200
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.extract) return config.purge.extract;
201
- if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.extract) return config.content.extract;
202
- if ((ref2 = config.purge) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.extract) === null || ref3 === void 0 ? void 0 : ref3.DEFAULT) return config.purge.extract.DEFAULT;
203
- if ((ref4 = config.content) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.extract) === null || ref5 === void 0 ? void 0 : ref5.DEFAULT) return config.content.extract.DEFAULT;
204
- if ((ref6 = config.purge) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.options) === null || ref7 === void 0 ? void 0 : ref7.extractors) return config.purge.options.extractors;
205
- if ((ref8 = config.content) === null || ref8 === void 0 ? void 0 : (ref9 = ref8.options) === null || ref9 === void 0 ? void 0 : ref9.extractors) return config.content.options.extractors;
213
+ var _config_purge, _config_content, _config_purge1, _config_purge_extract, _config_content1, _config_content_extract, _config_purge2, _config_purge_options, _config_content2, _config_content_options;
214
+ if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.extract) return config.purge.extract;
215
+ if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.extract) return config.content.extract;
216
+ if ((_config_purge1 = config.purge) === null || _config_purge1 === void 0 ? void 0 : (_config_purge_extract = _config_purge1.extract) === null || _config_purge_extract === void 0 ? void 0 : _config_purge_extract.DEFAULT) return config.purge.extract.DEFAULT;
217
+ if ((_config_content1 = config.content) === null || _config_content1 === void 0 ? void 0 : (_config_content_extract = _config_content1.extract) === null || _config_content_extract === void 0 ? void 0 : _config_content_extract.DEFAULT) return config.content.extract.DEFAULT;
218
+ if ((_config_purge2 = config.purge) === null || _config_purge2 === void 0 ? void 0 : (_config_purge_options = _config_purge2.options) === null || _config_purge_options === void 0 ? void 0 : _config_purge_options.extractors) return config.purge.options.extractors;
219
+ if ((_config_content2 = config.content) === null || _config_content2 === void 0 ? void 0 : (_config_content_options = _config_content2.options) === null || _config_content_options === void 0 ? void 0 : _config_content_options.extractors) return config.content.options.extractors;
206
220
  return {};
207
221
  })();
208
222
  let extractors = {};
209
223
  let defaultExtractor = (()=>{
210
- var ref, ref1, ref2, ref3;
211
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : (ref1 = ref.options) === null || ref1 === void 0 ? void 0 : ref1.defaultExtractor) {
224
+ var _config_purge, _config_purge_options, _config_content, _config_content_options;
225
+ if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : (_config_purge_options = _config_purge.options) === null || _config_purge_options === void 0 ? void 0 : _config_purge_options.defaultExtractor) {
212
226
  return config.purge.options.defaultExtractor;
213
227
  }
214
- if ((ref2 = config.content) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.options) === null || ref3 === void 0 ? void 0 : ref3.defaultExtractor) {
228
+ if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : (_config_content_options = _config_content.options) === null || _config_content_options === void 0 ? void 0 : _config_content_options.defaultExtractor) {
215
229
  return config.content.options.defaultExtractor;
216
230
  }
217
231
  return undefined;
@@ -235,11 +249,11 @@ function normalizeConfig(config) {
235
249
  })(),
236
250
  transform: (()=>{
237
251
  let transform = (()=>{
238
- var ref, ref1, ref2, ref3, ref4, ref5;
239
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.transform) return config.purge.transform;
240
- if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.transform) return config.content.transform;
241
- if ((ref2 = config.purge) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.transform) === null || ref3 === void 0 ? void 0 : ref3.DEFAULT) return config.purge.transform.DEFAULT;
242
- if ((ref4 = config.content) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.transform) === null || ref5 === void 0 ? void 0 : ref5.DEFAULT) return config.content.transform.DEFAULT;
252
+ var _config_purge, _config_content, _config_purge1, _config_purge_transform, _config_content1, _config_content_transform;
253
+ if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.transform) return config.purge.transform;
254
+ if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.transform) return config.content.transform;
255
+ if ((_config_purge1 = config.purge) === null || _config_purge1 === void 0 ? void 0 : (_config_purge_transform = _config_purge1.transform) === null || _config_purge_transform === void 0 ? void 0 : _config_purge_transform.DEFAULT) return config.purge.transform.DEFAULT;
256
+ if ((_config_content1 = config.content) === null || _config_content1 === void 0 ? void 0 : (_config_content_transform = _config_content1.transform) === null || _config_content_transform === void 0 ? void 0 : _config_content_transform.DEFAULT) return config.content.transform.DEFAULT;
243
257
  return {};
244
258
  })();
245
259
  let transformers = {};