tailwindcss 0.0.0-insiders.4e21639 → 0.0.0-insiders.4e62334

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 (157) hide show
  1. package/CHANGELOG.md +435 -3
  2. package/LICENSE +1 -2
  3. package/README.md +13 -6
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -1
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -1
  8. package/defaultTheme.d.ts +4 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli-peer-dependencies.js +20 -7
  11. package/lib/cli.js +460 -259
  12. package/lib/constants.js +27 -20
  13. package/lib/corePluginList.js +9 -3
  14. package/lib/corePlugins.js +1840 -1753
  15. package/lib/css/preflight.css +8 -9
  16. package/lib/featureFlags.js +29 -20
  17. package/lib/index.js +22 -11
  18. package/lib/lib/cacheInvalidation.js +90 -0
  19. package/lib/lib/collapseAdjacentRules.js +27 -9
  20. package/lib/lib/collapseDuplicateDeclarations.js +58 -4
  21. package/lib/lib/defaultExtractor.js +231 -0
  22. package/lib/lib/detectNesting.js +13 -10
  23. package/lib/lib/evaluateTailwindFunctions.js +119 -52
  24. package/lib/lib/expandApplyAtRules.js +440 -161
  25. package/lib/lib/expandTailwindAtRules.js +130 -128
  26. package/lib/lib/generateRules.js +410 -171
  27. package/lib/lib/getModuleDependencies.js +11 -8
  28. package/lib/lib/normalizeTailwindDirectives.js +43 -32
  29. package/lib/lib/offsets.js +199 -0
  30. package/lib/lib/partitionApplyAtRules.js +56 -0
  31. package/lib/lib/regex.js +60 -0
  32. package/lib/lib/resolveDefaultsAtRules.js +91 -55
  33. package/lib/lib/setupContextUtils.js +453 -347
  34. package/lib/lib/setupTrackingContext.js +52 -44
  35. package/lib/lib/sharedState.js +48 -9
  36. package/lib/lib/substituteScreenAtRules.js +13 -8
  37. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  38. package/lib/postcss-plugins/nesting/index.js +19 -0
  39. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  40. package/lib/processTailwindFeatures.js +36 -25
  41. package/lib/public/colors.js +247 -245
  42. package/lib/public/create-plugin.js +6 -4
  43. package/lib/public/default-config.js +7 -5
  44. package/lib/public/default-theme.js +7 -5
  45. package/lib/public/resolve-config.js +8 -5
  46. package/lib/util/bigSign.js +4 -1
  47. package/lib/util/buildMediaQuery.js +16 -25
  48. package/lib/util/cloneDeep.js +7 -6
  49. package/lib/util/cloneNodes.js +21 -3
  50. package/lib/util/color.js +54 -40
  51. package/lib/util/configurePlugins.js +4 -1
  52. package/lib/util/createPlugin.js +6 -6
  53. package/lib/util/createUtilityPlugin.js +12 -14
  54. package/lib/util/dataTypes.js +119 -102
  55. package/lib/util/defaults.js +10 -1
  56. package/lib/util/escapeClassName.js +7 -4
  57. package/lib/util/escapeCommas.js +5 -2
  58. package/lib/util/flattenColorPalette.js +9 -12
  59. package/lib/util/formatVariantSelector.js +223 -40
  60. package/lib/util/getAllConfigs.js +27 -8
  61. package/lib/util/hashConfig.js +6 -3
  62. package/lib/util/isKeyframeRule.js +5 -2
  63. package/lib/util/isPlainObject.js +5 -2
  64. package/lib/util/isValidArbitraryValue.js +72 -0
  65. package/lib/util/log.js +22 -12
  66. package/lib/util/nameClass.js +17 -8
  67. package/lib/util/negateValue.js +22 -7
  68. package/lib/util/normalizeConfig.js +99 -54
  69. package/lib/util/normalizeScreens.js +73 -0
  70. package/lib/util/parseAnimationValue.js +42 -40
  71. package/lib/util/parseBoxShadowValue.js +30 -23
  72. package/lib/util/parseDependency.js +18 -15
  73. package/lib/util/parseObjectStyles.js +10 -7
  74. package/lib/util/pluginUtils.js +51 -42
  75. package/lib/util/prefixSelector.js +10 -8
  76. package/lib/util/removeAlphaVariables.js +29 -0
  77. package/lib/util/resolveConfig.js +91 -66
  78. package/lib/util/resolveConfigPath.js +11 -9
  79. package/lib/util/responsive.js +8 -5
  80. package/lib/util/splitAtTopLevelOnly.js +43 -0
  81. package/lib/util/tap.js +4 -1
  82. package/lib/util/toColorValue.js +5 -3
  83. package/lib/util/toPath.js +24 -3
  84. package/lib/util/transformThemeValue.js +37 -29
  85. package/lib/util/validateConfig.js +24 -0
  86. package/lib/util/withAlphaVariable.js +23 -15
  87. package/nesting/index.js +2 -12
  88. package/package.json +43 -43
  89. package/peers/index.js +11543 -8114
  90. package/plugin.d.ts +11 -0
  91. package/plugin.js +2 -1
  92. package/resolveConfig.d.ts +3 -0
  93. package/resolveConfig.js +2 -1
  94. package/scripts/generate-types.js +105 -0
  95. package/scripts/type-utils.js +27 -0
  96. package/src/cli-peer-dependencies.js +7 -1
  97. package/src/cli.js +293 -36
  98. package/src/corePluginList.js +1 -1
  99. package/src/corePlugins.js +428 -285
  100. package/src/css/preflight.css +8 -9
  101. package/src/featureFlags.js +9 -5
  102. package/src/index.js +14 -6
  103. package/src/lib/cacheInvalidation.js +52 -0
  104. package/src/lib/collapseAdjacentRules.js +21 -2
  105. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  106. package/src/lib/defaultExtractor.js +208 -0
  107. package/src/lib/evaluateTailwindFunctions.js +84 -10
  108. package/src/lib/expandApplyAtRules.js +488 -153
  109. package/src/lib/expandTailwindAtRules.js +82 -80
  110. package/src/lib/generateRules.js +352 -120
  111. package/src/lib/normalizeTailwindDirectives.js +7 -1
  112. package/src/lib/offsets.js +239 -0
  113. package/src/lib/partitionApplyAtRules.js +52 -0
  114. package/src/lib/regex.js +74 -0
  115. package/src/lib/resolveDefaultsAtRules.js +59 -17
  116. package/src/lib/setupContextUtils.js +337 -174
  117. package/src/lib/setupTrackingContext.js +13 -8
  118. package/src/lib/sharedState.js +42 -4
  119. package/src/lib/substituteScreenAtRules.js +6 -3
  120. package/src/postcss-plugins/nesting/README.md +42 -0
  121. package/src/postcss-plugins/nesting/index.js +13 -0
  122. package/src/postcss-plugins/nesting/plugin.js +80 -0
  123. package/src/processTailwindFeatures.js +12 -2
  124. package/src/util/buildMediaQuery.js +14 -18
  125. package/src/util/cloneNodes.js +19 -2
  126. package/src/util/color.js +31 -14
  127. package/src/util/dataTypes.js +28 -19
  128. package/src/util/defaults.js +6 -0
  129. package/src/util/formatVariantSelector.js +237 -23
  130. package/src/util/getAllConfigs.js +19 -0
  131. package/src/util/isValidArbitraryValue.js +61 -0
  132. package/src/util/log.js +11 -7
  133. package/src/util/nameClass.js +1 -1
  134. package/src/util/negateValue.js +10 -2
  135. package/src/util/normalizeConfig.js +16 -3
  136. package/src/util/normalizeScreens.js +45 -0
  137. package/src/util/parseBoxShadowValue.js +4 -3
  138. package/src/util/pluginUtils.js +14 -2
  139. package/src/util/prefixSelector.js +7 -5
  140. package/src/util/removeAlphaVariables.js +24 -0
  141. package/src/util/resolveConfig.js +71 -17
  142. package/src/util/splitAtTopLevelOnly.js +45 -0
  143. package/src/util/toPath.js +23 -1
  144. package/src/util/transformThemeValue.js +13 -3
  145. package/src/util/validateConfig.js +13 -0
  146. package/src/util/withAlphaVariable.js +1 -1
  147. package/stubs/defaultConfig.stub.js +24 -3
  148. package/stubs/simpleConfig.stub.js +1 -0
  149. package/types/config.d.ts +334 -0
  150. package/types/generated/.gitkeep +0 -0
  151. package/types/generated/colors.d.ts +276 -0
  152. package/types/generated/corePluginList.d.ts +1 -0
  153. package/types/generated/default-theme.d.ts +331 -0
  154. package/types/index.d.ts +7 -0
  155. package/lib/lib/setupWatchingContext.js +0 -288
  156. package/nesting/plugin.js +0 -41
  157. package/src/lib/setupWatchingContext.js +0 -311
@@ -2,73 +2,71 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.default = expandTailwindAtRules;
6
- var _quickLru = _interopRequireDefault(require("quick-lru"));
7
- var sharedState = _interopRequireWildcard(require("./sharedState"));
8
- var _generateRules = require("./generateRules");
9
- var _bigSign = _interopRequireDefault(require("../util/bigSign"));
10
- var _cloneNodes = _interopRequireDefault(require("../util/cloneNodes"));
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: ()=>expandTailwindAtRules
8
+ });
9
+ const _quickLru = /*#__PURE__*/ _interopRequireDefault(require("quick-lru"));
10
+ const _sharedState = /*#__PURE__*/ _interopRequireWildcard(require("./sharedState"));
11
+ const _generateRules = require("./generateRules");
12
+ const _log = /*#__PURE__*/ _interopRequireDefault(require("../util/log"));
13
+ const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("../util/cloneNodes"));
14
+ const _defaultExtractor = require("./defaultExtractor");
11
15
  function _interopRequireDefault(obj) {
12
16
  return obj && obj.__esModule ? obj : {
13
17
  default: obj
14
18
  };
15
19
  }
16
- function _interopRequireWildcard(obj) {
17
- if (obj && obj.__esModule) {
20
+ function _getRequireWildcardCache(nodeInterop) {
21
+ if (typeof WeakMap !== "function") return null;
22
+ var cacheBabelInterop = new WeakMap();
23
+ var cacheNodeInterop = new WeakMap();
24
+ return (_getRequireWildcardCache = function(nodeInterop) {
25
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
26
+ })(nodeInterop);
27
+ }
28
+ function _interopRequireWildcard(obj, nodeInterop) {
29
+ if (!nodeInterop && obj && obj.__esModule) {
18
30
  return obj;
19
- } else {
20
- var newObj = {
31
+ }
32
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
33
+ return {
34
+ default: obj
21
35
  };
22
- if (obj != null) {
23
- for(var key in obj){
24
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
25
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
26
- };
27
- if (desc.get || desc.set) {
28
- Object.defineProperty(newObj, key, desc);
29
- } else {
30
- newObj[key] = obj[key];
31
- }
32
- }
36
+ }
37
+ var cache = _getRequireWildcardCache(nodeInterop);
38
+ if (cache && cache.has(obj)) {
39
+ return cache.get(obj);
40
+ }
41
+ var newObj = {};
42
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
+ for(var key in obj){
44
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
45
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
46
+ if (desc && (desc.get || desc.set)) {
47
+ Object.defineProperty(newObj, key, desc);
48
+ } else {
49
+ newObj[key] = obj[key];
33
50
  }
34
51
  }
35
- newObj.default = obj;
36
- return newObj;
37
52
  }
53
+ newObj.default = obj;
54
+ if (cache) {
55
+ cache.set(obj, newObj);
56
+ }
57
+ return newObj;
38
58
  }
39
- let env = sharedState.env;
40
- const PATTERNS = [
41
- /([^<>"'`\s]*\[\w*'[^"`\s]*'?\])/.source,
42
- /([^<>"'`\s]*\[\w*"[^"`\s]*"?\])/.source,
43
- /([^<>"'`\s]*\[\w*\('[^"'`\s]*'\)\])/.source,
44
- /([^<>"'`\s]*\[\w*\("[^"'`\s]*"\)\])/.source,
45
- /([^<>"'`\s]*\[\w*\('[^"`\s]*'\)\])/.source,
46
- /([^<>"'`\s]*\[\w*\("[^'`\s]*"\)\])/.source,
47
- /([^<>"'`\s]*\['[^"'`\s]*'\])/.source,
48
- /([^<>"'`\s]*\["[^"'`\s]*"\])/.source,
49
- /([^<>"'`\s]*\[[^"'`\s]+\][^<>"'`\s]*)/.source,
50
- /([^<>"'`\s]*[^"'`\s:])/.source
51
- ].join('|');
52
- const BROAD_MATCH_GLOBAL_REGEXP = new RegExp(PATTERNS, 'g');
53
- const INNER_MATCH_GLOBAL_REGEXP = /[^<>"'`\s.(){}[\]#=%]*[^<>"'`\s.(){}[\]#=%:]/g;
59
+ let env = _sharedState.env;
54
60
  const builtInExtractors = {
55
- DEFAULT: (content)=>{
56
- let broadMatches = content.match(BROAD_MATCH_GLOBAL_REGEXP) || [];
57
- let innerMatches = content.match(INNER_MATCH_GLOBAL_REGEXP) || [];
58
- return [
59
- ...broadMatches,
60
- ...innerMatches
61
- ];
62
- }
61
+ DEFAULT: _defaultExtractor.defaultExtractor
63
62
  };
64
63
  const builtInTransformers = {
65
- DEFAULT: (content)=>content
66
- ,
67
- svelte: (content)=>content.replace(/(?:^|\s)class:/g, ' ')
64
+ DEFAULT: (content)=>content,
65
+ svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ")
68
66
  };
69
- function getExtractor(tailwindConfig, fileExtension) {
70
- let extractors = tailwindConfig.content.extract;
71
- return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT;
67
+ function getExtractor(context, fileExtension) {
68
+ let extractors = context.tailwindConfig.content.extract;
69
+ return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context);
72
70
  }
73
71
  function getTransformer(tailwindConfig, fileExtension) {
74
72
  let transformers = tailwindConfig.content.transform;
@@ -84,7 +82,7 @@ function getClassCandidates(content, extractor, candidates, seen) {
84
82
  maxSize: 25000
85
83
  }));
86
84
  }
87
- for (let line of content.split('\n')){
85
+ for (let line of content.split("\n")){
88
86
  line = line.trim();
89
87
  if (seen.has(line)) {
90
88
  continue;
@@ -95,55 +93,30 @@ function getClassCandidates(content, extractor, candidates, seen) {
95
93
  candidates.add(match);
96
94
  }
97
95
  } else {
98
- let extractorMatches = extractor(line).filter((s)=>s !== '!*'
99
- );
96
+ let extractorMatches = extractor(line).filter((s)=>s !== "!*");
100
97
  let lineMatchesSet = new Set(extractorMatches);
101
- for (let match of lineMatchesSet){
102
- candidates.add(match);
98
+ for (let match1 of lineMatchesSet){
99
+ candidates.add(match1);
103
100
  }
104
101
  extractorCache.get(extractor).set(line, lineMatchesSet);
105
102
  }
106
103
  }
107
104
  }
108
- function buildStylesheet(rules, context) {
109
- let sortedRules = rules.sort(([a], [z])=>(0, _bigSign).default(a - z)
110
- );
105
+ /**
106
+ *
107
+ * @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules
108
+ * @param {*} context
109
+ */ function buildStylesheet(rules, context) {
110
+ let sortedRules = context.offsets.sort(rules);
111
111
  let returnValue = {
112
112
  base: new Set(),
113
+ defaults: new Set(),
113
114
  components: new Set(),
114
115
  utilities: new Set(),
115
- variants: new Set(),
116
- // All the CSS that is not Tailwind related can be put in this bucket. This
117
- // will make it easier to later use this information when we want to
118
- // `@apply` for example. The main reason we do this here is because we
119
- // still need to make sure the order is correct. Last but not least, we
120
- // will make sure to always re-inject this section into the css, even if
121
- // certain rules were not used. This means that it will look like a no-op
122
- // from the user's perspective, but we gathered all the useful information
123
- // we need.
124
- user: new Set()
116
+ variants: new Set()
125
117
  };
126
118
  for (let [sort, rule] of sortedRules){
127
- if (sort >= context.minimumScreen) {
128
- returnValue.variants.add(rule);
129
- continue;
130
- }
131
- if (sort & context.layerOrder.base) {
132
- returnValue.base.add(rule);
133
- continue;
134
- }
135
- if (sort & context.layerOrder.components) {
136
- returnValue.components.add(rule);
137
- continue;
138
- }
139
- if (sort & context.layerOrder.utilities) {
140
- returnValue.utilities.add(rule);
141
- continue;
142
- }
143
- if (sort & context.layerOrder.user) {
144
- returnValue.user.add(rule);
145
- continue;
146
- }
119
+ returnValue[sort.layer].add(rule);
147
120
  }
148
121
  return returnValue;
149
122
  }
@@ -155,88 +128,117 @@ function expandTailwindAtRules(context) {
155
128
  utilities: null,
156
129
  variants: null
157
130
  };
158
- // Make sure this file contains Tailwind directives. If not, we can save
159
- // a lot of work and bail early. Also we don't have to register our touch
160
- // file as a dependency since the output of this CSS does not depend on
161
- // the source of any templates. Think Vue <style> blocks for example.
162
- root.walkAtRules('tailwind', (rule)=>{
163
- if (Object.keys(layerNodes).includes(rule.params)) {
164
- layerNodes[rule.params] = rule;
131
+ root.walkAtRules((rule)=>{
132
+ // Make sure this file contains Tailwind directives. If not, we can save
133
+ // a lot of work and bail early. Also we don't have to register our touch
134
+ // file as a dependency since the output of this CSS does not depend on
135
+ // the source of any templates. Think Vue <style> blocks for example.
136
+ if (rule.name === "tailwind") {
137
+ if (Object.keys(layerNodes).includes(rule.params)) {
138
+ layerNodes[rule.params] = rule;
139
+ }
165
140
  }
166
141
  });
167
- if (Object.values(layerNodes).every((n)=>n === null
168
- )) {
142
+ if (Object.values(layerNodes).every((n)=>n === null)) {
169
143
  return root;
170
144
  }
171
145
  // ---
172
146
  // Find potential rules in changed files
173
147
  let candidates = new Set([
174
- '*'
148
+ _sharedState.NOT_ON_DEMAND
175
149
  ]);
176
150
  let seen = new Set();
177
- env.DEBUG && console.time('Reading changed files');
151
+ env.DEBUG && console.time("Reading changed files");
178
152
  for (let { content , extension } of context.changedContent){
179
153
  let transformer = getTransformer(context.tailwindConfig, extension);
180
- let extractor = getExtractor(context.tailwindConfig, extension);
154
+ let extractor = getExtractor(context, extension);
181
155
  getClassCandidates(transformer(content), extractor, candidates, seen);
182
156
  }
157
+ env.DEBUG && console.timeEnd("Reading changed files");
183
158
  // ---
184
159
  // Generate the actual CSS
185
160
  let classCacheCount = context.classCache.size;
186
- env.DEBUG && console.time('Generate rules');
187
- let rules = (0, _generateRules).generateRules(candidates, context);
188
- env.DEBUG && console.timeEnd('Generate rules');
161
+ env.DEBUG && console.time("Generate rules");
162
+ (0, _generateRules.generateRules)(candidates, context);
163
+ env.DEBUG && console.timeEnd("Generate rules");
189
164
  // We only ever add to the classCache, so if it didn't grow, there is nothing new.
190
- env.DEBUG && console.time('Build stylesheet');
165
+ env.DEBUG && console.time("Build stylesheet");
191
166
  if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) {
192
- for (let rule of rules){
193
- context.ruleCache.add(rule);
194
- }
195
167
  context.stylesheetCache = buildStylesheet([
196
168
  ...context.ruleCache
197
169
  ], context);
198
170
  }
199
- env.DEBUG && console.timeEnd('Build stylesheet');
200
- let { base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes , } = context.stylesheetCache;
171
+ env.DEBUG && console.timeEnd("Build stylesheet");
172
+ let { defaults: defaultNodes , base: baseNodes , components: componentNodes , utilities: utilityNodes , variants: screenNodes , } = context.stylesheetCache;
201
173
  // ---
202
174
  // Replace any Tailwind directives with generated CSS
203
175
  if (layerNodes.base) {
204
- layerNodes.base.before((0, _cloneNodes).default([
205
- ...baseNodes
206
- ], layerNodes.base.source));
176
+ layerNodes.base.before((0, _cloneNodes.default)([
177
+ ...baseNodes,
178
+ ...defaultNodes
179
+ ], layerNodes.base.source, {
180
+ layer: "base"
181
+ }));
207
182
  layerNodes.base.remove();
208
183
  }
209
184
  if (layerNodes.components) {
210
- layerNodes.components.before((0, _cloneNodes).default([
185
+ layerNodes.components.before((0, _cloneNodes.default)([
211
186
  ...componentNodes
212
- ], layerNodes.components.source));
187
+ ], layerNodes.components.source, {
188
+ layer: "components"
189
+ }));
213
190
  layerNodes.components.remove();
214
191
  }
215
192
  if (layerNodes.utilities) {
216
- layerNodes.utilities.before((0, _cloneNodes).default([
193
+ layerNodes.utilities.before((0, _cloneNodes.default)([
217
194
  ...utilityNodes
218
- ], layerNodes.utilities.source));
195
+ ], layerNodes.utilities.source, {
196
+ layer: "utilities"
197
+ }));
219
198
  layerNodes.utilities.remove();
220
199
  }
200
+ // We do post-filtering to not alter the emitted order of the variants
201
+ 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") {
205
+ return layerNodes.components !== null;
206
+ }
207
+ if (parentLayer === "utilities") {
208
+ return layerNodes.utilities !== null;
209
+ }
210
+ return true;
211
+ });
221
212
  if (layerNodes.variants) {
222
- layerNodes.variants.before((0, _cloneNodes).default([
223
- ...screenNodes
224
- ], layerNodes.variants.source));
213
+ layerNodes.variants.before((0, _cloneNodes.default)(variantNodes, layerNodes.variants.source, {
214
+ layer: "variants"
215
+ }));
225
216
  layerNodes.variants.remove();
226
- } else {
227
- root.append((0, _cloneNodes).default([
228
- ...screenNodes
229
- ], root.source));
217
+ } else if (variantNodes.length > 0) {
218
+ root.append((0, _cloneNodes.default)(variantNodes, root.source, {
219
+ layer: "variants"
220
+ }));
221
+ }
222
+ // If we've got a utility layer and no utilities are generated there's likely something wrong
223
+ const hasUtilityVariants = variantNodes.some((node)=>{
224
+ var ref;
225
+ return ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.parentLayer) === "utilities";
226
+ });
227
+ 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",
231
+ ]);
230
232
  }
231
233
  // ---
232
234
  if (env.DEBUG) {
233
- console.log('Potential classes: ', candidates.size);
234
- console.log('Active contexts: ', sharedState.contextSourcesMap.size);
235
+ console.log("Potential classes: ", candidates.size);
236
+ console.log("Active contexts: ", _sharedState.contextSourcesMap.size);
235
237
  }
236
238
  // Clear the cache for the changed files
237
239
  context.changedContent = [];
238
240
  // Cleanup any leftover @layer atrules
239
- root.walkAtRules('layer', (rule)=>{
241
+ root.walkAtRules("layer", (rule)=>{
240
242
  if (Object.keys(layerNodes).includes(rule.params)) {
241
243
  rule.remove();
242
244
  }