tailwindcss 0.0.0-insiders.d33b650 → 0.0.0-insiders.d3f2221

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 (191) hide show
  1. package/README.md +1 -1
  2. package/index.css +5 -0
  3. package/lib/cli/build/index.js +32 -19
  4. package/lib/cli/build/plugin.js +228 -148
  5. package/lib/cli/build/utils.js +31 -21
  6. package/lib/cli/build/watching.js +99 -30
  7. package/lib/cli/help/index.js +17 -15
  8. package/lib/cli/index.js +223 -10
  9. package/lib/cli/init/index.js +31 -14
  10. package/lib/cli.js +1 -227
  11. package/lib/corePluginList.js +8 -1
  12. package/lib/corePlugins.js +2128 -1823
  13. package/lib/css/preflight.css +17 -4
  14. package/lib/featureFlags.js +39 -25
  15. package/lib/index.js +1 -47
  16. package/lib/lib/cacheInvalidation.js +10 -8
  17. package/lib/lib/collapseAdjacentRules.js +10 -8
  18. package/lib/lib/collapseDuplicateDeclarations.js +13 -11
  19. package/lib/lib/content.js +65 -28
  20. package/lib/lib/defaultExtractor.js +24 -32
  21. package/lib/lib/detectNesting.js +18 -10
  22. package/lib/lib/evaluateTailwindFunctions.js +45 -41
  23. package/lib/lib/expandApplyAtRules.js +60 -52
  24. package/lib/lib/expandTailwindAtRules.js +115 -47
  25. package/lib/lib/findAtConfigPath.js +14 -12
  26. package/lib/lib/generateRules.js +206 -146
  27. package/lib/lib/getModuleDependencies.js +85 -37
  28. package/lib/lib/handleImportAtRules.js +50 -0
  29. package/lib/lib/load-config.js +42 -0
  30. package/lib/lib/normalizeTailwindDirectives.js +26 -39
  31. package/lib/lib/offsets.js +136 -47
  32. package/lib/lib/partitionApplyAtRules.js +5 -3
  33. package/lib/lib/regex.js +26 -12
  34. package/lib/lib/remap-bitfield.js +89 -0
  35. package/lib/lib/resolveDefaultsAtRules.js +53 -49
  36. package/lib/lib/setupContextUtils.js +337 -250
  37. package/lib/lib/setupTrackingContext.js +54 -29
  38. package/lib/lib/sharedState.js +36 -17
  39. package/lib/lib/substituteScreenAtRules.js +9 -7
  40. package/lib/plugin.js +164 -0
  41. package/lib/postcss-plugins/nesting/index.js +5 -3
  42. package/lib/postcss-plugins/nesting/plugin.js +19 -17
  43. package/lib/processTailwindFeatures.js +19 -17
  44. package/lib/public/colors.js +269 -245
  45. package/lib/public/create-plugin.js +5 -3
  46. package/lib/public/default-config.js +6 -4
  47. package/lib/public/default-theme.js +6 -4
  48. package/lib/public/load-config.js +12 -0
  49. package/lib/public/resolve-config.js +6 -4
  50. package/lib/util/applyImportantSelector.js +36 -0
  51. package/lib/util/bigSign.js +3 -1
  52. package/lib/util/buildMediaQuery.js +5 -3
  53. package/lib/util/cloneDeep.js +4 -2
  54. package/lib/util/cloneNodes.js +6 -4
  55. package/lib/util/color.js +46 -28
  56. package/lib/util/colorNames.js +752 -0
  57. package/lib/util/configurePlugins.js +3 -1
  58. package/lib/util/createPlugin.js +3 -1
  59. package/lib/util/createUtilityPlugin.js +9 -7
  60. package/lib/util/dataTypes.js +215 -96
  61. package/lib/util/defaults.js +9 -7
  62. package/lib/util/escapeClassName.js +10 -8
  63. package/lib/util/escapeCommas.js +4 -2
  64. package/lib/util/flattenColorPalette.js +5 -3
  65. package/lib/util/formatVariantSelector.js +149 -169
  66. package/lib/util/getAllConfigs.js +12 -9
  67. package/lib/util/hashConfig.js +6 -4
  68. package/lib/util/isKeyframeRule.js +4 -2
  69. package/lib/util/isPlainObject.js +4 -2
  70. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +14 -12
  71. package/lib/util/log.js +31 -10
  72. package/lib/util/nameClass.js +16 -10
  73. package/lib/util/negateValue.js +12 -10
  74. package/lib/util/normalizeConfig.js +123 -77
  75. package/lib/util/normalizeScreens.js +30 -22
  76. package/lib/util/parseAnimationValue.js +41 -39
  77. package/lib/util/parseBoxShadowValue.js +24 -20
  78. package/lib/util/parseDependency.js +7 -5
  79. package/lib/util/parseGlob.js +10 -8
  80. package/lib/util/parseObjectStyles.js +10 -8
  81. package/lib/util/pluginUtils.js +92 -96
  82. package/lib/util/prefixSelector.js +27 -11
  83. package/lib/util/pseudoElements.js +209 -0
  84. package/lib/util/removeAlphaVariables.js +4 -2
  85. package/lib/util/resolveConfig.js +28 -24
  86. package/lib/util/resolveConfigPath.js +28 -12
  87. package/lib/util/responsive.js +7 -5
  88. package/lib/util/splitAtTopLevelOnly.js +12 -4
  89. package/lib/util/tap.js +3 -1
  90. package/lib/util/toColorValue.js +4 -2
  91. package/lib/util/toPath.js +5 -3
  92. package/lib/util/transformThemeValue.js +30 -28
  93. package/lib/util/validateConfig.js +31 -7
  94. package/lib/util/validateFormalSyntax.js +8 -6
  95. package/lib/util/withAlphaVariable.js +11 -7
  96. package/lib/value-parser/LICENSE +22 -0
  97. package/lib/value-parser/README.md +3 -0
  98. package/lib/value-parser/index.d.js +2 -0
  99. package/lib/value-parser/index.js +22 -0
  100. package/lib/value-parser/parse.js +259 -0
  101. package/lib/value-parser/stringify.js +38 -0
  102. package/lib/value-parser/unit.js +86 -0
  103. package/lib/value-parser/walk.js +16 -0
  104. package/loadConfig.d.ts +4 -0
  105. package/loadConfig.js +2 -0
  106. package/package.json +49 -50
  107. package/resolveConfig.d.ts +11 -2
  108. package/scripts/release-notes.js +1 -1
  109. package/src/cli/build/index.js +17 -9
  110. package/src/cli/build/plugin.js +129 -77
  111. package/src/cli/build/watching.js +108 -13
  112. package/src/cli/index.js +217 -3
  113. package/src/cli/init/index.js +37 -8
  114. package/src/cli.js +1 -221
  115. package/src/corePluginList.js +1 -1
  116. package/src/corePlugins.js +259 -46
  117. package/src/css/preflight.css +17 -4
  118. package/src/featureFlags.js +7 -7
  119. package/src/index.js +1 -47
  120. package/src/lib/content.js +44 -10
  121. package/src/lib/defaultExtractor.js +10 -14
  122. package/src/lib/detectNesting.js +9 -1
  123. package/src/lib/evaluateTailwindFunctions.js +4 -1
  124. package/src/lib/expandApplyAtRules.js +10 -3
  125. package/src/lib/expandTailwindAtRules.js +78 -13
  126. package/src/lib/generateRules.js +140 -65
  127. package/src/lib/getModuleDependencies.js +70 -30
  128. package/src/lib/handleImportAtRules.js +34 -0
  129. package/src/lib/load-config.ts +31 -0
  130. package/src/lib/normalizeTailwindDirectives.js +0 -27
  131. package/src/lib/offsets.js +105 -2
  132. package/src/lib/remap-bitfield.js +82 -0
  133. package/src/lib/setupContextUtils.js +145 -80
  134. package/src/lib/setupTrackingContext.js +37 -14
  135. package/src/lib/sharedState.js +11 -4
  136. package/src/plugin.js +133 -0
  137. package/src/processTailwindFeatures.js +3 -2
  138. package/src/public/colors.js +22 -0
  139. package/src/public/default-config.js +1 -1
  140. package/src/public/default-theme.js +2 -2
  141. package/src/public/load-config.js +2 -0
  142. package/src/util/applyImportantSelector.js +27 -0
  143. package/src/util/color.js +19 -4
  144. package/src/util/colorNames.js +150 -0
  145. package/src/util/dataTypes.js +97 -9
  146. package/src/util/formatVariantSelector.js +163 -165
  147. package/src/util/getAllConfigs.js +2 -2
  148. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  149. package/src/util/log.js +24 -0
  150. package/src/util/negateValue.js +1 -1
  151. package/src/util/normalizeConfig.js +57 -11
  152. package/src/util/pluginUtils.js +38 -54
  153. package/src/util/prefixSelector.js +29 -10
  154. package/src/util/pseudoElements.js +167 -0
  155. package/src/util/resolveConfig.js +0 -2
  156. package/src/util/resolveConfigPath.js +12 -1
  157. package/src/util/splitAtTopLevelOnly.js +8 -1
  158. package/src/util/validateConfig.js +23 -0
  159. package/src/value-parser/LICENSE +22 -0
  160. package/src/value-parser/README.md +3 -0
  161. package/src/value-parser/index.d.ts +177 -0
  162. package/src/value-parser/index.js +28 -0
  163. package/src/value-parser/parse.js +303 -0
  164. package/src/value-parser/stringify.js +41 -0
  165. package/src/value-parser/unit.js +118 -0
  166. package/src/value-parser/walk.js +18 -0
  167. package/stubs/.gitignore +1 -0
  168. package/stubs/.prettierrc.json +6 -0
  169. package/stubs/{defaultConfig.stub.js → config.full.js} +203 -172
  170. package/stubs/{simpleConfig.stub.js → config.simple.js} +1 -2
  171. package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -1
  172. package/stubs/postcss.config.js +5 -0
  173. package/stubs/tailwind.config.cjs +2 -0
  174. package/stubs/tailwind.config.js +2 -0
  175. package/stubs/tailwind.config.ts +3 -0
  176. package/types/config.d.ts +20 -13
  177. package/types/generated/colors.d.ts +22 -0
  178. package/types/generated/corePluginList.d.ts +1 -1
  179. package/types/generated/default-theme.d.ts +116 -80
  180. package/CHANGELOG.md +0 -2300
  181. package/lib/cli/build/deps.js +0 -54
  182. package/lib/cli/shared.js +0 -12
  183. package/lib/cli-peer-dependencies.js +0 -28
  184. package/lib/constants.js +0 -44
  185. package/peers/index.js +0 -79459
  186. package/scripts/install-integrations.js +0 -27
  187. package/scripts/rebuildFixtures.js +0 -68
  188. package/src/cli/build/deps.js +0 -56
  189. package/src/cli/shared.js +0 -5
  190. package/src/cli-peer-dependencies.js +0 -15
  191. package/src/constants.js +0 -17
@@ -4,15 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>expandTailwindAtRules
7
+ get: function() {
8
+ return expandTailwindAtRules;
9
+ }
8
10
  });
9
- const _quickLru = /*#__PURE__*/ _interopRequireDefault(require("quick-lru"));
10
- const _sharedState = /*#__PURE__*/ _interopRequireWildcard(require("./sharedState"));
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru"));
13
+ const _oxide = require("@tailwindcss/oxide");
14
+ const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
11
15
  const _generateRules = require("./generateRules");
12
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
13
- const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("../util/cloneNodes"));
16
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
17
+ const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes"));
14
18
  const _defaultExtractor = require("./defaultExtractor");
15
- function _interopRequireDefault(obj) {
19
+ const _featureFlags = require("../featureFlags");
20
+ function _interop_require_default(obj) {
16
21
  return obj && obj.__esModule ? obj : {
17
22
  default: obj
18
23
  };
@@ -25,7 +30,7 @@ function _getRequireWildcardCache(nodeInterop) {
25
30
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
26
31
  })(nodeInterop);
27
32
  }
28
- function _interopRequireWildcard(obj, nodeInterop) {
33
+ function _interop_require_wildcard(obj, nodeInterop) {
29
34
  if (!nodeInterop && obj && obj.__esModule) {
30
35
  return obj;
31
36
  }
@@ -62,11 +67,16 @@ const builtInExtractors = {
62
67
  };
63
68
  const builtInTransformers = {
64
69
  DEFAULT: (content)=>content,
65
- svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ")
70
+ svelte: (content)=>content.replace(/(?:^|\s)class:/g, ' ')
66
71
  };
67
72
  function getExtractor(context, fileExtension) {
68
73
  let extractors = context.tailwindConfig.content.extract;
69
- return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context);
74
+ return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || // Because we call `DEFAULT(context)`, the returning function is always a new function without a
75
+ // stable identity. Marking it with `DEFAULT_EXTRACTOR` allows us to check if it is the default
76
+ // extractor without relying on the function identity.
77
+ Object.assign(builtInExtractors.DEFAULT(context), {
78
+ DEFAULT_EXTRACTOR: true
79
+ });
70
80
  }
71
81
  function getTransformer(tailwindConfig, fileExtension) {
72
82
  let transformers = tailwindConfig.content.transform;
@@ -78,11 +88,11 @@ let extractorCache = new WeakMap();
78
88
  // up these regexes by 50% that could cut initial build time by like 20%.
79
89
  function getClassCandidates(content, extractor, candidates, seen) {
80
90
  if (!extractorCache.has(extractor)) {
81
- extractorCache.set(extractor, new _quickLru.default({
91
+ extractorCache.set(extractor, new _quicklru.default({
82
92
  maxSize: 25000
83
93
  }));
84
94
  }
85
- for (let line of content.split("\n")){
95
+ for (let line of content.split('\n')){
86
96
  line = line.trim();
87
97
  if (seen.has(line)) {
88
98
  continue;
@@ -93,10 +103,10 @@ function getClassCandidates(content, extractor, candidates, seen) {
93
103
  candidates.add(match);
94
104
  }
95
105
  } else {
96
- let extractorMatches = extractor(line).filter((s)=>s !== "!*");
106
+ let extractorMatches = extractor(line).filter((s)=>s !== '!*');
97
107
  let lineMatchesSet = new Set(extractorMatches);
98
- for (let match1 of lineMatchesSet){
99
- candidates.add(match1);
108
+ for (let match of lineMatchesSet){
109
+ candidates.add(match);
100
110
  }
101
111
  extractorCache.get(extractor).set(line, lineMatchesSet);
102
112
  }
@@ -121,7 +131,7 @@ function getClassCandidates(content, extractor, candidates, seen) {
121
131
  return returnValue;
122
132
  }
123
133
  function expandTailwindAtRules(context) {
124
- return (root)=>{
134
+ return async (root)=>{
125
135
  let layerNodes = {
126
136
  base: null,
127
137
  components: null,
@@ -133,7 +143,7 @@ function expandTailwindAtRules(context) {
133
143
  // a lot of work and bail early. Also we don't have to register our touch
134
144
  // file as a dependency since the output of this CSS does not depend on
135
145
  // the source of any templates. Think Vue <style> blocks for example.
136
- if (rule.name === "tailwind") {
146
+ if (rule.name === 'tailwind') {
137
147
  if (Object.keys(layerNodes).includes(rule.params)) {
138
148
  layerNodes[rule.params] = rule;
139
149
  }
@@ -142,34 +152,81 @@ function expandTailwindAtRules(context) {
142
152
  if (Object.values(layerNodes).every((n)=>n === null)) {
143
153
  return root;
144
154
  }
155
+ var _context_candidates;
145
156
  // ---
146
157
  // Find potential rules in changed files
147
158
  let candidates = new Set([
159
+ ...(_context_candidates = context.candidates) !== null && _context_candidates !== void 0 ? _context_candidates : [],
148
160
  _sharedState.NOT_ON_DEMAND
149
161
  ]);
150
162
  let seen = new Set();
151
- env.DEBUG && console.time("Reading changed files");
152
- for (let { content , extension } of context.changedContent){
153
- let transformer = getTransformer(context.tailwindConfig, extension);
154
- let extractor = getExtractor(context, extension);
155
- getClassCandidates(transformer(content), extractor, candidates, seen);
163
+ env.DEBUG && console.time('Reading changed files');
164
+ if ((0, _featureFlags.flagEnabled)(context.tailwindConfig, 'oxideParser')) {
165
+ let rustParserContent = [];
166
+ let regexParserContent = [];
167
+ for (let item of context.changedContent){
168
+ var _extractor;
169
+ let transformer = getTransformer(context.tailwindConfig, item.extension);
170
+ let extractor = getExtractor(context, item.extension);
171
+ if (transformer === builtInTransformers.DEFAULT && ((_extractor = extractor) === null || _extractor === void 0 ? void 0 : _extractor.DEFAULT_EXTRACTOR) === true) {
172
+ rustParserContent.push(item);
173
+ } else {
174
+ regexParserContent.push([
175
+ item,
176
+ {
177
+ transformer,
178
+ extractor
179
+ }
180
+ ]);
181
+ }
182
+ }
183
+ if (rustParserContent.length > 0) {
184
+ for (let candidate of (0, _oxide.parseCandidateStrings)(rustParserContent, _oxide.IO.Parallel | _oxide.Parsing.Parallel)){
185
+ candidates.add(candidate);
186
+ }
187
+ }
188
+ if (regexParserContent.length > 0) {
189
+ await Promise.all(regexParserContent.map(async ([{ file, content }, { transformer, extractor }])=>{
190
+ content = file ? await _fs.default.promises.readFile(file, 'utf8') : content;
191
+ getClassCandidates(transformer(content), extractor, candidates, seen);
192
+ }));
193
+ }
194
+ } else {
195
+ await Promise.all(context.changedContent.map(async ({ file, content, extension })=>{
196
+ let transformer = getTransformer(context.tailwindConfig, extension);
197
+ let extractor = getExtractor(context, extension);
198
+ content = file ? await _fs.default.promises.readFile(file, 'utf8') : content;
199
+ getClassCandidates(transformer(content), extractor, candidates, seen);
200
+ }));
156
201
  }
157
- env.DEBUG && console.timeEnd("Reading changed files");
202
+ env.DEBUG && console.timeEnd('Reading changed files');
158
203
  // ---
159
204
  // Generate the actual CSS
160
205
  let classCacheCount = context.classCache.size;
161
- env.DEBUG && console.time("Generate rules");
162
- (0, _generateRules.generateRules)(candidates, context);
163
- env.DEBUG && console.timeEnd("Generate rules");
206
+ env.DEBUG && console.time('Generate rules');
207
+ env.DEBUG && console.time('Sorting candidates');
208
+ // TODO: only sort if we are not using the oxide parser (flagEnabled(context.tailwindConfig,
209
+ // 'oxideParser')) AND if we got all the candidates form the oxideParser alone. This will not
210
+ // be the case currently if you have custom transformers / extractors.
211
+ let sortedCandidates = new Set([
212
+ ...candidates
213
+ ].sort((a, z)=>{
214
+ if (a === z) return 0;
215
+ if (a < z) return -1;
216
+ return 1;
217
+ }));
218
+ env.DEBUG && console.timeEnd('Sorting candidates');
219
+ (0, _generateRules.generateRules)(sortedCandidates, context);
220
+ env.DEBUG && console.timeEnd('Generate rules');
164
221
  // We only ever add to the classCache, so if it didn't grow, there is nothing new.
165
- env.DEBUG && console.time("Build stylesheet");
222
+ env.DEBUG && console.time('Build stylesheet');
166
223
  if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) {
167
224
  context.stylesheetCache = buildStylesheet([
168
225
  ...context.ruleCache
169
226
  ], context);
170
227
  }
171
- env.DEBUG && console.timeEnd("Build stylesheet");
172
- let { defaults: defaultNodes , base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes } = context.stylesheetCache;
228
+ env.DEBUG && console.timeEnd('Build stylesheet');
229
+ let { defaults: defaultNodes, base: baseNodes, components: componentNodes, utilities: utilityNodes, variants: screenNodes } = context.stylesheetCache;
173
230
  // ---
174
231
  // Replace any Tailwind directives with generated CSS
175
232
  if (layerNodes.base) {
@@ -177,7 +234,7 @@ function expandTailwindAtRules(context) {
177
234
  ...baseNodes,
178
235
  ...defaultNodes
179
236
  ], layerNodes.base.source, {
180
- layer: "base"
237
+ layer: 'base'
181
238
  }));
182
239
  layerNodes.base.remove();
183
240
  }
@@ -185,7 +242,7 @@ function expandTailwindAtRules(context) {
185
242
  layerNodes.components.before((0, _cloneNodes.default)([
186
243
  ...componentNodes
187
244
  ], layerNodes.components.source, {
188
- layer: "components"
245
+ layer: 'components'
189
246
  }));
190
247
  layerNodes.components.remove();
191
248
  }
@@ -193,52 +250,63 @@ function expandTailwindAtRules(context) {
193
250
  layerNodes.utilities.before((0, _cloneNodes.default)([
194
251
  ...utilityNodes
195
252
  ], layerNodes.utilities.source, {
196
- layer: "utilities"
253
+ layer: 'utilities'
197
254
  }));
198
255
  layerNodes.utilities.remove();
199
256
  }
200
257
  // We do post-filtering to not alter the emitted order of the variants
201
258
  const variantNodes = Array.from(screenNodes).filter((node)=>{
202
- var ref;
203
- const parentLayer = (ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.parentLayer;
204
- if (parentLayer === "components") {
259
+ var _node_raws_tailwind;
260
+ const parentLayer = (_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer;
261
+ if (parentLayer === 'components') {
205
262
  return layerNodes.components !== null;
206
263
  }
207
- if (parentLayer === "utilities") {
264
+ if (parentLayer === 'utilities') {
208
265
  return layerNodes.utilities !== null;
209
266
  }
210
267
  return true;
211
268
  });
212
269
  if (layerNodes.variants) {
213
270
  layerNodes.variants.before((0, _cloneNodes.default)(variantNodes, layerNodes.variants.source, {
214
- layer: "variants"
271
+ layer: 'variants'
215
272
  }));
216
273
  layerNodes.variants.remove();
217
274
  } else if (variantNodes.length > 0) {
218
- root.append((0, _cloneNodes.default)(variantNodes, root.source, {
219
- layer: "variants"
220
- }));
275
+ let cloned = (0, _cloneNodes.default)(variantNodes, undefined, {
276
+ layer: 'variants'
277
+ });
278
+ cloned.forEach((node)=>{
279
+ var _node_raws_tailwind;
280
+ var _node_raws_tailwind_parentLayer;
281
+ let parentLayer = (_node_raws_tailwind_parentLayer = (_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer) !== null && _node_raws_tailwind_parentLayer !== void 0 ? _node_raws_tailwind_parentLayer : null;
282
+ node.walk((n)=>{
283
+ if (!n.source) {
284
+ n.source = layerNodes[parentLayer].source;
285
+ }
286
+ });
287
+ });
288
+ root.append(cloned);
221
289
  }
222
290
  // If we've got a utility layer and no utilities are generated there's likely something wrong
223
291
  const hasUtilityVariants = variantNodes.some((node)=>{
224
- var ref;
225
- return ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.parentLayer) === "utilities";
292
+ var _node_raws_tailwind;
293
+ return ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer) === 'utilities';
226
294
  });
227
295
  if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) {
228
- _log.default.warn("content-problems", [
229
- "No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.",
230
- "https://tailwindcss.com/docs/content-configuration"
296
+ _log.default.warn('content-problems', [
297
+ 'No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.',
298
+ 'https://tailwindcss.com/docs/content-configuration'
231
299
  ]);
232
300
  }
233
301
  // ---
234
302
  if (env.DEBUG) {
235
- console.log("Potential classes: ", candidates.size);
236
- console.log("Active contexts: ", _sharedState.contextSourcesMap.size);
303
+ console.log('Potential classes: ', candidates.size);
304
+ console.log('Active contexts: ', _sharedState.contextSourcesMap.size);
237
305
  }
238
306
  // Clear the cache for the changed files
239
307
  context.changedContent = [];
240
308
  // Cleanup any leftover @layer atrules
241
- root.walkAtRules("layer", (rule)=>{
309
+ root.walkAtRules('layer', (rule)=>{
242
310
  if (Object.keys(layerNodes).includes(rule.params)) {
243
311
  rule.remove();
244
312
  }
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "findAtConfigPath", {
6
6
  enumerable: true,
7
- get: ()=>findAtConfigPath
7
+ get: function() {
8
+ return findAtConfigPath;
9
+ }
8
10
  });
9
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
- const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
- function _interopRequireDefault(obj) {
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -16,23 +18,23 @@ function _interopRequireDefault(obj) {
16
18
  function findAtConfigPath(root, result) {
17
19
  let configPath = null;
18
20
  let relativeTo = null;
19
- root.walkAtRules("config", (rule)=>{
20
- var ref;
21
- var _file, ref1;
22
- relativeTo = (ref1 = (_file = (ref = rule.source) === null || ref === void 0 ? void 0 : ref.input.file) !== null && _file !== void 0 ? _file : result.opts.from) !== null && ref1 !== void 0 ? ref1 : null;
21
+ root.walkAtRules('config', (rule)=>{
22
+ var _rule_source;
23
+ var _rule_source_input_file, _ref;
24
+ relativeTo = (_ref = (_rule_source_input_file = (_rule_source = rule.source) === null || _rule_source === void 0 ? void 0 : _rule_source.input.file) !== null && _rule_source_input_file !== void 0 ? _rule_source_input_file : result.opts.from) !== null && _ref !== void 0 ? _ref : null;
23
25
  if (relativeTo === null) {
24
- throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
26
+ throw rule.error('The `@config` directive cannot be used without setting `from` in your PostCSS config.');
25
27
  }
26
28
  if (configPath) {
27
- throw rule.error("Only one `@config` directive is allowed per file.");
29
+ throw rule.error('Only one `@config` directive is allowed per file.');
28
30
  }
29
31
  let matches = rule.params.match(/(['"])(.*?)\1/);
30
32
  if (!matches) {
31
- throw rule.error("A path is required when using the `@config` directive.");
33
+ throw rule.error('A path is required when using the `@config` directive.');
32
34
  }
33
35
  let inputPath = matches[2];
34
36
  if (_path.default.isAbsolute(inputPath)) {
35
- throw rule.error("The `@config` directive cannot be used with an absolute path.");
37
+ throw rule.error('The `@config` directive cannot be used with an absolute path.');
36
38
  }
37
39
  configPath = _path.default.resolve(_path.default.dirname(relativeTo), inputPath);
38
40
  if (!_fs.default.existsSync(configPath)) {