tailwindcss 0.0.0-insiders.ebc1c7a → 0.0.0-insiders.ec0049a

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 (165) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +18 -11
  3. package/dist/chunk-AZANAYY2.mjs +1 -0
  4. package/dist/chunk-CH45MXZF.mjs +10 -0
  5. package/dist/chunk-V2K3XTS4.mjs +1 -0
  6. package/dist/colors-b_6i0Oi7.d.ts +295 -0
  7. package/dist/colors.d.mts +295 -0
  8. package/dist/colors.d.ts +5 -0
  9. package/dist/colors.js +1 -0
  10. package/dist/colors.mjs +1 -0
  11. package/dist/default-theme.d.mts +1147 -0
  12. package/dist/default-theme.d.ts +1147 -0
  13. package/dist/default-theme.js +1 -0
  14. package/dist/default-theme.mjs +1 -0
  15. package/dist/flatten-color-palette.d.mts +6 -0
  16. package/dist/flatten-color-palette.d.ts +6 -0
  17. package/dist/flatten-color-palette.js +1 -0
  18. package/dist/flatten-color-palette.mjs +1 -0
  19. package/dist/lib.d.mts +260 -0
  20. package/dist/lib.d.ts +3 -0
  21. package/dist/lib.js +33 -0
  22. package/dist/lib.mjs +24 -0
  23. package/dist/plugin.d.mts +11 -0
  24. package/dist/plugin.d.ts +104 -0
  25. package/dist/plugin.js +1 -0
  26. package/dist/plugin.mjs +1 -0
  27. package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
  28. package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  29. package/dist/types-B254mqw1.d.mts +98 -0
  30. package/index.css +865 -0
  31. package/package.json +73 -110
  32. package/preflight.css +383 -0
  33. package/theme.css +453 -0
  34. package/CHANGELOG.md +0 -1742
  35. package/base.css +0 -1
  36. package/colors.js +0 -304
  37. package/components.css +0 -1
  38. package/defaultConfig.js +0 -4
  39. package/defaultTheme.js +0 -4
  40. package/lib/cli-peer-dependencies.js +0 -20
  41. package/lib/cli.js +0 -765
  42. package/lib/constants.js +0 -37
  43. package/lib/corePluginList.js +0 -8
  44. package/lib/corePlugins.js +0 -2977
  45. package/lib/css/LICENSE +0 -25
  46. package/lib/css/preflight.css +0 -354
  47. package/lib/featureFlags.js +0 -60
  48. package/lib/index.js +0 -31
  49. package/lib/lib/collapseAdjacentRules.js +0 -43
  50. package/lib/lib/evaluateTailwindFunctions.js +0 -192
  51. package/lib/lib/expandApplyAtRules.js +0 -245
  52. package/lib/lib/expandTailwindAtRules.js +0 -260
  53. package/lib/lib/generateRules.js +0 -362
  54. package/lib/lib/getModuleDependencies.js +0 -53
  55. package/lib/lib/normalizeTailwindDirectives.js +0 -68
  56. package/lib/lib/resolveDefaultsAtRules.js +0 -105
  57. package/lib/lib/setupContextUtils.js +0 -643
  58. package/lib/lib/setupTrackingContext.js +0 -190
  59. package/lib/lib/setupWatchingContext.js +0 -331
  60. package/lib/lib/sharedState.js +0 -29
  61. package/lib/lib/substituteScreenAtRules.js +0 -31
  62. package/lib/processTailwindFeatures.js +0 -57
  63. package/lib/util/bigSign.js +0 -10
  64. package/lib/util/buildMediaQuery.js +0 -36
  65. package/lib/util/cloneDeep.js +0 -18
  66. package/lib/util/cloneNodes.js +0 -18
  67. package/lib/util/color.js +0 -74
  68. package/lib/util/configurePlugins.js +0 -19
  69. package/lib/util/createPlugin.js +0 -33
  70. package/lib/util/createUtilityPlugin.js +0 -51
  71. package/lib/util/defaults.js +0 -20
  72. package/lib/util/escapeClassName.js +0 -21
  73. package/lib/util/escapeCommas.js +0 -10
  74. package/lib/util/flattenColorPalette.js +0 -15
  75. package/lib/util/getAllConfigs.js +0 -22
  76. package/lib/util/hashConfig.js +0 -16
  77. package/lib/util/isKeyframeRule.js +0 -10
  78. package/lib/util/isPlainObject.js +0 -15
  79. package/lib/util/log.js +0 -38
  80. package/lib/util/nameClass.js +0 -32
  81. package/lib/util/negateValue.js +0 -20
  82. package/lib/util/parseAnimationValue.js +0 -60
  83. package/lib/util/parseDependency.js +0 -74
  84. package/lib/util/parseObjectStyles.js +0 -28
  85. package/lib/util/pluginUtils.js +0 -318
  86. package/lib/util/prefixSelector.js +0 -23
  87. package/lib/util/resolveConfig.js +0 -289
  88. package/lib/util/resolveConfigPath.js +0 -59
  89. package/lib/util/responsive.js +0 -18
  90. package/lib/util/tap.js +0 -11
  91. package/lib/util/toColorValue.js +0 -10
  92. package/lib/util/toPath.js +0 -11
  93. package/lib/util/transformThemeValue.js +0 -32
  94. package/lib/util/withAlphaVariable.js +0 -65
  95. package/nesting/README.md +0 -42
  96. package/nesting/index.js +0 -12
  97. package/nesting/plugin.js +0 -41
  98. package/peers/index.js +0 -87302
  99. package/plugin.js +0 -3
  100. package/prettier.config.js +0 -19
  101. package/resolveConfig.js +0 -7
  102. package/screens.css +0 -1
  103. package/scripts/create-plugin-list.js +0 -10
  104. package/scripts/install-integrations.js +0 -27
  105. package/scripts/rebuildFixtures.js +0 -68
  106. package/src/cli-peer-dependencies.js +0 -9
  107. package/src/cli.js +0 -759
  108. package/src/constants.js +0 -17
  109. package/src/corePluginList.js +0 -1
  110. package/src/corePlugins.js +0 -2228
  111. package/src/css/LICENSE +0 -25
  112. package/src/css/preflight.css +0 -354
  113. package/src/featureFlags.js +0 -48
  114. package/src/index.js +0 -34
  115. package/src/lib/collapseAdjacentRules.js +0 -39
  116. package/src/lib/evaluateTailwindFunctions.js +0 -195
  117. package/src/lib/expandApplyAtRules.js +0 -251
  118. package/src/lib/expandTailwindAtRules.js +0 -262
  119. package/src/lib/generateRules.js +0 -319
  120. package/src/lib/getModuleDependencies.js +0 -39
  121. package/src/lib/normalizeTailwindDirectives.js +0 -77
  122. package/src/lib/resolveDefaultsAtRules.js +0 -105
  123. package/src/lib/setupContextUtils.js +0 -639
  124. package/src/lib/setupTrackingContext.js +0 -181
  125. package/src/lib/setupWatchingContext.js +0 -306
  126. package/src/lib/sharedState.js +0 -13
  127. package/src/lib/substituteScreenAtRules.js +0 -16
  128. package/src/processTailwindFeatures.js +0 -41
  129. package/src/util/bigSign.js +0 -3
  130. package/src/util/buildMediaQuery.js +0 -24
  131. package/src/util/cloneDeep.js +0 -11
  132. package/src/util/cloneNodes.js +0 -11
  133. package/src/util/color.js +0 -56
  134. package/src/util/configurePlugins.js +0 -23
  135. package/src/util/createPlugin.js +0 -27
  136. package/src/util/createUtilityPlugin.js +0 -46
  137. package/src/util/defaults.js +0 -11
  138. package/src/util/escapeClassName.js +0 -8
  139. package/src/util/escapeCommas.js +0 -3
  140. package/src/util/flattenColorPalette.js +0 -13
  141. package/src/util/getAllConfigs.js +0 -19
  142. package/src/util/hashConfig.js +0 -5
  143. package/src/util/isKeyframeRule.js +0 -3
  144. package/src/util/isPlainObject.js +0 -8
  145. package/src/util/log.js +0 -28
  146. package/src/util/nameClass.js +0 -22
  147. package/src/util/negateValue.js +0 -14
  148. package/src/util/parseAnimationValue.js +0 -62
  149. package/src/util/parseDependency.js +0 -45
  150. package/src/util/parseObjectStyles.js +0 -19
  151. package/src/util/pluginUtils.js +0 -295
  152. package/src/util/prefixSelector.js +0 -15
  153. package/src/util/resolveConfig.js +0 -282
  154. package/src/util/resolveConfigPath.js +0 -55
  155. package/src/util/responsive.js +0 -10
  156. package/src/util/tap.js +0 -4
  157. package/src/util/toColorValue.js +0 -3
  158. package/src/util/toPath.js +0 -4
  159. package/src/util/transformThemeValue.js +0 -37
  160. package/src/util/withAlphaVariable.js +0 -44
  161. package/stubs/defaultConfig.stub.js +0 -884
  162. package/stubs/defaultPostCssConfig.stub.js +0 -6
  163. package/stubs/simpleConfig.stub.js +0 -8
  164. package/tailwind.css +0 -5
  165. package/variants.css +0 -1
@@ -1,318 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.applyPseudoToMarker = applyPseudoToMarker;
7
- exports.updateAllClasses = updateAllClasses;
8
- exports.updateLastClasses = updateLastClasses;
9
- exports.transformAllSelectors = transformAllSelectors;
10
- exports.transformAllClasses = transformAllClasses;
11
- exports.transformLastClasses = transformLastClasses;
12
- exports.asValue = asValue;
13
- exports.asUnit = asUnit;
14
- exports.asColor = asColor;
15
- exports.asAngle = asAngle;
16
- exports.asLength = asLength;
17
- exports.asLookupValue = asLookupValue;
18
- exports.coerceValue = coerceValue;
19
-
20
- var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
21
-
22
- var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
23
-
24
- var _withAlphaVariable = require("./withAlphaVariable");
25
-
26
- var _isKeyframeRule = _interopRequireDefault(require("./isKeyframeRule"));
27
-
28
- var _color = require("./color");
29
-
30
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
- function applyPseudoToMarker(selector, marker, state, join) {
33
- let states = [state];
34
- let markerIdx = selector.indexOf(marker + ':');
35
-
36
- if (markerIdx !== -1) {
37
- let existingMarker = selector.slice(markerIdx, selector.indexOf(' ', markerIdx));
38
- states = states.concat(selector.slice(markerIdx + marker.length + 1, existingMarker.length).split(':'));
39
- selector = selector.replace(existingMarker, '');
40
- }
41
-
42
- return join(`${[marker, ...states].join(':')}`, selector);
43
- }
44
-
45
- function updateAllClasses(selectors, updateClass) {
46
- let parser = (0, _postcssSelectorParser.default)(selectors => {
47
- selectors.walkClasses(sel => {
48
- let updatedClass = updateClass(sel.value, {
49
- withPseudo(className, pseudo) {
50
- sel.parent.insertAfter(sel, _postcssSelectorParser.default.pseudo({
51
- value: `${pseudo}`
52
- }));
53
- return className;
54
- }
55
-
56
- });
57
- sel.value = updatedClass;
58
-
59
- if (sel.raws && sel.raws.value) {
60
- sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
61
- }
62
- });
63
- });
64
- let result = parser.processSync(selectors);
65
- return result;
66
- }
67
-
68
- function updateLastClasses(selectors, updateClass) {
69
- let parser = (0, _postcssSelectorParser.default)(selectors => {
70
- selectors.each(sel => {
71
- let lastClass = sel.filter(({
72
- type
73
- }) => type === 'class').pop();
74
-
75
- if (lastClass === undefined) {
76
- return;
77
- }
78
-
79
- let updatedClass = updateClass(lastClass.value, {
80
- withPseudo(className, pseudo) {
81
- lastClass.parent.insertAfter(lastClass, _postcssSelectorParser.default.pseudo({
82
- value: `${pseudo}`
83
- }));
84
- return className;
85
- }
86
-
87
- });
88
- lastClass.value = updatedClass;
89
-
90
- if (lastClass.raws && lastClass.raws.value) {
91
- lastClass.raws.value = (0, _escapeCommas.default)(lastClass.raws.value);
92
- }
93
- });
94
- });
95
- let result = parser.processSync(selectors);
96
- return result;
97
- }
98
-
99
- function splitByNotEscapedCommas(str) {
100
- let chunks = [];
101
- let currentChunk = '';
102
-
103
- for (let i = 0; i < str.length; i++) {
104
- if (str[i] === ',' && str[i - 1] !== '\\') {
105
- chunks.push(currentChunk);
106
- currentChunk = '';
107
- } else {
108
- currentChunk += str[i];
109
- }
110
- }
111
-
112
- chunks.push(currentChunk);
113
- return chunks;
114
- }
115
-
116
- function transformAllSelectors(transformSelector, {
117
- wrap,
118
- withRule
119
- } = {}) {
120
- return ({
121
- container
122
- }) => {
123
- container.walkRules(rule => {
124
- if ((0, _isKeyframeRule.default)(rule)) {
125
- return rule;
126
- }
127
-
128
- let transformed = splitByNotEscapedCommas(rule.selector).map(transformSelector).join(',');
129
- rule.selector = transformed;
130
-
131
- if (withRule) {
132
- withRule(rule);
133
- }
134
-
135
- return rule;
136
- });
137
-
138
- if (wrap) {
139
- let wrapper = wrap();
140
- let nodes = container.nodes;
141
- container.removeAll();
142
- wrapper.append(nodes);
143
- container.append(wrapper);
144
- }
145
- };
146
- }
147
-
148
- function transformAllClasses(transformClass, {
149
- wrap,
150
- withRule
151
- } = {}) {
152
- return ({
153
- container
154
- }) => {
155
- container.walkRules(rule => {
156
- let selector = rule.selector;
157
- let variantSelector = updateAllClasses(selector, transformClass);
158
- rule.selector = variantSelector;
159
-
160
- if (withRule) {
161
- withRule(rule);
162
- }
163
-
164
- return rule;
165
- });
166
-
167
- if (wrap) {
168
- let wrapper = wrap();
169
- let nodes = container.nodes;
170
- container.removeAll();
171
- wrapper.append(nodes);
172
- container.append(wrapper);
173
- }
174
- };
175
- }
176
-
177
- function transformLastClasses(transformClass, {
178
- wrap,
179
- withRule
180
- } = {}) {
181
- return ({
182
- container
183
- }) => {
184
- container.walkRules(rule => {
185
- let selector = rule.selector;
186
- let variantSelector = updateLastClasses(selector, transformClass);
187
- rule.selector = variantSelector;
188
-
189
- if (withRule) {
190
- withRule(rule);
191
- }
192
-
193
- return rule;
194
- });
195
-
196
- if (wrap) {
197
- let wrapper = wrap();
198
- let nodes = container.nodes;
199
- container.removeAll();
200
- wrapper.append(nodes);
201
- container.append(wrapper);
202
- }
203
- };
204
- }
205
-
206
- function asValue(modifier, lookup = {}, {
207
- validate = () => true
208
- } = {}) {
209
- let value = lookup[modifier];
210
-
211
- if (value !== undefined) {
212
- return value;
213
- }
214
-
215
- if (modifier[0] !== '[' || modifier[modifier.length - 1] !== ']') {
216
- return undefined;
217
- }
218
-
219
- value = modifier.slice(1, -1);
220
-
221
- if (!validate(value)) {
222
- return undefined;
223
- } // convert `_` to ` `, escept for escaped underscores `\_`
224
-
225
-
226
- value = value.replace(/([^\\])_/g, '$1 ').replace(/^_/g, ' ').replace(/\\_/g, '_'); // add spaces around operators inside calc() that do not follow an operator or (
227
-
228
- return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, '$1 $2 ');
229
- }
230
-
231
- function asUnit(modifier, units, lookup = {}) {
232
- return asValue(modifier, lookup, {
233
- validate: value => {
234
- let unitsPattern = `(?:${units.join('|')})`;
235
- return new RegExp(`${unitsPattern}$`).test(value) || new RegExp(`^calc\\(.+?${unitsPattern}`).test(value);
236
- }
237
- });
238
- }
239
-
240
- function isArbitraryValue(input) {
241
- return input.startsWith('[') && input.endsWith(']');
242
- }
243
-
244
- function splitAlpha(modifier) {
245
- let slashIdx = modifier.lastIndexOf('/');
246
-
247
- if (slashIdx === -1 || slashIdx === modifier.length - 1) {
248
- return [modifier];
249
- }
250
-
251
- return [modifier.slice(0, slashIdx), modifier.slice(slashIdx + 1)];
252
- }
253
-
254
- function asColor(modifier, lookup = {}, tailwindConfig = {}) {
255
- if (lookup[modifier] !== undefined) {
256
- return lookup[modifier];
257
- }
258
-
259
- let [color, alpha] = splitAlpha(modifier);
260
-
261
- if (lookup[color] !== undefined) {
262
- var _tailwindConfig$theme, _tailwindConfig$theme2;
263
-
264
- if (isArbitraryValue(alpha)) {
265
- return (0, _withAlphaVariable.withAlphaValue)(lookup[color], alpha.slice(1, -1));
266
- }
267
-
268
- if (((_tailwindConfig$theme = tailwindConfig.theme) === null || _tailwindConfig$theme === void 0 ? void 0 : (_tailwindConfig$theme2 = _tailwindConfig$theme.opacity) === null || _tailwindConfig$theme2 === void 0 ? void 0 : _tailwindConfig$theme2[alpha]) === undefined) {
269
- return undefined;
270
- }
271
-
272
- return (0, _withAlphaVariable.withAlphaValue)(lookup[color], tailwindConfig.theme.opacity[alpha]);
273
- }
274
-
275
- return asValue(modifier, lookup, {
276
- validate: value => (0, _color.parseColor)(value) !== null
277
- });
278
- }
279
-
280
- function asAngle(modifier, lookup = {}) {
281
- return asUnit(modifier, ['deg', 'grad', 'rad', 'turn'], lookup);
282
- }
283
-
284
- function asLength(modifier, lookup = {}) {
285
- return asUnit(modifier, ['cm', 'mm', 'Q', 'in', 'pc', 'pt', 'px', 'em', 'ex', 'ch', 'rem', 'lh', 'vw', 'vh', 'vmin', 'vmax', '%'], lookup);
286
- }
287
-
288
- function asLookupValue(modifier, lookup = {}) {
289
- return lookup[modifier];
290
- }
291
-
292
- let typeMap = {
293
- any: asValue,
294
- color: asColor,
295
- angle: asAngle,
296
- length: asLength,
297
- lookup: asLookupValue
298
- };
299
-
300
- function splitAtFirst(input, delim) {
301
- return (([first, ...rest]) => [first, rest.join(delim)])(input.split(delim));
302
- }
303
-
304
- function coerceValue(type, modifier, values, tailwindConfig) {
305
- let [scaleType, arbitraryType = scaleType] = [].concat(type);
306
-
307
- if (isArbitraryValue(modifier)) {
308
- let [explicitType, value] = splitAtFirst(modifier.slice(1, -1), ':');
309
-
310
- if (value.length > 0 && Object.keys(typeMap).includes(explicitType)) {
311
- return [asValue(`[${value}]`, values, tailwindConfig), explicitType];
312
- }
313
-
314
- return [typeMap[arbitraryType](modifier, values, tailwindConfig), arbitraryType];
315
- }
316
-
317
- return [typeMap[scaleType](modifier, values, tailwindConfig), scaleType];
318
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
-
8
- var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
9
-
10
- var _tap = require("./tap");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function _default(prefix, selector) {
15
- const getPrefix = typeof prefix === 'function' ? prefix : () => prefix === undefined ? '' : prefix;
16
- return (0, _postcssSelectorParser.default)(selectors => {
17
- selectors.walkClasses(classSelector => {
18
- (0, _tap.tap)(classSelector.value, baseClass => {
19
- classSelector.value = `${getPrefix('.' + baseClass)}${baseClass}`;
20
- });
21
- });
22
- }).processSync(selector);
23
- }
@@ -1,289 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = resolveConfig;
7
-
8
- var _negateValue = _interopRequireDefault(require("./negateValue"));
9
-
10
- var _corePluginList = _interopRequireDefault(require("../corePluginList"));
11
-
12
- var _configurePlugins = _interopRequireDefault(require("./configurePlugins"));
13
-
14
- var _defaultConfig = _interopRequireDefault(require("../../stubs/defaultConfig.stub"));
15
-
16
- var _colors = _interopRequireDefault(require("../../colors"));
17
-
18
- var _log = _interopRequireDefault(require("./log"));
19
-
20
- var _defaults = require("./defaults");
21
-
22
- var _toPath = require("./toPath");
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- function isFunction(input) {
27
- return typeof input === 'function';
28
- }
29
-
30
- function isObject(input) {
31
- return typeof input === 'object' && input !== null;
32
- }
33
-
34
- function mergeWith(target, ...sources) {
35
- let customizer = sources.pop();
36
-
37
- for (let source of sources) {
38
- for (let k in source) {
39
- let merged = customizer(target[k], source[k]);
40
-
41
- if (merged === undefined) {
42
- if (isObject(target[k]) && isObject(source[k])) {
43
- target[k] = mergeWith(target[k], source[k], customizer);
44
- } else {
45
- target[k] = source[k];
46
- }
47
- } else {
48
- target[k] = merged;
49
- }
50
- }
51
- }
52
-
53
- return target;
54
- }
55
-
56
- const configUtils = {
57
- colors: _colors.default,
58
-
59
- negative(scale) {
60
- return Object.keys(scale).filter(key => scale[key] !== '0').reduce((negativeScale, key) => ({ ...negativeScale,
61
- [`-${key}`]: (0, _negateValue.default)(scale[key])
62
- }), {});
63
- },
64
-
65
- breakpoints(screens) {
66
- return Object.keys(screens).filter(key => typeof screens[key] === 'string').reduce((breakpoints, key) => ({ ...breakpoints,
67
- [`screen-${key}`]: screens[key]
68
- }), {});
69
- }
70
-
71
- };
72
-
73
- function value(valueToResolve, ...args) {
74
- return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
75
- }
76
-
77
- function collectExtends(items) {
78
- return items.reduce((merged, {
79
- extend
80
- }) => {
81
- return mergeWith(merged, extend, (mergedValue, extendValue) => {
82
- if (mergedValue === undefined) {
83
- return [extendValue];
84
- }
85
-
86
- if (Array.isArray(mergedValue)) {
87
- return [extendValue, ...mergedValue];
88
- }
89
-
90
- return [extendValue, mergedValue];
91
- });
92
- }, {});
93
- }
94
-
95
- function mergeThemes(themes) {
96
- return { ...themes.reduce((merged, theme) => (0, _defaults.defaults)(merged, theme), {}),
97
- // In order to resolve n config objects, we combine all of their `extend` properties
98
- // into arrays instead of objects so they aren't overridden.
99
- extend: collectExtends(themes)
100
- };
101
- }
102
-
103
- function mergeExtensionCustomizer(merged, value) {
104
- // When we have an array of objects, we do want to merge it
105
- if (Array.isArray(merged) && isObject(merged[0])) {
106
- return merged.concat(value);
107
- } // When the incoming value is an array, and the existing config is an object, prepend the existing object
108
-
109
-
110
- if (Array.isArray(value) && isObject(value[0]) && isObject(merged)) {
111
- return [merged, ...value];
112
- } // Override arrays (for example for font-families, box-shadows, ...)
113
-
114
-
115
- if (Array.isArray(value)) {
116
- return value;
117
- } // Execute default behaviour
118
-
119
-
120
- return undefined;
121
- }
122
-
123
- function mergeExtensions({
124
- extend,
125
- ...theme
126
- }) {
127
- return mergeWith(theme, extend, (themeValue, extensions) => {
128
- // The `extend` property is an array, so we need to check if it contains any functions
129
- if (!isFunction(themeValue) && !extensions.some(isFunction)) {
130
- return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
131
- }
132
-
133
- return (resolveThemePath, utils) => mergeWith({}, ...[themeValue, ...extensions].map(e => value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
134
- });
135
- }
136
-
137
- function resolveFunctionKeys(object) {
138
- const resolvePath = (key, defaultValue) => {
139
- const path = (0, _toPath.toPath)(key);
140
- let index = 0;
141
- let val = object;
142
-
143
- while (val !== undefined && val !== null && index < path.length) {
144
- val = val[path[index++]];
145
- val = isFunction(val) ? val(resolvePath, configUtils) : val;
146
- }
147
-
148
- return val === undefined ? defaultValue : val;
149
- };
150
-
151
- resolvePath.theme = resolvePath;
152
-
153
- for (let key in configUtils) {
154
- resolvePath[key] = configUtils[key];
155
- }
156
-
157
- return Object.keys(object).reduce((resolved, key) => {
158
- return { ...resolved,
159
- [key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key]
160
- };
161
- }, {});
162
- }
163
-
164
- function extractPluginConfigs(configs) {
165
- let allConfigs = [];
166
- configs.forEach(config => {
167
- var _config$plugins;
168
-
169
- allConfigs = [...allConfigs, config];
170
- const plugins = (_config$plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config$plugins !== void 0 ? _config$plugins : [];
171
-
172
- if (plugins.length === 0) {
173
- return;
174
- }
175
-
176
- plugins.forEach(plugin => {
177
- var _plugin$config, _plugin;
178
-
179
- if (plugin.__isOptionsFunction) {
180
- plugin = plugin();
181
- }
182
-
183
- allConfigs = [...allConfigs, ...extractPluginConfigs([(_plugin$config = (_plugin = plugin) === null || _plugin === void 0 ? void 0 : _plugin.config) !== null && _plugin$config !== void 0 ? _plugin$config : {}])];
184
- });
185
- });
186
- return allConfigs;
187
- }
188
-
189
- function resolveCorePlugins(corePluginConfigs) {
190
- const result = [...corePluginConfigs].reduceRight((resolved, corePluginConfig) => {
191
- if (isFunction(corePluginConfig)) {
192
- return corePluginConfig({
193
- corePlugins: resolved
194
- });
195
- }
196
-
197
- return (0, _configurePlugins.default)(corePluginConfig, resolved);
198
- }, _corePluginList.default);
199
- return result;
200
- }
201
-
202
- function resolvePluginLists(pluginLists) {
203
- const result = [...pluginLists].reduceRight((resolved, pluginList) => {
204
- return [...resolved, ...pluginList];
205
- }, []);
206
- return result;
207
- }
208
-
209
- function resolveConfig(configs) {
210
- let allConfigs = [...extractPluginConfigs(configs), {
211
- prefix: '',
212
- important: false,
213
- separator: ':',
214
- variantOrder: _defaultConfig.default.variantOrder
215
- }];
216
- return normalizeConfig((0, _defaults.defaults)({
217
- theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map(t => {
218
- var _t$theme;
219
-
220
- return (_t$theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t$theme !== void 0 ? _t$theme : {};
221
- })))),
222
- corePlugins: resolveCorePlugins(allConfigs.map(c => c.corePlugins)),
223
- plugins: resolvePluginLists(configs.map(c => {
224
- var _c$plugins;
225
-
226
- return (_c$plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c$plugins !== void 0 ? _c$plugins : [];
227
- }))
228
- }, ...allConfigs));
229
- }
230
-
231
- let warnedAbout = new Set();
232
-
233
- function normalizeConfig(config) {
234
- var _config$content, _config$purge, _config$content2, _config$purge2, _config$content3, _config$purge3;
235
-
236
- if (!warnedAbout.has('purge-deprecation') && config.hasOwnProperty('purge')) {
237
- _log.default.warn(['The `purge` option in your tailwind.config.js file has been deprecated.', 'Please rename this to `content` instead.']);
238
-
239
- warnedAbout.add('purge-deprecation');
240
- }
241
-
242
- config.content = {
243
- content: (() => {
244
- let {
245
- content,
246
- purge
247
- } = config;
248
- if (Array.isArray(purge)) return purge;
249
- if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.content)) return purge.content;
250
- if (Array.isArray(content)) return content;
251
- if (Array.isArray(content === null || content === void 0 ? void 0 : content.content)) return content.content;
252
- return [];
253
- })(),
254
- safelist: (() => {
255
- let {
256
- content,
257
- purge
258
- } = config;
259
-
260
- let [safelistKey, safelistPaths] = (() => {
261
- var _purge$options;
262
-
263
- if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return ['content.safelist', content.safelist];
264
- if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return ['purge.safelist', purge.safelist];
265
- 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', purge.options.safelist];
266
- return [null, []];
267
- })();
268
-
269
- return safelistPaths.map(content => {
270
- if (typeof content === 'string') {
271
- return {
272
- raw: content,
273
- extension: 'html'
274
- };
275
- }
276
-
277
- if (content instanceof RegExp) {
278
- throw new Error(`Values inside '${safelistKey}' can only be of type 'string', found 'regex'.`);
279
- }
280
-
281
- throw new Error(`Values inside '${safelistKey}' can only be of type 'string', found '${typeof content}'.`);
282
- });
283
- })(),
284
- extract: ((_config$content = config.content) === null || _config$content === void 0 ? void 0 : _config$content.extract) || ((_config$purge = config.purge) === null || _config$purge === void 0 ? void 0 : _config$purge.extract) || {},
285
- options: ((_config$content2 = config.content) === null || _config$content2 === void 0 ? void 0 : _config$content2.options) || ((_config$purge2 = config.purge) === null || _config$purge2 === void 0 ? void 0 : _config$purge2.options) || {},
286
- transform: ((_config$content3 = config.content) === null || _config$content3 === void 0 ? void 0 : _config$content3.transform) || ((_config$purge3 = config.purge) === null || _config$purge3 === void 0 ? void 0 : _config$purge3.transform) || {}
287
- };
288
- return config;
289
- }
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = resolveConfigPath;
7
-
8
- var _fs = _interopRequireDefault(require("fs"));
9
-
10
- var _path = _interopRequireDefault(require("path"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function isObject(value) {
15
- return typeof value === 'object' && value !== null;
16
- }
17
-
18
- function isEmpty(obj) {
19
- return Object.keys(obj).length === 0;
20
- }
21
-
22
- function isString(value) {
23
- return typeof value === 'string' || value instanceof String;
24
- }
25
-
26
- function resolveConfigPath(pathOrConfig) {
27
- // require('tailwindcss')({ theme: ..., variants: ... })
28
- if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
29
- return null;
30
- } // require('tailwindcss')({ config: 'custom-config.js' })
31
-
32
-
33
- if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isString(pathOrConfig.config)) {
34
- return _path.default.resolve(pathOrConfig.config);
35
- } // require('tailwindcss')({ config: { theme: ..., variants: ... } })
36
-
37
-
38
- if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isObject(pathOrConfig.config)) {
39
- return null;
40
- } // require('tailwindcss')('custom-config.js')
41
-
42
-
43
- if (isString(pathOrConfig)) {
44
- return _path.default.resolve(pathOrConfig);
45
- } // require('tailwindcss')
46
-
47
-
48
- for (const configFile of ['./tailwind.config.js', './tailwind.config.cjs']) {
49
- try {
50
- const configPath = _path.default.resolve(configFile);
51
-
52
- _fs.default.accessSync(configPath);
53
-
54
- return configPath;
55
- } catch (err) {}
56
- }
57
-
58
- return null;
59
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = responsive;
7
-
8
- var _postcss = _interopRequireDefault(require("postcss"));
9
-
10
- var _cloneNodes = _interopRequireDefault(require("./cloneNodes"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function responsive(rules) {
15
- return _postcss.default.atRule({
16
- name: 'responsive'
17
- }).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [rules]));
18
- }