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
@@ -0,0 +1,229 @@
1
+ /** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ // There are some pseudo-elements that may or may not be:
2
+ // **Actionable**
3
+ // Zero or more user-action pseudo-classes may be attached to the pseudo-element itself
4
+ // structural-pseudo-classes are NOT allowed but we don't make
5
+ // The spec is not clear on whether this is allowed or not — but in practice it is.
6
+ // **Terminal**
7
+ // It MUST be placed at the end of a selector
8
+ //
9
+ // This is the required in the spec. However, some pseudo elements are not "terminal" because
10
+ // they represent a "boundary piercing" that is compiled out by a build step.
11
+ // **Jumpable**
12
+ // Any terminal element may "jump" over combinators when moving to the end of the selector
13
+ //
14
+ // This is a backwards-compat quirk of :before and :after variants.
15
+ /** @typedef {'terminal' | 'actionable' | 'jumpable'} PseudoProperty */ /** @type {Record<string, PseudoProperty[]>} */ "use strict";
16
+ Object.defineProperty(exports, "__esModule", {
17
+ value: true
18
+ });
19
+ Object.defineProperty(exports, "movePseudos", {
20
+ enumerable: true,
21
+ get: function() {
22
+ return movePseudos;
23
+ }
24
+ });
25
+ let elementProperties = {
26
+ "::after": [
27
+ "terminal",
28
+ "jumpable"
29
+ ],
30
+ "::backdrop": [
31
+ "terminal",
32
+ "jumpable"
33
+ ],
34
+ "::before": [
35
+ "terminal",
36
+ "jumpable"
37
+ ],
38
+ "::cue": [
39
+ "terminal"
40
+ ],
41
+ "::cue-region": [
42
+ "terminal"
43
+ ],
44
+ "::first-letter": [
45
+ "terminal",
46
+ "jumpable"
47
+ ],
48
+ "::first-line": [
49
+ "terminal",
50
+ "jumpable"
51
+ ],
52
+ "::grammar-error": [
53
+ "terminal"
54
+ ],
55
+ "::marker": [
56
+ "terminal",
57
+ "jumpable"
58
+ ],
59
+ "::part": [
60
+ "terminal",
61
+ "actionable"
62
+ ],
63
+ "::placeholder": [
64
+ "terminal",
65
+ "jumpable"
66
+ ],
67
+ "::selection": [
68
+ "terminal",
69
+ "jumpable"
70
+ ],
71
+ "::slotted": [
72
+ "terminal"
73
+ ],
74
+ "::spelling-error": [
75
+ "terminal"
76
+ ],
77
+ "::target-text": [
78
+ "terminal"
79
+ ],
80
+ // other
81
+ "::file-selector-button": [
82
+ "terminal",
83
+ "actionable"
84
+ ],
85
+ "::-webkit-progress-bar": [
86
+ "terminal",
87
+ "actionable"
88
+ ],
89
+ // Webkit scroll bar pseudo elements can be combined with user-action pseudo classes
90
+ "::-webkit-scrollbar": [
91
+ "terminal",
92
+ "actionable"
93
+ ],
94
+ "::-webkit-scrollbar-button": [
95
+ "terminal",
96
+ "actionable"
97
+ ],
98
+ "::-webkit-scrollbar-thumb": [
99
+ "terminal",
100
+ "actionable"
101
+ ],
102
+ "::-webkit-scrollbar-track": [
103
+ "terminal",
104
+ "actionable"
105
+ ],
106
+ "::-webkit-scrollbar-track-piece": [
107
+ "terminal",
108
+ "actionable"
109
+ ],
110
+ "::-webkit-scrollbar-corner": [
111
+ "terminal",
112
+ "actionable"
113
+ ],
114
+ "::-webkit-resizer": [
115
+ "terminal",
116
+ "actionable"
117
+ ],
118
+ // Note: As a rule, double colons (::) should be used instead of a single colon
119
+ // (:). This distinguishes pseudo-classes from pseudo-elements. However, since
120
+ // this distinction was not present in older versions of the W3C spec, most
121
+ // browsers support both syntaxes for the original pseudo-elements.
122
+ ":after": [
123
+ "terminal",
124
+ "jumpable"
125
+ ],
126
+ ":before": [
127
+ "terminal",
128
+ "jumpable"
129
+ ],
130
+ ":first-letter": [
131
+ "terminal",
132
+ "jumpable"
133
+ ],
134
+ ":first-line": [
135
+ "terminal",
136
+ "jumpable"
137
+ ],
138
+ // The default value is used when the pseudo-element is not recognized
139
+ // Because it's not recognized, we don't know if it's terminal or not
140
+ // So we assume it can't be moved AND can have user-action pseudo classes attached to it
141
+ __default__: [
142
+ "actionable"
143
+ ]
144
+ };
145
+ function movePseudos(sel) {
146
+ let [pseudos] = movablePseudos(sel);
147
+ // Remove all pseudo elements from their respective selectors
148
+ pseudos.forEach(([sel, pseudo])=>sel.removeChild(pseudo));
149
+ // Re-add them to the end of the selector in the correct order.
150
+ // This moves terminal pseudo elements to the end of the
151
+ // selector otherwise the selector will not be valid.
152
+ //
153
+ // Examples:
154
+ // - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
155
+ // - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
156
+ //
157
+ // The selector `::before:hover` does not work but we
158
+ // can make it work for you by flipping the order.
159
+ sel.nodes.push(...pseudos.map(([, pseudo])=>pseudo));
160
+ return sel;
161
+ }
162
+ /** @typedef {[sel: Selector, pseudo: Pseudo, attachedTo: Pseudo | null]} MovablePseudo */ /** @typedef {[pseudos: MovablePseudo[], lastSeenElement: Pseudo | null]} MovablePseudosResult */ /**
163
+ * @param {Selector} sel
164
+ * @returns {MovablePseudosResult}
165
+ */ function movablePseudos(sel) {
166
+ /** @type {MovablePseudo[]} */ let buffer = [];
167
+ /** @type {Pseudo | null} */ let lastSeenElement = null;
168
+ for (let node of sel.nodes){
169
+ if (node.type === "combinator") {
170
+ buffer = buffer.filter(([, node])=>propertiesForPseudo(node).includes("jumpable"));
171
+ lastSeenElement = null;
172
+ } else if (node.type === "pseudo") {
173
+ if (isMovablePseudoElement(node)) {
174
+ lastSeenElement = node;
175
+ buffer.push([
176
+ sel,
177
+ node,
178
+ null
179
+ ]);
180
+ } else if (lastSeenElement && isAttachablePseudoClass(node, lastSeenElement)) {
181
+ buffer.push([
182
+ sel,
183
+ node,
184
+ lastSeenElement
185
+ ]);
186
+ } else {
187
+ lastSeenElement = null;
188
+ }
189
+ var _node_nodes;
190
+ for (let sub of (_node_nodes = node.nodes) !== null && _node_nodes !== void 0 ? _node_nodes : []){
191
+ let [movable, lastSeenElementInSub] = movablePseudos(sub);
192
+ lastSeenElement = lastSeenElementInSub || lastSeenElement;
193
+ buffer.push(...movable);
194
+ }
195
+ }
196
+ }
197
+ return [
198
+ buffer,
199
+ lastSeenElement
200
+ ];
201
+ }
202
+ /**
203
+ * @param {Node} node
204
+ * @returns {boolean}
205
+ */ function isPseudoElement(node) {
206
+ return node.value.startsWith("::") || elementProperties[node.value] !== undefined;
207
+ }
208
+ /**
209
+ * @param {Node} node
210
+ * @returns {boolean}
211
+ */ function isMovablePseudoElement(node) {
212
+ return isPseudoElement(node) && propertiesForPseudo(node).includes("terminal");
213
+ }
214
+ /**
215
+ * @param {Node} node
216
+ * @param {Pseudo} pseudo
217
+ * @returns {boolean}
218
+ */ function isAttachablePseudoClass(node, pseudo) {
219
+ if (node.type !== "pseudo") return false;
220
+ if (isPseudoElement(node)) return false;
221
+ return propertiesForPseudo(pseudo).includes("actionable");
222
+ }
223
+ /**
224
+ * @param {Pseudo} pseudo
225
+ * @returns {PseudoProperty[]}
226
+ */ function propertiesForPseudo(pseudo) {
227
+ var _elementProperties_pseudo_value;
228
+ return (_elementProperties_pseudo_value = elementProperties[pseudo.value]) !== null && _elementProperties_pseudo_value !== void 0 ? _elementProperties_pseudo_value : elementProperties.__default__;
229
+ }
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", {
12
12
  });
13
13
  Object.defineProperty(exports, "removeAlphaVariables", {
14
14
  enumerable: true,
15
- get: ()=>removeAlphaVariables
15
+ get: function() {
16
+ return removeAlphaVariables;
17
+ }
16
18
  });
17
19
  function removeAlphaVariables(container, toRemove) {
18
20
  container.walkDecls((decl)=>{
@@ -4,21 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>resolveConfig
7
+ get: function() {
8
+ return resolveConfig;
9
+ }
8
10
  });
9
- const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
10
- const _corePluginList = /*#__PURE__*/ _interopRequireDefault(require("../corePluginList"));
11
- const _configurePlugins = /*#__PURE__*/ _interopRequireDefault(require("./configurePlugins"));
12
- const _colors = /*#__PURE__*/ _interopRequireDefault(require("../public/colors"));
11
+ const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
12
+ const _corePluginList = /*#__PURE__*/ _interop_require_default(require("../corePluginList"));
13
+ const _configurePlugins = /*#__PURE__*/ _interop_require_default(require("./configurePlugins"));
14
+ const _colors = /*#__PURE__*/ _interop_require_default(require("../public/colors"));
13
15
  const _defaults = require("./defaults");
14
16
  const _toPath = require("./toPath");
15
17
  const _normalizeConfig = require("./normalizeConfig");
16
- const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
18
+ const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
17
19
  const _cloneDeep = require("./cloneDeep");
18
20
  const _pluginUtils = require("./pluginUtils");
19
21
  const _withAlphaVariable = require("./withAlphaVariable");
20
- const _toColorValue = /*#__PURE__*/ _interopRequireDefault(require("./toColorValue"));
21
- function _interopRequireDefault(obj) {
22
+ const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./toColorValue"));
23
+ function _interop_require_default(obj) {
22
24
  return obj && obj.__esModule ? obj : {
23
25
  default: obj
24
26
  };
@@ -188,8 +190,8 @@ function extractPluginConfigs(configs) {
188
190
  ...allConfigs,
189
191
  config
190
192
  ];
191
- var ref;
192
- const plugins = (ref = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref !== void 0 ? ref : [];
193
+ var _config_plugins;
194
+ const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
193
195
  if (plugins.length === 0) {
194
196
  return;
195
197
  }
@@ -197,11 +199,11 @@ function extractPluginConfigs(configs) {
197
199
  if (plugin.__isOptionsFunction) {
198
200
  plugin = plugin();
199
201
  }
200
- var ref;
202
+ var _plugin_config;
201
203
  allConfigs = [
202
204
  ...allConfigs,
203
205
  ...extractPluginConfigs([
204
- (ref = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && ref !== void 0 ? ref : {}
206
+ (_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
205
207
  ])
206
208
  ];
207
209
  });
@@ -241,14 +243,14 @@ function resolveConfig(configs) {
241
243
  separator: ":"
242
244
  }
243
245
  ];
244
- var ref, ref1;
246
+ var _t_theme, _c_plugins;
245
247
  return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
246
248
  theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
247
- return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
249
+ return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
248
250
  })))),
249
251
  corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
250
252
  plugins: resolvePluginLists(configs.map((c)=>{
251
- return (ref1 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref1 !== void 0 ? ref1 : [];
253
+ return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
252
254
  }))
253
255
  }, ...allConfigs));
254
256
  }
@@ -2,17 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: ()=>resolveConfigPath
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ default: function() {
13
+ return resolveConfigPath;
14
+ },
15
+ resolveDefaultConfigPath: function() {
16
+ return resolveDefaultConfigPath;
17
+ }
8
18
  });
9
- const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
- const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
- function _interopRequireDefault(obj) {
19
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
20
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
21
+ function _interop_require_default(obj) {
12
22
  return obj && obj.__esModule ? obj : {
13
23
  default: obj
14
24
  };
15
25
  }
26
+ const defaultConfigFiles = [
27
+ "./tailwind.config.js",
28
+ "./tailwind.config.cjs",
29
+ "./tailwind.config.mjs",
30
+ "./tailwind.config.ts"
31
+ ];
16
32
  function isObject(value) {
17
33
  return typeof value === "object" && value !== null;
18
34
  }
@@ -40,10 +56,10 @@ function resolveConfigPath(pathOrConfig) {
40
56
  return _path.default.resolve(pathOrConfig);
41
57
  }
42
58
  // require('tailwindcss')
43
- for (const configFile of [
44
- "./tailwind.config.js",
45
- "./tailwind.config.cjs"
46
- ]){
59
+ return resolveDefaultConfigPath();
60
+ }
61
+ function resolveDefaultConfigPath() {
62
+ for (const configFile of defaultConfigFiles){
47
63
  try {
48
64
  const configPath = _path.default.resolve(configFile);
49
65
  _fs.default.accessSync(configPath);
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>responsive
7
+ get: function() {
8
+ return responsive;
9
+ }
8
10
  });
9
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
- const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("./cloneNodes"));
11
- function _interopRequireDefault(obj) {
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("./cloneNodes"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -18,20 +18,28 @@ Object.defineProperty(exports, "__esModule", {
18
18
  });
19
19
  Object.defineProperty(exports, "splitAtTopLevelOnly", {
20
20
  enumerable: true,
21
- get: ()=>splitAtTopLevelOnly
21
+ get: function() {
22
+ return splitAtTopLevelOnly;
23
+ }
22
24
  });
23
25
  function splitAtTopLevelOnly(input, separator) {
24
26
  let stack = [];
25
27
  let parts = [];
26
28
  let lastPos = 0;
29
+ let isEscaped = false;
27
30
  for(let idx = 0; idx < input.length; idx++){
28
31
  let char = input[idx];
29
- if (stack.length === 0 && char === separator[0]) {
32
+ if (stack.length === 0 && char === separator[0] && !isEscaped) {
30
33
  if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
31
34
  parts.push(input.slice(lastPos, idx));
32
35
  lastPos = idx + separator.length;
33
36
  }
34
37
  }
38
+ if (isEscaped) {
39
+ isEscaped = false;
40
+ } else if (char === "\\") {
41
+ isEscaped = true;
42
+ }
35
43
  if (char === "(" || char === "[" || char === "{") {
36
44
  stack.push(char);
37
45
  } else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
package/lib/util/tap.js CHANGED
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "tap", {
6
6
  enumerable: true,
7
- get: ()=>tap
7
+ get: function() {
8
+ return tap;
9
+ }
8
10
  });
9
11
  function tap(value, mutator) {
10
12
  mutator(value);
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>toColorValue
7
+ get: function() {
8
+ return toColorValue;
9
+ }
8
10
  });
9
11
  function toColorValue(maybeFunction) {
10
12
  return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", {
17
17
  });
18
18
  Object.defineProperty(exports, "toPath", {
19
19
  enumerable: true,
20
- get: ()=>toPath
20
+ get: function() {
21
+ return toPath;
22
+ }
21
23
  });
22
24
  function toPath(path) {
23
25
  if (Array.isArray(path)) return path;
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>transformThemeValue
7
+ get: function() {
8
+ return transformThemeValue;
9
+ }
8
10
  });
9
- const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
10
- const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
11
- function _interopRequireDefault(obj) {
11
+ const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12
+ const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
13
+ function _interop_require_default(obj) {
12
14
  return obj && obj.__esModule ? obj : {
13
15
  default: obj
14
16
  };
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "validateConfig", {
6
6
  enumerable: true,
7
- get: ()=>validateConfig
7
+ get: function() {
8
+ return validateConfig;
9
+ }
8
10
  });
9
- const _log = /*#__PURE__*/ _interopRequireDefault(require("./log"));
10
- function _interopRequireDefault(obj) {
11
+ const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
12
+ function _interop_require_default(obj) {
11
13
  return obj && obj.__esModule ? obj : {
12
14
  default: obj
13
15
  };
@@ -20,5 +22,16 @@ function validateConfig(config) {
20
22
  "https://tailwindcss.com/docs/content-configuration"
21
23
  ]);
22
24
  }
25
+ // Warn if the line-clamp plugin is installed
26
+ try {
27
+ let plugin = require("@tailwindcss/line-clamp");
28
+ if (config.plugins.includes(plugin)) {
29
+ _log.default.warn("line-clamp-in-core", [
30
+ "As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
31
+ "Remove it from the `plugins` array in your configuration to eliminate this warning."
32
+ ]);
33
+ config.plugins = config.plugins.filter((p)=>p !== plugin);
34
+ }
35
+ } catch {}
23
36
  return config;
24
37
  }
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "backgroundSize", {
6
6
  enumerable: true,
7
- get: ()=>backgroundSize
7
+ get: function() {
8
+ return backgroundSize;
9
+ }
8
10
  });
9
11
  const _dataTypes = require("./dataTypes");
10
12
  const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
@@ -9,8 +9,12 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- withAlphaValue: ()=>withAlphaValue,
13
- default: ()=>withAlphaVariable
12
+ withAlphaValue: function() {
13
+ return withAlphaValue;
14
+ },
15
+ default: function() {
16
+ return withAlphaVariable;
17
+ }
14
18
  });
15
19
  const _color = require("./color");
16
20
  function withAlphaValue(color, alphaValue, defaultValue) {
@@ -0,0 +1,4 @@
1
+ import type { Config } from './types/config'
2
+
3
+ declare function loadConfig(path: string): Config
4
+ export = loadConfig
package/loadConfig.js ADDED
@@ -0,0 +1,2 @@
1
+ let loadConfig = require('./lib/public/load-config')
2
+ module.exports = (loadConfig.__esModule ? loadConfig : { default: loadConfig }).default