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,19 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>getAllConfigs
7
+ get: function() {
8
+ return getAllConfigs;
9
+ }
8
10
  });
9
- const _defaultConfigStubJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
11
+ const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
10
12
  const _featureFlags = require("../featureFlags");
11
- function _interopRequireDefault(obj) {
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
15
17
  }
16
18
  function getAllConfigs(config) {
17
- var ref;
18
- const configs = ((ref = config === null || config === void 0 ? void 0 : config.presets) !== null && ref !== void 0 ? ref : [
19
- _defaultConfigStubJs.default
19
+ var _config_presets;
20
+ const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
21
+ _configfull.default
20
22
  ]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
21
23
  const features = {
22
24
  // Add experimental configs here...
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>hashConfig
7
+ get: function() {
8
+ return hashConfig;
9
+ }
8
10
  });
9
- const _objectHash = /*#__PURE__*/ _interopRequireDefault(require("object-hash"));
10
- function _interopRequireDefault(obj) {
11
+ const _objecthash = /*#__PURE__*/ _interop_require_default(require("object-hash"));
12
+ function _interop_require_default(obj) {
11
13
  return obj && obj.__esModule ? obj : {
12
14
  default: obj
13
15
  };
14
16
  }
15
17
  function hashConfig(config) {
16
- return (0, _objectHash.default)(config, {
18
+ return (0, _objecthash.default)(config, {
17
19
  ignoreUnknown: true
18
20
  });
19
21
  }
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>isKeyframeRule
7
+ get: function() {
8
+ return isKeyframeRule;
9
+ }
8
10
  });
9
11
  function isKeyframeRule(rule) {
10
12
  return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>isPlainObject
7
+ get: function() {
8
+ return isPlainObject;
9
+ }
8
10
  });
9
11
  function isPlainObject(value) {
10
12
  if (Object.prototype.toString.call(value) !== "[object Object]") {
@@ -10,7 +10,9 @@ 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: ()=>isSyntacticallyValidPropertyValue
13
+ get: function() {
14
+ return isSyntacticallyValidPropertyValue;
15
+ }
14
16
  });
15
17
  let matchingBrackets = new Map([
16
18
  [
package/lib/util/log.js CHANGED
@@ -9,11 +9,15 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- dim: ()=>dim,
13
- default: ()=>_default
12
+ dim: function() {
13
+ return dim;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
14
18
  });
15
- const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
16
- function _interopRequireDefault(obj) {
19
+ const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
20
+ function _interop_require_default(obj) {
17
21
  return obj && obj.__esModule ? obj : {
18
22
  default: obj
19
23
  };
@@ -9,13 +9,19 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- asClass: ()=>asClass,
13
- default: ()=>nameClass,
14
- formatClass: ()=>formatClass
12
+ asClass: function() {
13
+ return asClass;
14
+ },
15
+ default: function() {
16
+ return nameClass;
17
+ },
18
+ formatClass: function() {
19
+ return formatClass;
20
+ }
15
21
  });
16
- const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("./escapeClassName"));
17
- const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
18
- function _interopRequireDefault(obj) {
22
+ const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
23
+ const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
24
+ function _interop_require_default(obj) {
19
25
  return obj && obj.__esModule ? obj : {
20
26
  default: obj
21
27
  };
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>_default
7
+ get: function() {
8
+ return negateValue;
9
+ }
8
10
  });
9
- function _default(value) {
11
+ function negateValue(value) {
10
12
  value = `${value}`;
11
13
  if (value === "0") {
12
14
  return "0";
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "normalizeConfig", {
6
6
  enumerable: true,
7
- get: ()=>normalizeConfig
7
+ get: function() {
8
+ return normalizeConfig;
9
+ }
8
10
  });
9
- const _log = /*#__PURE__*/ _interopRequireWildcard(require("./log"));
11
+ const _featureFlags = require("../featureFlags");
12
+ const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
10
13
  function _getRequireWildcardCache(nodeInterop) {
11
14
  if (typeof WeakMap !== "function") return null;
12
15
  var cacheBabelInterop = new WeakMap();
@@ -15,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) {
15
18
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
16
19
  })(nodeInterop);
17
20
  }
18
- function _interopRequireWildcard(obj, nodeInterop) {
21
+ function _interop_require_wildcard(obj, nodeInterop) {
19
22
  if (!nodeInterop && obj && obj.__esModule) {
20
23
  return obj;
21
24
  }
@@ -128,8 +131,8 @@ function normalizeConfig(config) {
128
131
  }
129
132
  // `config.content.transform` is optional, and can be a Function or a Record<String, Function>
130
133
  if (typeof config.content.transform === "object") {
131
- for (let value1 of Object.values(config.content.transform)){
132
- if (typeof value1 !== "function") {
134
+ for (let value of Object.values(config.content.transform)){
135
+ if (typeof value !== "function") {
133
136
  return false;
134
137
  }
135
138
  }
@@ -154,12 +157,12 @@ function normalizeConfig(config) {
154
157
  }
155
158
  // Normalize the `safelist`
156
159
  config.safelist = (()=>{
157
- var ref;
160
+ var _purge_options;
158
161
  let { content , purge , safelist } = config;
159
162
  if (Array.isArray(safelist)) return safelist;
160
163
  if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
161
164
  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;
165
+ 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
166
  return [];
164
167
  })();
165
168
  // Normalize the `blocklist`
@@ -185,19 +188,17 @@ function normalizeConfig(config) {
185
188
  ]);
186
189
  config.prefix = "";
187
190
  } else {
188
- var _prefix;
189
- config.prefix = (_prefix = config.prefix) !== null && _prefix !== void 0 ? _prefix : "";
191
+ var _config_prefix;
192
+ config.prefix = (_config_prefix = config.prefix) !== null && _config_prefix !== void 0 ? _config_prefix : "";
190
193
  }
191
194
  // Normalize the `content`
192
195
  config.content = {
193
196
  relative: (()=>{
194
- var ref;
195
197
  let { content } = config;
196
198
  if (content === null || content === void 0 ? void 0 : content.relative) {
197
199
  return content.relative;
198
200
  }
199
- var ref1;
200
- return (ref1 = (ref = config.future) === null || ref === void 0 ? void 0 : ref.relativeContentPathsByDefault) !== null && ref1 !== void 0 ? ref1 : false;
201
+ return (0, _featureFlags.flagEnabled)(config, "relativeContentPathsByDefault");
201
202
  })(),
202
203
  files: (()=>{
203
204
  let { content , purge } = config;
@@ -210,22 +211,22 @@ function normalizeConfig(config) {
210
211
  })(),
211
212
  extract: (()=>{
212
213
  let extract = (()=>{
213
- var ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9;
214
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.extract) return config.purge.extract;
215
- if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.extract) return config.content.extract;
216
- 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;
217
- 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;
218
- 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;
219
- 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;
214
+ 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;
215
+ if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.extract) return config.purge.extract;
216
+ if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.extract) return config.content.extract;
217
+ 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;
218
+ 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;
219
+ 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;
220
+ 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;
220
221
  return {};
221
222
  })();
222
223
  let extractors = {};
223
224
  let defaultExtractor = (()=>{
224
- var ref, ref1, ref2, ref3;
225
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : (ref1 = ref.options) === null || ref1 === void 0 ? void 0 : ref1.defaultExtractor) {
225
+ var _config_purge, _config_purge_options, _config_content, _config_content_options;
226
+ 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) {
226
227
  return config.purge.options.defaultExtractor;
227
228
  }
228
- if ((ref2 = config.content) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.options) === null || ref3 === void 0 ? void 0 : ref3.defaultExtractor) {
229
+ 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) {
229
230
  return config.content.options.defaultExtractor;
230
231
  }
231
232
  return undefined;
@@ -249,11 +250,11 @@ function normalizeConfig(config) {
249
250
  })(),
250
251
  transform: (()=>{
251
252
  let transform = (()=>{
252
- var ref, ref1, ref2, ref3, ref4, ref5;
253
- if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.transform) return config.purge.transform;
254
- if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.transform) return config.content.transform;
255
- 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;
256
- 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;
253
+ var _config_purge, _config_content, _config_purge1, _config_purge_transform, _config_content1, _config_content_transform;
254
+ if ((_config_purge = config.purge) === null || _config_purge === void 0 ? void 0 : _config_purge.transform) return config.purge.transform;
255
+ if ((_config_content = config.content) === null || _config_content === void 0 ? void 0 : _config_content.transform) return config.content.transform;
256
+ 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;
257
+ 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;
257
258
  return {};
258
259
  })();
259
260
  let transformers = {};
@@ -33,10 +33,18 @@ function _export(target, all) {
33
33
  });
34
34
  }
35
35
  _export(exports, {
36
- normalizeScreens: ()=>normalizeScreens,
37
- isScreenSortable: ()=>isScreenSortable,
38
- compareScreens: ()=>compareScreens,
39
- toScreen: ()=>toScreen
36
+ normalizeScreens: function() {
37
+ return normalizeScreens;
38
+ },
39
+ isScreenSortable: function() {
40
+ return isScreenSortable;
41
+ },
42
+ compareScreens: function() {
43
+ return compareScreens;
44
+ },
45
+ toScreen: function() {
46
+ return toScreen;
47
+ }
40
48
  });
41
49
  function normalizeScreens(screens, root = true) {
42
50
  if (Array.isArray(screens)) {
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>parseAnimationValue
7
+ get: function() {
8
+ return parseAnimationValue;
9
+ }
8
10
  });
9
11
  const DIRECTIONS = new Set([
10
12
  "normal",
@@ -9,8 +9,12 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- parseBoxShadowValue: ()=>parseBoxShadowValue,
13
- formatBoxShadowValue: ()=>formatBoxShadowValue
12
+ parseBoxShadowValue: function() {
13
+ return parseBoxShadowValue;
14
+ },
15
+ formatBoxShadowValue: function() {
16
+ return formatBoxShadowValue;
17
+ }
14
18
  });
15
19
  const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
16
20
  let KEYWORDS = new Set([
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "__esModule", {
11
11
  });
12
12
  Object.defineProperty(exports, "default", {
13
13
  enumerable: true,
14
- get: ()=>parseDependency
14
+ get: function() {
15
+ return parseDependency;
16
+ }
15
17
  });
16
18
  function parseDependency(contentPath) {
17
19
  if (contentPath.ignore) {
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "parseGlob", {
6
6
  enumerable: true,
7
- get: ()=>parseGlob
7
+ get: function() {
8
+ return parseGlob;
9
+ }
8
10
  });
9
- const _globParent = /*#__PURE__*/ _interopRequireDefault(require("glob-parent"));
10
- function _interopRequireDefault(obj) {
11
+ const _globparent = /*#__PURE__*/ _interop_require_default(require("glob-parent"));
12
+ function _interop_require_default(obj) {
11
13
  return obj && obj.__esModule ? obj : {
12
14
  default: obj
13
15
  };
14
16
  }
15
17
  function parseGlob(pattern) {
16
18
  let glob = pattern;
17
- let base = (0, _globParent.default)(pattern);
19
+ let base = (0, _globparent.default)(pattern);
18
20
  if (base !== ".") {
19
21
  glob = pattern.substr(base.length);
20
22
  if (glob.charAt(0) === "/") {
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>parseObjectStyles
7
+ get: function() {
8
+ return parseObjectStyles;
9
+ }
8
10
  });
9
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
- const _postcssNested = /*#__PURE__*/ _interopRequireDefault(require("postcss-nested"));
11
- const _postcssJs = /*#__PURE__*/ _interopRequireDefault(require("postcss-js"));
12
- function _interopRequireDefault(obj) {
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _postcssnested = /*#__PURE__*/ _interop_require_default(require("postcss-nested"));
13
+ const _postcssjs = /*#__PURE__*/ _interop_require_default(require("postcss-js"));
14
+ function _interop_require_default(obj) {
13
15
  return obj && obj.__esModule ? obj : {
14
16
  default: obj
15
17
  };
@@ -22,13 +24,13 @@ function parseObjectStyles(styles) {
22
24
  }
23
25
  return styles.flatMap((style)=>{
24
26
  return (0, _postcss.default)([
25
- (0, _postcssNested.default)({
27
+ (0, _postcssnested.default)({
26
28
  bubble: [
27
29
  "screen"
28
30
  ]
29
31
  })
30
32
  ]).process(style, {
31
- parser: _postcssJs.default
33
+ parser: _postcssjs.default
32
34
  }).root.nodes;
33
35
  });
34
36
  }
@@ -9,52 +9,49 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- updateAllClasses: ()=>updateAllClasses,
13
- filterSelectorsForClass: ()=>filterSelectorsForClass,
14
- asValue: ()=>asValue,
15
- parseColorFormat: ()=>parseColorFormat,
16
- asColor: ()=>asColor,
17
- asLookupValue: ()=>asLookupValue,
18
- typeMap: ()=>typeMap,
19
- coerceValue: ()=>coerceValue,
20
- getMatchingTypes: ()=>getMatchingTypes
12
+ updateAllClasses: function() {
13
+ return updateAllClasses;
14
+ },
15
+ asValue: function() {
16
+ return asValue;
17
+ },
18
+ parseColorFormat: function() {
19
+ return parseColorFormat;
20
+ },
21
+ asColor: function() {
22
+ return asColor;
23
+ },
24
+ asLookupValue: function() {
25
+ return asLookupValue;
26
+ },
27
+ typeMap: function() {
28
+ return typeMap;
29
+ },
30
+ coerceValue: function() {
31
+ return coerceValue;
32
+ },
33
+ getMatchingTypes: function() {
34
+ return getMatchingTypes;
35
+ }
21
36
  });
22
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
23
- const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
37
+ const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
24
38
  const _withAlphaVariable = require("./withAlphaVariable");
25
39
  const _dataTypes = require("./dataTypes");
26
- const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
40
+ const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
27
41
  const _validateFormalSyntax = require("./validateFormalSyntax");
28
- const _featureFlagsJs = require("../featureFlags.js");
29
- function _interopRequireDefault(obj) {
42
+ const _featureFlags = require("../featureFlags.js");
43
+ function _interop_require_default(obj) {
30
44
  return obj && obj.__esModule ? obj : {
31
45
  default: obj
32
46
  };
33
47
  }
34
48
  function updateAllClasses(selectors, updateClass) {
35
- let parser = (0, _postcssSelectorParser.default)((selectors)=>{
36
- selectors.walkClasses((sel)=>{
37
- let updatedClass = updateClass(sel.value);
38
- sel.value = updatedClass;
39
- if (sel.raws && sel.raws.value) {
40
- sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
41
- }
42
- });
43
- });
44
- let result = parser.processSync(selectors);
45
- return result;
46
- }
47
- function filterSelectorsForClass(selectors, classCandidate) {
48
- let parser = (0, _postcssSelectorParser.default)((selectors)=>{
49
- selectors.each((sel)=>{
50
- const containsClass = sel.nodes.some((node)=>node.type === "class" && node.value === classCandidate);
51
- if (!containsClass) {
52
- sel.remove();
53
- }
54
- });
49
+ selectors.walkClasses((sel)=>{
50
+ sel.value = updateClass(sel.value);
51
+ if (sel.raws && sel.raws.value) {
52
+ sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
53
+ }
55
54
  });
56
- let result = parser.processSync(selectors);
57
- return result;
58
55
  }
59
56
  function resolveArbitraryValue(modifier, validate) {
60
57
  if (!isArbitraryValue(modifier)) {
@@ -80,8 +77,8 @@ function asNegativeValue(modifier, lookup = {}, validate) {
80
77
  }
81
78
  }
82
79
  function asValue(modifier, options = {}, { validate =()=>true } = {}) {
83
- var ref;
84
- let value = (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
80
+ var _options_values;
81
+ let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
85
82
  if (value !== undefined) {
86
83
  return value;
87
84
  }
@@ -123,27 +120,30 @@ function parseColorFormat(value) {
123
120
  }
124
121
  return value;
125
122
  }
123
+ function unwrapArbitraryModifier(modifier) {
124
+ return (0, _dataTypes.normalize)(modifier.slice(1, -1));
125
+ }
126
126
  function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
127
- var ref;
128
- if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier]) !== undefined) {
129
- var ref1;
130
- return parseColorFormat((ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[modifier]);
127
+ var _options_values;
128
+ if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
129
+ var _options_values1;
130
+ return parseColorFormat((_options_values1 = options.values) === null || _options_values1 === void 0 ? void 0 : _options_values1[modifier]);
131
131
  }
132
132
  // TODO: Hoist this up to getMatchingTypes or something
133
133
  // We do this here because we need the alpha value (if any)
134
134
  let [color, alpha] = splitUtilityModifier(modifier);
135
135
  if (alpha !== undefined) {
136
- var ref2, ref3, ref4;
137
- var ref5;
138
- let normalizedColor = (ref5 = (ref2 = options.values) === null || ref2 === void 0 ? void 0 : ref2[color]) !== null && ref5 !== void 0 ? ref5 : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
136
+ var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
137
+ var _options_values_color;
138
+ let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
139
139
  if (normalizedColor === undefined) {
140
140
  return undefined;
141
141
  }
142
142
  normalizedColor = parseColorFormat(normalizedColor);
143
143
  if (isArbitraryValue(alpha)) {
144
- return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, alpha.slice(1, -1));
144
+ return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, unwrapArbitraryModifier(alpha));
145
145
  }
146
- if (((ref3 = tailwindConfig.theme) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.opacity) === null || ref4 === void 0 ? void 0 : ref4[alpha]) === undefined) {
146
+ if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
147
147
  return undefined;
148
148
  }
149
149
  return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
@@ -153,8 +153,8 @@ function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
153
153
  });
154
154
  }
155
155
  function asLookupValue(modifier, options = {}) {
156
- var ref;
157
- return (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
156
+ var _options_values;
157
+ return (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
158
158
  }
159
159
  function guess(validate) {
160
160
  return (modifier, options)=>{
@@ -236,7 +236,7 @@ function coerceValue(types, modifier, options, tailwindConfig) {
236
236
  return [];
237
237
  }
238
238
  function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
239
- let modifiersEnabled = (0, _featureFlagsJs.flagEnabled)(tailwindConfig, "generalizedModifiers");
239
+ let modifiersEnabled = (0, _featureFlags.flagEnabled)(tailwindConfig, "generalizedModifiers");
240
240
  let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
241
241
  let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
242
242
  if (!canUseUtilityModifier) {
@@ -250,13 +250,13 @@ function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
250
250
  // TODO: Move to asValue… somehow
251
251
  if (utilityModifier !== undefined) {
252
252
  if (typeof options.modifiers === "object") {
253
- var ref;
254
- var ref1;
255
- let configValue = (ref1 = (ref = options.modifiers) === null || ref === void 0 ? void 0 : ref[utilityModifier]) !== null && ref1 !== void 0 ? ref1 : null;
253
+ var _options_modifiers;
254
+ var _options_modifiers_utilityModifier;
255
+ let configValue = (_options_modifiers_utilityModifier = (_options_modifiers = options.modifiers) === null || _options_modifiers === void 0 ? void 0 : _options_modifiers[utilityModifier]) !== null && _options_modifiers_utilityModifier !== void 0 ? _options_modifiers_utilityModifier : null;
256
256
  if (configValue !== null) {
257
257
  utilityModifier = configValue;
258
258
  } else if (isArbitraryValue(utilityModifier)) {
259
- utilityModifier = utilityModifier.slice(1, -1);
259
+ utilityModifier = unwrapArbitraryModifier(utilityModifier);
260
260
  }
261
261
  }
262
262
  }
@@ -2,22 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
5
+ Object.defineProperty(exports, /**
6
+ * @template {string | import('postcss-selector-parser').Root} T
7
+ *
8
+ * Prefix all classes in the selector with the given prefix
9
+ *
10
+ * It can take either a string or a selector AST and will return the same type
11
+ *
12
+ * @param {string} prefix
13
+ * @param {T} selector
14
+ * @param {boolean} prependNegative
15
+ * @returns {T}
16
+ */ "default", {
6
17
  enumerable: true,
7
- get: ()=>_default
18
+ get: function() {
19
+ return _default;
20
+ }
8
21
  });
9
- const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
10
- function _interopRequireDefault(obj) {
22
+ const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
23
+ function _interop_require_default(obj) {
11
24
  return obj && obj.__esModule ? obj : {
12
25
  default: obj
13
26
  };
14
27
  }
15
28
  function _default(prefix, selector, prependNegative = false) {
16
- return (0, _postcssSelectorParser.default)((selectors)=>{
17
- selectors.walkClasses((classSelector)=>{
18
- let baseClass = classSelector.value;
19
- let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
20
- classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
21
- });
22
- }).processSync(selector);
29
+ if (prefix === "") {
30
+ return selector;
31
+ }
32
+ let ast = typeof selector === "string" ? (0, _postcssselectorparser.default)().astSync(selector) : selector;
33
+ ast.walkClasses((classSelector)=>{
34
+ let baseClass = classSelector.value;
35
+ let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
36
+ classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
37
+ });
38
+ return typeof selector === "string" ? ast.toString() : ast;
23
39
  }