tailwindcss 0.0.0-insiders.ea10bb9 → 0.0.0-insiders.ea4e1cd

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 (184) hide show
  1. package/README.md +1 -1
  2. package/lib/cli/build/deps.js +17 -9
  3. package/lib/cli/build/index.js +20 -10
  4. package/lib/cli/build/plugin.js +86 -70
  5. package/lib/cli/build/utils.js +18 -8
  6. package/lib/cli/build/watching.js +16 -12
  7. package/lib/cli/help/index.js +6 -4
  8. package/lib/cli/index.js +222 -10
  9. package/lib/cli/init/index.js +29 -12
  10. package/lib/cli-peer-dependencies.js +12 -4
  11. package/lib/cli.js +4 -226
  12. package/lib/corePluginList.js +7 -1
  13. package/lib/corePlugins.js +348 -75
  14. package/lib/css/preflight.css +2 -0
  15. package/lib/featureFlags.js +27 -15
  16. package/lib/index.js +1 -47
  17. package/lib/lib/cacheInvalidation.js +7 -5
  18. package/lib/lib/collapseAdjacentRules.js +5 -3
  19. package/lib/lib/collapseDuplicateDeclarations.js +12 -10
  20. package/lib/lib/content.js +34 -30
  21. package/lib/lib/defaultExtractor.js +15 -8
  22. package/lib/lib/detectNesting.js +10 -2
  23. package/lib/lib/evaluateTailwindFunctions.js +22 -20
  24. package/lib/lib/expandApplyAtRules.js +43 -35
  25. package/lib/lib/expandTailwindAtRules.js +46 -19
  26. package/lib/lib/findAtConfigPath.js +9 -7
  27. package/lib/lib/generateRules.js +157 -92
  28. package/lib/lib/getModuleDependencies.js +85 -37
  29. package/lib/lib/load-config.js +42 -0
  30. package/lib/lib/normalizeTailwindDirectives.js +5 -3
  31. package/lib/lib/offsets.js +93 -4
  32. package/lib/lib/partitionApplyAtRules.js +3 -1
  33. package/lib/lib/regex.js +21 -7
  34. package/lib/lib/remap-bitfield.js +89 -0
  35. package/lib/lib/resolveDefaultsAtRules.js +28 -24
  36. package/lib/lib/setupContextUtils.js +190 -131
  37. package/lib/lib/setupTrackingContext.js +49 -26
  38. package/lib/lib/sharedState.js +37 -10
  39. package/lib/lib/substituteScreenAtRules.js +5 -3
  40. package/lib/oxide/cli/build/deps.js +89 -0
  41. package/lib/oxide/cli/build/index.js +53 -0
  42. package/lib/oxide/cli/build/plugin.js +375 -0
  43. package/lib/oxide/cli/build/utils.js +87 -0
  44. package/lib/oxide/cli/build/watching.js +179 -0
  45. package/lib/oxide/cli/help/index.js +72 -0
  46. package/lib/oxide/cli/index.js +214 -0
  47. package/lib/oxide/cli/init/index.js +52 -0
  48. package/lib/oxide/cli.js +5 -0
  49. package/lib/oxide/postcss-plugin.js +2 -0
  50. package/lib/plugin.js +98 -0
  51. package/lib/postcss-plugins/nesting/index.js +3 -1
  52. package/lib/postcss-plugins/nesting/plugin.js +10 -8
  53. package/lib/processTailwindFeatures.js +14 -12
  54. package/lib/public/colors.js +49 -25
  55. package/lib/public/create-plugin.js +5 -3
  56. package/lib/public/default-config.js +6 -4
  57. package/lib/public/default-theme.js +6 -4
  58. package/lib/public/load-config.js +12 -0
  59. package/lib/public/resolve-config.js +6 -4
  60. package/lib/util/applyImportantSelector.js +36 -0
  61. package/lib/util/bigSign.js +3 -1
  62. package/lib/util/buildMediaQuery.js +3 -1
  63. package/lib/util/cloneDeep.js +3 -1
  64. package/lib/util/cloneNodes.js +5 -3
  65. package/lib/util/color.js +30 -12
  66. package/lib/util/colorNames.js +752 -0
  67. package/lib/util/configurePlugins.js +3 -1
  68. package/lib/util/createPlugin.js +3 -1
  69. package/lib/util/createUtilityPlugin.js +7 -5
  70. package/lib/util/dataTypes.js +74 -17
  71. package/lib/util/defaults.js +9 -7
  72. package/lib/util/escapeClassName.js +10 -8
  73. package/lib/util/escapeCommas.js +3 -1
  74. package/lib/util/flattenColorPalette.js +3 -1
  75. package/lib/util/formatVariantSelector.js +138 -160
  76. package/lib/util/getAllConfigs.js +8 -6
  77. package/lib/util/hashConfig.js +6 -4
  78. package/lib/util/isKeyframeRule.js +3 -1
  79. package/lib/util/isPlainObject.js +3 -1
  80. package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
  81. package/lib/util/log.js +8 -4
  82. package/lib/util/nameClass.js +12 -6
  83. package/lib/util/negateValue.js +4 -2
  84. package/lib/util/normalizeConfig.js +28 -27
  85. package/lib/util/normalizeScreens.js +12 -4
  86. package/lib/util/parseAnimationValue.js +3 -1
  87. package/lib/util/parseBoxShadowValue.js +6 -2
  88. package/lib/util/parseDependency.js +3 -1
  89. package/lib/util/parseGlob.js +6 -4
  90. package/lib/util/parseObjectStyles.js +9 -7
  91. package/lib/util/pluginUtils.js +54 -54
  92. package/lib/util/prefixSelector.js +27 -11
  93. package/lib/util/pseudoElements.js +229 -0
  94. package/lib/util/removeAlphaVariables.js +3 -1
  95. package/lib/util/resolveConfig.js +17 -15
  96. package/lib/util/resolveConfigPath.js +26 -10
  97. package/lib/util/responsive.js +6 -4
  98. package/lib/util/splitAtTopLevelOnly.js +10 -2
  99. package/lib/util/tap.js +3 -1
  100. package/lib/util/toColorValue.js +3 -1
  101. package/lib/util/toPath.js +3 -1
  102. package/lib/util/transformThemeValue.js +6 -4
  103. package/lib/util/validateConfig.js +16 -3
  104. package/lib/util/validateFormalSyntax.js +3 -1
  105. package/lib/util/withAlphaVariable.js +6 -2
  106. package/loadConfig.d.ts +4 -0
  107. package/loadConfig.js +2 -0
  108. package/package.json +45 -37
  109. package/peers/index.js +63324 -46417
  110. package/resolveConfig.d.ts +11 -2
  111. package/scripts/swap-engines.js +40 -0
  112. package/src/cli/build/index.js +13 -9
  113. package/src/cli/build/plugin.js +42 -32
  114. package/src/cli/build/watching.js +4 -2
  115. package/src/cli/index.js +216 -3
  116. package/src/cli/init/index.js +37 -8
  117. package/src/cli.js +4 -220
  118. package/src/corePluginList.js +1 -1
  119. package/src/corePlugins.js +207 -32
  120. package/src/css/preflight.css +2 -0
  121. package/src/featureFlags.js +6 -0
  122. package/src/index.js +1 -47
  123. package/src/lib/content.js +12 -17
  124. package/src/lib/defaultExtractor.js +9 -3
  125. package/src/lib/detectNesting.js +9 -1
  126. package/src/lib/expandApplyAtRules.js +8 -1
  127. package/src/lib/expandTailwindAtRules.js +36 -7
  128. package/src/lib/generateRules.js +124 -42
  129. package/src/lib/getModuleDependencies.js +70 -30
  130. package/src/lib/load-config.ts +31 -0
  131. package/src/lib/offsets.js +104 -1
  132. package/src/lib/remap-bitfield.js +82 -0
  133. package/src/lib/setupContextUtils.js +103 -54
  134. package/src/lib/setupTrackingContext.js +36 -11
  135. package/src/lib/sharedState.js +15 -4
  136. package/src/oxide/cli/build/deps.ts +91 -0
  137. package/src/oxide/cli/build/index.ts +47 -0
  138. package/src/oxide/cli/build/plugin.ts +442 -0
  139. package/src/oxide/cli/build/utils.ts +74 -0
  140. package/src/oxide/cli/build/watching.ts +225 -0
  141. package/src/oxide/cli/help/index.ts +69 -0
  142. package/src/oxide/cli/index.ts +204 -0
  143. package/src/oxide/cli/init/index.ts +59 -0
  144. package/src/oxide/cli.ts +1 -0
  145. package/src/oxide/postcss-plugin.ts +1 -0
  146. package/src/plugin.js +107 -0
  147. package/src/public/colors.js +22 -0
  148. package/src/public/default-config.js +1 -1
  149. package/src/public/default-theme.js +2 -2
  150. package/src/public/load-config.js +2 -0
  151. package/src/util/applyImportantSelector.js +27 -0
  152. package/src/util/color.js +18 -3
  153. package/src/util/colorNames.js +150 -0
  154. package/src/util/dataTypes.js +33 -4
  155. package/src/util/formatVariantSelector.js +160 -163
  156. package/src/util/getAllConfigs.js +2 -2
  157. package/src/util/negateValue.js +1 -1
  158. package/src/util/normalizeConfig.js +2 -1
  159. package/src/util/pluginUtils.js +16 -31
  160. package/src/util/prefixSelector.js +28 -10
  161. package/src/util/pseudoElements.js +170 -0
  162. package/src/util/resolveConfigPath.js +12 -1
  163. package/src/util/splitAtTopLevelOnly.js +8 -1
  164. package/src/util/validateConfig.js +13 -0
  165. package/stubs/.gitignore +1 -0
  166. package/stubs/.prettierrc.json +6 -0
  167. package/stubs/{defaultConfig.stub.js → config.full.js} +183 -146
  168. package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
  169. package/stubs/postcss.config.js +6 -0
  170. package/stubs/tailwind.config.cjs +2 -0
  171. package/stubs/tailwind.config.js +2 -0
  172. package/stubs/tailwind.config.ts +3 -0
  173. package/types/config.d.ts +15 -9
  174. package/types/generated/colors.d.ts +22 -0
  175. package/types/generated/corePluginList.d.ts +1 -1
  176. package/types/generated/default-theme.d.ts +108 -79
  177. package/CHANGELOG.md +0 -2336
  178. package/lib/cli/shared.js +0 -12
  179. package/lib/constants.js +0 -44
  180. package/scripts/install-integrations.js +0 -27
  181. package/scripts/rebuildFixtures.js +0 -68
  182. package/src/cli/shared.js +0 -5
  183. package/src/constants.js +0 -17
  184. /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
@@ -4,13 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>expandApplyAtRules
7
+ get: function() {
8
+ return expandApplyAtRules;
9
+ }
8
10
  });
9
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
11
13
  const _generateRules = require("./generateRules");
12
- const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("../util/escapeClassName"));
13
- function _interopRequireDefault(obj) {
14
+ const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
15
+ const _applyImportantSelector = require("../util/applyImportantSelector");
16
+ const _pseudoElements = require("../util/pseudoElements");
17
+ function _interop_require_default(obj) {
14
18
  return obj && obj.__esModule ? obj : {
15
19
  default: obj
16
20
  };
@@ -23,7 +27,7 @@ function _interopRequireDefault(obj) {
23
27
  ]
24
28
  });
25
29
  container.walkRules((rule)=>{
26
- (0, _postcssSelectorParser.default)((selectors)=>{
30
+ (0, _postcssselectorparser.default)((selectors)=>{
27
31
  selectors.walkClasses((classSelector)=>{
28
32
  let parentSelector = classSelector.parent.toString();
29
33
  let classes = groups.get(parentSelector);
@@ -40,7 +44,7 @@ function _interopRequireDefault(obj) {
40
44
  groups: normalizedGroups
41
45
  });
42
46
  }
43
- let selectorExtractor = (0, _postcssSelectorParser.default)();
47
+ let selectorExtractor = (0, _postcssselectorparser.default)();
44
48
  /**
45
49
  * @param {string} ruleSelectors
46
50
  */ function extractSelectors(ruleSelectors) {
@@ -139,8 +143,8 @@ function* pathToRoot(node) {
139
143
  root.walkRules((rule)=>{
140
144
  // Ignore rules generated by Tailwind
141
145
  for (let node of pathToRoot(rule)){
142
- var ref;
143
- if (((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.layer) !== undefined) {
146
+ var _node_raws_tailwind;
147
+ if (((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.layer) !== undefined) {
144
148
  return;
145
149
  }
146
150
  }
@@ -309,11 +313,11 @@ function processApply(root, context, localCache) {
309
313
  // Sort tag names before class names (but only sort each group (separated by a combinator)
310
314
  // separately and not in total)
311
315
  // This happens when replacing `.bar` in `.foo.bar` with a tag like `section`
312
- for (let sel1 of replaced){
316
+ for (let sel of replaced){
313
317
  let groups = [
314
318
  []
315
319
  ];
316
- for (let node of sel1.nodes){
320
+ for (let node of sel.nodes){
317
321
  if (node.type === "combinator") {
318
322
  groups.push(node);
319
323
  groups.push([]);
@@ -322,7 +326,7 @@ function processApply(root, context, localCache) {
322
326
  last.push(node);
323
327
  }
324
328
  }
325
- sel1.nodes = [];
329
+ sel.nodes = [];
326
330
  for (let group of groups){
327
331
  if (Array.isArray(group)) {
328
332
  group.sort((a, b)=>{
@@ -338,7 +342,7 @@ function processApply(root, context, localCache) {
338
342
  return 0;
339
343
  });
340
344
  }
341
- sel1.nodes = sel1.nodes.concat(group);
345
+ sel.nodes = sel.nodes.concat(group);
342
346
  }
343
347
  }
344
348
  sel.replaceWith(...replaced);
@@ -356,15 +360,15 @@ function processApply(root, context, localCache) {
356
360
  candidates,
357
361
  apply.source
358
362
  ]);
359
- let [applyCandidates1, important] = extractApplyCandidates(apply.params);
363
+ let [applyCandidates, important] = extractApplyCandidates(apply.params);
360
364
  if (apply.parent.type === "atrule") {
361
365
  if (apply.parent.name === "screen") {
362
366
  let screenType = apply.parent.params;
363
- throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates1.map((c)=>`${screenType}:${c}`).join(" ")} instead.`);
367
+ throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates.map((c)=>`${screenType}:${c}`).join(" ")} instead.`);
364
368
  }
365
369
  throw apply.error(`@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.`);
366
370
  }
367
- for (let applyCandidate of applyCandidates1){
371
+ for (let applyCandidate of applyCandidates){
368
372
  if ([
369
373
  prefix(context, "group"),
370
374
  prefix(context, "peer")
@@ -383,16 +387,16 @@ function processApply(root, context, localCache) {
383
387
  ]);
384
388
  }
385
389
  }
386
- for (let [parent, [candidates1, atApplySource]] of perParentApplies){
390
+ for (let [parent, [candidates, atApplySource]] of perParentApplies){
387
391
  let siblings = [];
388
- for (let [applyCandidate1, important1, rules1] of candidates1){
392
+ for (let [applyCandidate, important, rules] of candidates){
389
393
  let potentialApplyCandidates = [
390
- applyCandidate1,
394
+ applyCandidate,
391
395
  ...extractBaseCandidates([
392
- applyCandidate1
396
+ applyCandidate
393
397
  ], context.tailwindConfig.separator)
394
398
  ];
395
- for (let [meta, node] of rules1){
399
+ for (let [meta, node] of rules){
396
400
  let parentClasses = extractClasses(parent);
397
401
  let nodeClasses = extractClasses(node);
398
402
  // When we encounter a rule like `.dark .a, .b { … }` we only want to be left with `[.dark, .a]` if the base applyCandidate is `.a` or with `[.b]` if the base applyCandidate is `.b`
@@ -423,20 +427,20 @@ function processApply(root, context, localCache) {
423
427
  nodeClasses = nodeClasses.concat(extractBaseCandidates(nodeClasses, context.tailwindConfig.separator));
424
428
  let intersects = parentClasses.some((selector)=>nodeClasses.includes(selector));
425
429
  if (intersects) {
426
- throw node.error(`You cannot \`@apply\` the \`${applyCandidate1}\` utility here because it creates a circular dependency.`);
430
+ throw node.error(`You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.`);
427
431
  }
428
- let root1 = _postcss.default.root({
432
+ let root = _postcss.default.root({
429
433
  nodes: [
430
434
  node.clone()
431
435
  ]
432
436
  });
433
437
  // Make sure every node in the entire tree points back at the @apply rule that generated it
434
- root1.walk((node)=>{
438
+ root.walk((node)=>{
435
439
  node.source = atApplySource;
436
440
  });
437
441
  let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes";
438
442
  if (canRewriteSelector) {
439
- root1.walkRules((rule)=>{
443
+ root.walkRules((rule)=>{
440
444
  // Let's imagine you have the following structure:
441
445
  //
442
446
  // .foo {
@@ -468,7 +472,7 @@ function processApply(root, context, localCache) {
468
472
  // would have replaced this with something that didn't exist and
469
473
  // therefore it removed the selector altogether. In this specific
470
474
  // case it would result in `{}` instead of `.something-unrelated {}`
471
- if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate1)) {
475
+ if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate)) {
472
476
  rule.remove();
473
477
  return;
474
478
  }
@@ -478,25 +482,29 @@ function processApply(root, context, localCache) {
478
482
  // We do *not* want to do this for user CSS that happens to be structured the same
479
483
  let isGenerated = parent.raws.tailwind !== undefined;
480
484
  let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector;
481
- rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate1);
485
+ rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate);
482
486
  // And then re-add it if it was removed
483
487
  if (importantSelector && parentSelector !== parent.selector) {
484
- rule.selector = `${importantSelector} ${rule.selector}`;
488
+ rule.selector = (0, _applyImportantSelector.applyImportantSelector)(rule.selector, importantSelector);
485
489
  }
486
490
  rule.walkDecls((d)=>{
487
- d.important = meta.important || important1;
491
+ d.important = meta.important || important;
488
492
  });
493
+ // Move pseudo elements to the end of the selector (if necessary)
494
+ let selector = (0, _postcssselectorparser.default)().astSync(rule.selector);
495
+ selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
496
+ rule.selector = selector.toString();
489
497
  });
490
498
  }
491
499
  // It could be that the node we were inserted was removed because the class didn't match
492
500
  // If that was the *only* rule in the parent, then we have nothing add so we skip it
493
- if (!root1.nodes[0]) {
501
+ if (!root.nodes[0]) {
494
502
  continue;
495
503
  }
496
504
  // Insert it
497
505
  siblings.push([
498
506
  meta.sort,
499
- root1.nodes[0]
507
+ root.nodes[0]
500
508
  ]);
501
509
  }
502
510
  }
@@ -505,13 +513,13 @@ function processApply(root, context, localCache) {
505
513
  // `parent` refers to the node at `.abc` in: .abc { @apply mt-2 }
506
514
  parent.after(nodes);
507
515
  }
508
- for (let apply1 of applies){
516
+ for (let apply of applies){
509
517
  // If there are left-over declarations, just remove the @apply
510
- if (apply1.parent.nodes.length > 1) {
511
- apply1.remove();
518
+ if (apply.parent.nodes.length > 1) {
519
+ apply.remove();
512
520
  } else {
513
521
  // The node is empty, drop the full node
514
- apply1.parent.remove();
522
+ apply.parent.remove();
515
523
  }
516
524
  }
517
525
  // Do it again, in case we have other `@apply` rules
@@ -4,15 +4,18 @@ 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 _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
11
14
  const _generateRules = require("./generateRules");
12
- const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
13
- const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("../util/cloneNodes"));
15
+ const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
16
+ const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes"));
14
17
  const _defaultExtractor = require("./defaultExtractor");
15
- function _interopRequireDefault(obj) {
18
+ function _interop_require_default(obj) {
16
19
  return obj && obj.__esModule ? obj : {
17
20
  default: obj
18
21
  };
@@ -25,7 +28,7 @@ function _getRequireWildcardCache(nodeInterop) {
25
28
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
26
29
  })(nodeInterop);
27
30
  }
28
- function _interopRequireWildcard(obj, nodeInterop) {
31
+ function _interop_require_wildcard(obj, nodeInterop) {
29
32
  if (!nodeInterop && obj && obj.__esModule) {
30
33
  return obj;
31
34
  }
@@ -78,7 +81,7 @@ let extractorCache = new WeakMap();
78
81
  // up these regexes by 50% that could cut initial build time by like 20%.
79
82
  function getClassCandidates(content, extractor, candidates, seen) {
80
83
  if (!extractorCache.has(extractor)) {
81
- extractorCache.set(extractor, new _quickLru.default({
84
+ extractorCache.set(extractor, new _quicklru.default({
82
85
  maxSize: 25000
83
86
  }));
84
87
  }
@@ -95,8 +98,8 @@ function getClassCandidates(content, extractor, candidates, seen) {
95
98
  } else {
96
99
  let extractorMatches = extractor(line).filter((s)=>s !== "!*");
97
100
  let lineMatchesSet = new Set(extractorMatches);
98
- for (let match1 of lineMatchesSet){
99
- candidates.add(match1);
101
+ for (let match of lineMatchesSet){
102
+ candidates.add(match);
100
103
  }
101
104
  extractorCache.get(extractor).set(line, lineMatchesSet);
102
105
  }
@@ -142,24 +145,48 @@ function expandTailwindAtRules(context) {
142
145
  if (Object.values(layerNodes).every((n)=>n === null)) {
143
146
  return root;
144
147
  }
148
+ var _context_candidates;
145
149
  // ---
146
150
  // Find potential rules in changed files
147
151
  let candidates = new Set([
152
+ ...(_context_candidates = context.candidates) !== null && _context_candidates !== void 0 ? _context_candidates : [],
148
153
  _sharedState.NOT_ON_DEMAND
149
154
  ]);
150
155
  let seen = new Set();
151
156
  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);
157
+ if (false) {
158
+ // TODO: Pass through or implement `extractor`
159
+ for (let candidate of require("@tailwindcss/oxide").parseCandidateStringsFromFiles(context.changedContent)){
160
+ candidates.add(candidate);
161
+ }
162
+ // for (let { file, content, extension } of context.changedContent) {
163
+ // let transformer = getTransformer(context.tailwindConfig, extension)
164
+ // let extractor = getExtractor(context, extension)
165
+ // getClassCandidatesOxide(file, transformer(content), extractor, candidates, seen)
166
+ // }
167
+ } else {
168
+ for (let { file , content , extension } of context.changedContent){
169
+ let transformer = getTransformer(context.tailwindConfig, extension);
170
+ let extractor = getExtractor(context, extension);
171
+ content = file ? _fs.default.readFileSync(file, "utf8") : content;
172
+ getClassCandidates(transformer(content), extractor, candidates, seen);
173
+ }
156
174
  }
157
175
  env.DEBUG && console.timeEnd("Reading changed files");
158
176
  // ---
159
177
  // Generate the actual CSS
160
178
  let classCacheCount = context.classCache.size;
161
179
  env.DEBUG && console.time("Generate rules");
162
- (0, _generateRules.generateRules)(candidates, context);
180
+ env.DEBUG && console.time("Sorting candidates");
181
+ let sortedCandidates = false ? candidates : new Set([
182
+ ...candidates
183
+ ].sort((a, z)=>{
184
+ if (a === z) return 0;
185
+ if (a < z) return -1;
186
+ return 1;
187
+ }));
188
+ env.DEBUG && console.timeEnd("Sorting candidates");
189
+ (0, _generateRules.generateRules)(sortedCandidates, context);
163
190
  env.DEBUG && console.timeEnd("Generate rules");
164
191
  // We only ever add to the classCache, so if it didn't grow, there is nothing new.
165
192
  env.DEBUG && console.time("Build stylesheet");
@@ -199,8 +226,8 @@ function expandTailwindAtRules(context) {
199
226
  }
200
227
  // We do post-filtering to not alter the emitted order of the variants
201
228
  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;
229
+ var _node_raws_tailwind;
230
+ const parentLayer = (_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer;
204
231
  if (parentLayer === "components") {
205
232
  return layerNodes.components !== null;
206
233
  }
@@ -221,8 +248,8 @@ function expandTailwindAtRules(context) {
221
248
  }
222
249
  // If we've got a utility layer and no utilities are generated there's likely something wrong
223
250
  const hasUtilityVariants = variantNodes.some((node)=>{
224
- var ref;
225
- return ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.parentLayer) === "utilities";
251
+ var _node_raws_tailwind;
252
+ return ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.parentLayer) === "utilities";
226
253
  });
227
254
  if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) {
228
255
  _log.default.warn("content-problems", [
@@ -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
  };
@@ -17,9 +19,9 @@ function findAtConfigPath(root, result) {
17
19
  let configPath = null;
18
20
  let relativeTo = null;
19
21
  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;
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
26
  throw rule.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");
25
27
  }