tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.ca7b10e

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