tailwindcss 0.0.0-insiders.bbafc8e → 0.0.0-insiders.bbc2f3f

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 (198) hide show
  1. package/README.md +16 -13
  2. package/dist/chunk-5C7JPVMO.mjs +10 -0
  3. package/dist/chunk-AZANAYY2.mjs +1 -0
  4. package/dist/chunk-V2K3XTS4.mjs +1 -0
  5. package/dist/colors-b_6i0Oi7.d.ts +295 -0
  6. package/dist/colors.d.mts +295 -0
  7. package/dist/colors.d.ts +5 -0
  8. package/dist/colors.js +1 -0
  9. package/dist/colors.mjs +1 -0
  10. package/dist/default-theme.d.mts +1147 -0
  11. package/dist/default-theme.d.ts +1147 -0
  12. package/dist/default-theme.js +1 -0
  13. package/dist/default-theme.mjs +1 -0
  14. package/dist/flatten-color-palette.d.mts +6 -0
  15. package/dist/flatten-color-palette.d.ts +6 -0
  16. package/dist/flatten-color-palette.js +1 -0
  17. package/dist/flatten-color-palette.mjs +1 -0
  18. package/dist/lib.d.mts +260 -0
  19. package/dist/lib.d.ts +3 -0
  20. package/dist/lib.js +33 -0
  21. package/dist/lib.mjs +24 -0
  22. package/dist/plugin.d.mts +11 -0
  23. package/dist/plugin.d.ts +104 -0
  24. package/dist/plugin.js +1 -0
  25. package/dist/plugin.mjs +1 -0
  26. package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
  27. package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
  28. package/dist/types-B254mqw1.d.mts +98 -0
  29. package/index.css +865 -0
  30. package/package.json +73 -95
  31. package/preflight.css +383 -0
  32. package/theme.css +453 -0
  33. package/CHANGELOG.md +0 -2084
  34. package/base.css +0 -1
  35. package/colors.js +0 -2
  36. package/components.css +0 -1
  37. package/defaultConfig.js +0 -2
  38. package/defaultTheme.js +0 -2
  39. package/lib/cli-peer-dependencies.js +0 -15
  40. package/lib/cli.js +0 -741
  41. package/lib/constants.js +0 -37
  42. package/lib/corePluginList.js +0 -178
  43. package/lib/corePlugins.js +0 -3587
  44. package/lib/css/LICENSE +0 -25
  45. package/lib/css/preflight.css +0 -367
  46. package/lib/featureFlags.js +0 -59
  47. package/lib/index.js +0 -41
  48. package/lib/lib/cacheInvalidation.js +0 -69
  49. package/lib/lib/collapseAdjacentRules.js +0 -54
  50. package/lib/lib/collapseDuplicateDeclarations.js +0 -80
  51. package/lib/lib/defaultExtractor.js +0 -44
  52. package/lib/lib/detectNesting.js +0 -34
  53. package/lib/lib/evaluateTailwindFunctions.js +0 -171
  54. package/lib/lib/expandApplyAtRules.js +0 -433
  55. package/lib/lib/expandTailwindAtRules.js +0 -262
  56. package/lib/lib/generateRules.js +0 -631
  57. package/lib/lib/getModuleDependencies.js +0 -48
  58. package/lib/lib/normalizeTailwindDirectives.js +0 -84
  59. package/lib/lib/partitionApplyAtRules.js +0 -53
  60. package/lib/lib/resolveDefaultsAtRules.js +0 -143
  61. package/lib/lib/setupContextUtils.js +0 -859
  62. package/lib/lib/setupTrackingContext.js +0 -171
  63. package/lib/lib/sharedState.js +0 -52
  64. package/lib/lib/substituteScreenAtRules.js +0 -27
  65. package/lib/postcss-plugins/nesting/README.md +0 -42
  66. package/lib/postcss-plugins/nesting/index.js +0 -17
  67. package/lib/postcss-plugins/nesting/plugin.js +0 -85
  68. package/lib/processTailwindFeatures.js +0 -59
  69. package/lib/public/colors.js +0 -329
  70. package/lib/public/create-plugin.js +0 -13
  71. package/lib/public/default-config.js +0 -14
  72. package/lib/public/default-theme.js +0 -14
  73. package/lib/public/resolve-config.js +0 -19
  74. package/lib/util/bigSign.js +0 -8
  75. package/lib/util/buildMediaQuery.js +0 -20
  76. package/lib/util/cloneDeep.js +0 -19
  77. package/lib/util/cloneNodes.js +0 -25
  78. package/lib/util/color.js +0 -99
  79. package/lib/util/configurePlugins.js +0 -18
  80. package/lib/util/createPlugin.js +0 -29
  81. package/lib/util/createUtilityPlugin.js +0 -49
  82. package/lib/util/dataTypes.js +0 -233
  83. package/lib/util/defaults.js +0 -22
  84. package/lib/util/escapeClassName.js +0 -19
  85. package/lib/util/escapeCommas.js +0 -8
  86. package/lib/util/flattenColorPalette.js +0 -17
  87. package/lib/util/formatVariantSelector.js +0 -186
  88. package/lib/util/getAllConfigs.js +0 -29
  89. package/lib/util/hashConfig.js +0 -16
  90. package/lib/util/isKeyframeRule.js +0 -8
  91. package/lib/util/isPlainObject.js +0 -12
  92. package/lib/util/isValidArbitraryValue.js +0 -64
  93. package/lib/util/log.js +0 -51
  94. package/lib/util/nameClass.js +0 -32
  95. package/lib/util/negateValue.js +0 -19
  96. package/lib/util/normalizeConfig.js +0 -240
  97. package/lib/util/normalizeScreens.js +0 -59
  98. package/lib/util/parseAnimationValue.js +0 -89
  99. package/lib/util/parseBoxShadowValue.js +0 -117
  100. package/lib/util/parseDependency.js +0 -63
  101. package/lib/util/parseObjectStyles.js +0 -31
  102. package/lib/util/pluginUtils.js +0 -179
  103. package/lib/util/prefixSelector.js +0 -20
  104. package/lib/util/resolveConfig.js +0 -255
  105. package/lib/util/resolveConfigPath.js +0 -51
  106. package/lib/util/responsive.js +0 -19
  107. package/lib/util/tap.js +0 -9
  108. package/lib/util/toColorValue.js +0 -8
  109. package/lib/util/toPath.js +0 -14
  110. package/lib/util/transformThemeValue.js +0 -59
  111. package/lib/util/withAlphaVariable.js +0 -67
  112. package/nesting/index.js +0 -2
  113. package/peers/index.js +0 -75077
  114. package/plugin.js +0 -2
  115. package/prettier.config.js +0 -19
  116. package/resolveConfig.js +0 -2
  117. package/screens.css +0 -1
  118. package/scripts/create-plugin-list.js +0 -10
  119. package/scripts/install-integrations.js +0 -27
  120. package/scripts/rebuildFixtures.js +0 -68
  121. package/src/cli-peer-dependencies.js +0 -9
  122. package/src/cli.js +0 -815
  123. package/src/constants.js +0 -17
  124. package/src/corePluginList.js +0 -1
  125. package/src/corePlugins.js +0 -2365
  126. package/src/css/LICENSE +0 -25
  127. package/src/css/preflight.css +0 -367
  128. package/src/featureFlags.js +0 -54
  129. package/src/index.js +0 -42
  130. package/src/lib/cacheInvalidation.js +0 -52
  131. package/src/lib/collapseAdjacentRules.js +0 -54
  132. package/src/lib/collapseDuplicateDeclarations.js +0 -93
  133. package/src/lib/defaultExtractor.js +0 -50
  134. package/src/lib/detectNesting.js +0 -39
  135. package/src/lib/evaluateTailwindFunctions.js +0 -198
  136. package/src/lib/expandApplyAtRules.js +0 -480
  137. package/src/lib/expandTailwindAtRules.js +0 -292
  138. package/src/lib/generateRules.js +0 -623
  139. package/src/lib/getModuleDependencies.js +0 -39
  140. package/src/lib/normalizeTailwindDirectives.js +0 -84
  141. package/src/lib/partitionApplyAtRules.js +0 -52
  142. package/src/lib/resolveDefaultsAtRules.js +0 -146
  143. package/src/lib/setupContextUtils.js +0 -883
  144. package/src/lib/setupTrackingContext.js +0 -183
  145. package/src/lib/sharedState.js +0 -48
  146. package/src/lib/substituteScreenAtRules.js +0 -19
  147. package/src/postcss-plugins/nesting/README.md +0 -42
  148. package/src/postcss-plugins/nesting/index.js +0 -13
  149. package/src/postcss-plugins/nesting/plugin.js +0 -80
  150. package/src/processTailwindFeatures.js +0 -58
  151. package/src/public/colors.js +0 -300
  152. package/src/public/create-plugin.js +0 -2
  153. package/src/public/default-config.js +0 -4
  154. package/src/public/default-theme.js +0 -4
  155. package/src/public/resolve-config.js +0 -7
  156. package/src/util/bigSign.js +0 -3
  157. package/src/util/buildMediaQuery.js +0 -20
  158. package/src/util/cloneDeep.js +0 -11
  159. package/src/util/cloneNodes.js +0 -24
  160. package/src/util/color.js +0 -69
  161. package/src/util/configurePlugins.js +0 -23
  162. package/src/util/createPlugin.js +0 -27
  163. package/src/util/createUtilityPlugin.js +0 -37
  164. package/src/util/dataTypes.js +0 -248
  165. package/src/util/defaults.js +0 -17
  166. package/src/util/escapeClassName.js +0 -8
  167. package/src/util/escapeCommas.js +0 -3
  168. package/src/util/flattenColorPalette.js +0 -13
  169. package/src/util/formatVariantSelector.js +0 -196
  170. package/src/util/getAllConfigs.js +0 -19
  171. package/src/util/hashConfig.js +0 -5
  172. package/src/util/isKeyframeRule.js +0 -3
  173. package/src/util/isPlainObject.js +0 -8
  174. package/src/util/isValidArbitraryValue.js +0 -61
  175. package/src/util/log.js +0 -29
  176. package/src/util/nameClass.js +0 -26
  177. package/src/util/negateValue.js +0 -16
  178. package/src/util/normalizeConfig.js +0 -270
  179. package/src/util/normalizeScreens.js +0 -45
  180. package/src/util/parseAnimationValue.js +0 -68
  181. package/src/util/parseBoxShadowValue.js +0 -119
  182. package/src/util/parseDependency.js +0 -49
  183. package/src/util/parseObjectStyles.js +0 -19
  184. package/src/util/pluginUtils.js +0 -192
  185. package/src/util/prefixSelector.js +0 -14
  186. package/src/util/resolveConfig.js +0 -269
  187. package/src/util/resolveConfigPath.js +0 -55
  188. package/src/util/responsive.js +0 -10
  189. package/src/util/tap.js +0 -4
  190. package/src/util/toColorValue.js +0 -3
  191. package/src/util/toPath.js +0 -26
  192. package/src/util/transformThemeValue.js +0 -52
  193. package/src/util/withAlphaVariable.js +0 -49
  194. package/stubs/defaultConfig.stub.js +0 -950
  195. package/stubs/defaultPostCssConfig.stub.js +0 -6
  196. package/stubs/simpleConfig.stub.js +0 -7
  197. package/tailwind.css +0 -5
  198. package/variants.css +0 -1
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.updateAllClasses = updateAllClasses;
6
- exports.asValue = asValue;
7
- exports.asColor = asColor;
8
- exports.asLookupValue = asLookupValue;
9
- exports.coerceValue = coerceValue;
10
- var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
11
- var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
12
- var _withAlphaVariable = require("./withAlphaVariable");
13
- var _dataTypes = require("./dataTypes");
14
- var _negateValue = _interopRequireDefault(require("./negateValue"));
15
- function _interopRequireDefault(obj) {
16
- return obj && obj.__esModule ? obj : {
17
- default: obj
18
- };
19
- }
20
- function updateAllClasses(selectors1, updateClass) {
21
- let parser = (0, _postcssSelectorParser).default((selectors)=>{
22
- selectors.walkClasses((sel)=>{
23
- let updatedClass = updateClass(sel.value);
24
- sel.value = updatedClass;
25
- if (sel.raws && sel.raws.value) {
26
- sel.raws.value = (0, _escapeCommas).default(sel.raws.value);
27
- }
28
- });
29
- });
30
- let result = parser.processSync(selectors1);
31
- return result;
32
- }
33
- function resolveArbitraryValue(modifier, validate) {
34
- if (!isArbitraryValue(modifier)) {
35
- return undefined;
36
- }
37
- let value = modifier.slice(1, -1);
38
- if (!validate(value)) {
39
- return undefined;
40
- }
41
- return (0, _dataTypes).normalize(value);
42
- }
43
- function asNegativeValue(modifier, lookup = {}, validate) {
44
- let positiveValue = lookup[modifier];
45
- if (positiveValue !== undefined) {
46
- return (0, _negateValue).default(positiveValue);
47
- }
48
- if (isArbitraryValue(modifier)) {
49
- let resolved = resolveArbitraryValue(modifier, validate);
50
- if (resolved === undefined) {
51
- return undefined;
52
- }
53
- return (0, _negateValue).default(resolved);
54
- }
55
- }
56
- function asValue(modifier, options = {}, { validate =()=>true
57
- } = {}) {
58
- var ref;
59
- let value = (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
60
- if (value !== undefined) {
61
- return value;
62
- }
63
- if (options.supportsNegativeValues && modifier.startsWith('-')) {
64
- return asNegativeValue(modifier.slice(1), options.values, validate);
65
- }
66
- return resolveArbitraryValue(modifier, validate);
67
- }
68
- function isArbitraryValue(input) {
69
- return input.startsWith('[') && input.endsWith(']');
70
- }
71
- function splitAlpha(modifier) {
72
- let slashIdx = modifier.lastIndexOf('/');
73
- if (slashIdx === -1 || slashIdx === modifier.length - 1) {
74
- return [
75
- modifier
76
- ];
77
- }
78
- return [
79
- modifier.slice(0, slashIdx),
80
- modifier.slice(slashIdx + 1)
81
- ];
82
- }
83
- function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
84
- var ref;
85
- if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier]) !== undefined) {
86
- var ref1;
87
- return (ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[modifier];
88
- }
89
- let [color, alpha] = splitAlpha(modifier);
90
- if (alpha !== undefined) {
91
- var ref2, ref3, ref4;
92
- var ref5;
93
- 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;
94
- if (normalizedColor === undefined) {
95
- return undefined;
96
- }
97
- if (isArbitraryValue(alpha)) {
98
- return (0, _withAlphaVariable).withAlphaValue(normalizedColor, alpha.slice(1, -1));
99
- }
100
- if (((ref3 = tailwindConfig.theme) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.opacity) === null || ref4 === void 0 ? void 0 : ref4[alpha]) === undefined) {
101
- return undefined;
102
- }
103
- return (0, _withAlphaVariable).withAlphaValue(normalizedColor, tailwindConfig.theme.opacity[alpha]);
104
- }
105
- return asValue(modifier, options, {
106
- validate: _dataTypes.color
107
- });
108
- }
109
- function asLookupValue(modifier, options = {}) {
110
- var ref;
111
- return (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
112
- }
113
- function guess(validate) {
114
- return (modifier, options)=>{
115
- return asValue(modifier, options, {
116
- validate
117
- });
118
- };
119
- }
120
- let typeMap = {
121
- any: asValue,
122
- color: asColor,
123
- url: guess(_dataTypes.url),
124
- image: guess(_dataTypes.image),
125
- length: guess(_dataTypes.length),
126
- percentage: guess(_dataTypes.percentage),
127
- position: guess(_dataTypes.position),
128
- lookup: asLookupValue,
129
- 'generic-name': guess(_dataTypes.genericName),
130
- 'family-name': guess(_dataTypes.familyName),
131
- number: guess(_dataTypes.number),
132
- 'line-width': guess(_dataTypes.lineWidth),
133
- 'absolute-size': guess(_dataTypes.absoluteSize),
134
- 'relative-size': guess(_dataTypes.relativeSize),
135
- shadow: guess(_dataTypes.shadow)
136
- };
137
- let supportedTypes = Object.keys(typeMap);
138
- function splitAtFirst(input, delim) {
139
- let idx = input.indexOf(delim);
140
- if (idx === -1) return [
141
- undefined,
142
- input
143
- ];
144
- return [
145
- input.slice(0, idx),
146
- input.slice(idx + 1)
147
- ];
148
- }
149
- function coerceValue(types, modifier, options, tailwindConfig) {
150
- if (isArbitraryValue(modifier)) {
151
- let arbitraryValue = modifier.slice(1, -1);
152
- let [explicitType, value] = splitAtFirst(arbitraryValue, ':');
153
- // It could be that this resolves to `url(https` which is not a valid
154
- // identifier. We currently only support "simple" words with dashes or
155
- // underscores. E.g.: family-name
156
- if (!/^[\w-_]+$/g.test(explicitType)) {
157
- value = arbitraryValue;
158
- } else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
159
- return [];
160
- }
161
- if (value.length > 0 && supportedTypes.includes(explicitType)) {
162
- return [
163
- asValue(`[${value}]`, options),
164
- explicitType
165
- ];
166
- }
167
- }
168
- // Find first matching type
169
- for (let type of [].concat(types)){
170
- let result = typeMap[type](modifier, options, {
171
- tailwindConfig
172
- });
173
- if (result !== undefined) return [
174
- result,
175
- type
176
- ];
177
- }
178
- return [];
179
- }
@@ -1,20 +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
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- function _default(prefix, selector, prependNegative = false) {
13
- return (0, _postcssSelectorParser).default((selectors)=>{
14
- selectors.walkClasses((classSelector)=>{
15
- let baseClass = classSelector.value;
16
- let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith('-');
17
- classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
18
- });
19
- }).processSync(selector);
20
- }
@@ -1,255 +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 _defaults = require("./defaults");
12
- var _toPath = require("./toPath");
13
- var _normalizeConfig = require("./normalizeConfig");
14
- var _isPlainObject = _interopRequireDefault(require("./isPlainObject"));
15
- var _cloneDeep = require("./cloneDeep");
16
- function _interopRequireDefault(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- function isFunction(input) {
22
- return typeof input === 'function';
23
- }
24
- function isObject(input) {
25
- return typeof input === 'object' && input !== null;
26
- }
27
- function mergeWith(target, ...sources) {
28
- let customizer = sources.pop();
29
- for (let source of sources){
30
- for(let k in source){
31
- let merged = customizer(target[k], source[k]);
32
- if (merged === undefined) {
33
- if (isObject(target[k]) && isObject(source[k])) {
34
- target[k] = mergeWith(target[k], source[k], customizer);
35
- } else {
36
- target[k] = source[k];
37
- }
38
- } else {
39
- target[k] = merged;
40
- }
41
- }
42
- }
43
- return target;
44
- }
45
- const configUtils = {
46
- colors: _colors.default,
47
- negative (scale) {
48
- // TODO: Log that this function isn't really needed anymore?
49
- return Object.keys(scale).filter((key)=>scale[key] !== '0'
50
- ).reduce((negativeScale, key)=>{
51
- let negativeValue = (0, _negateValue).default(scale[key]);
52
- if (negativeValue !== undefined) {
53
- negativeScale[`-${key}`] = negativeValue;
54
- }
55
- return negativeScale;
56
- }, {});
57
- },
58
- breakpoints (screens) {
59
- return Object.keys(screens).filter((key)=>typeof screens[key] === 'string'
60
- ).reduce((breakpoints, key)=>({
61
- ...breakpoints,
62
- [`screen-${key}`]: screens[key]
63
- })
64
- , {});
65
- },
66
- rgb (property) {
67
- if (!property.startsWith('--')) {
68
- throw new Error('The rgb() helper requires a custom property name to be passed as the first argument.');
69
- }
70
- return ({ opacityValue })=>{
71
- if (opacityValue === undefined || opacityValue === 1) {
72
- return `rgb(var(${property}) / 1.0)`;
73
- }
74
- return `rgb(var(${property}) / ${opacityValue})`;
75
- };
76
- },
77
- hsl (property) {
78
- if (!property.startsWith('--')) {
79
- throw new Error('The hsl() helper requires a custom property name to be passed as the first argument.');
80
- }
81
- return ({ opacityValue })=>{
82
- if (opacityValue === undefined || opacityValue === 1) {
83
- return `hsl(var(${property}) / 1)`;
84
- }
85
- return `hsl(var(${property}) / ${opacityValue})`;
86
- };
87
- }
88
- };
89
- function value(valueToResolve, ...args) {
90
- return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
91
- }
92
- function collectExtends(items) {
93
- return items.reduce((merged, { extend })=>{
94
- return mergeWith(merged, extend, (mergedValue, extendValue)=>{
95
- if (mergedValue === undefined) {
96
- return [
97
- extendValue
98
- ];
99
- }
100
- if (Array.isArray(mergedValue)) {
101
- return [
102
- extendValue,
103
- ...mergedValue
104
- ];
105
- }
106
- return [
107
- extendValue,
108
- mergedValue
109
- ];
110
- });
111
- }, {});
112
- }
113
- function mergeThemes(themes) {
114
- return {
115
- ...themes.reduce((merged, theme)=>(0, _defaults).defaults(merged, theme)
116
- , {}),
117
- // In order to resolve n config objects, we combine all of their `extend` properties
118
- // into arrays instead of objects so they aren't overridden.
119
- extend: collectExtends(themes)
120
- };
121
- }
122
- function mergeExtensionCustomizer(merged, value1) {
123
- // When we have an array of objects, we do want to merge it
124
- if (Array.isArray(merged) && isObject(merged[0])) {
125
- return merged.concat(value1);
126
- }
127
- // When the incoming value is an array, and the existing config is an object, prepend the existing object
128
- if (Array.isArray(value1) && isObject(value1[0]) && isObject(merged)) {
129
- return [
130
- merged,
131
- ...value1
132
- ];
133
- }
134
- // Override arrays (for example for font-families, box-shadows, ...)
135
- if (Array.isArray(value1)) {
136
- return value1;
137
- }
138
- // Execute default behaviour
139
- return undefined;
140
- }
141
- function mergeExtensions({ extend , ...theme }) {
142
- return mergeWith(theme, extend, (themeValue, extensions)=>{
143
- // The `extend` property is an array, so we need to check if it contains any functions
144
- if (!isFunction(themeValue) && !extensions.some(isFunction)) {
145
- return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
146
- }
147
- return (resolveThemePath, utils)=>mergeWith({}, ...[
148
- themeValue,
149
- ...extensions
150
- ].map((e)=>value(e, resolveThemePath, utils)
151
- ), mergeExtensionCustomizer)
152
- ;
153
- });
154
- }
155
- function resolveFunctionKeys(object) {
156
- const resolvePath = (key, defaultValue)=>{
157
- const path = (0, _toPath).toPath(key);
158
- let index = 0;
159
- let val = object;
160
- while(val !== undefined && val !== null && index < path.length){
161
- val = val[path[index++]];
162
- val = isFunction(val) ? val(resolvePath, configUtils) : val;
163
- }
164
- if (val === undefined) {
165
- return defaultValue;
166
- }
167
- if ((0, _isPlainObject).default(val)) {
168
- return (0, _cloneDeep).cloneDeep(val);
169
- }
170
- return val;
171
- };
172
- resolvePath.theme = resolvePath;
173
- for(let key1 in configUtils){
174
- resolvePath[key1] = configUtils[key1];
175
- }
176
- return Object.keys(object).reduce((resolved, key)=>{
177
- return {
178
- ...resolved,
179
- [key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key]
180
- };
181
- }, {});
182
- }
183
- function extractPluginConfigs(configs) {
184
- let allConfigs = [];
185
- configs.forEach((config)=>{
186
- allConfigs = [
187
- ...allConfigs,
188
- config
189
- ];
190
- var ref1;
191
- const plugins = (ref1 = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref1 !== void 0 ? ref1 : [];
192
- if (plugins.length === 0) {
193
- return;
194
- }
195
- plugins.forEach((plugin)=>{
196
- if (plugin.__isOptionsFunction) {
197
- plugin = plugin();
198
- }
199
- var ref;
200
- allConfigs = [
201
- ...allConfigs,
202
- ...extractPluginConfigs([
203
- (ref = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && ref !== void 0 ? ref : {}
204
- ])
205
- ];
206
- });
207
- });
208
- return allConfigs;
209
- }
210
- function resolveCorePlugins(corePluginConfigs) {
211
- const result = [
212
- ...corePluginConfigs
213
- ].reduceRight((resolved, corePluginConfig)=>{
214
- if (isFunction(corePluginConfig)) {
215
- return corePluginConfig({
216
- corePlugins: resolved
217
- });
218
- }
219
- return (0, _configurePlugins).default(corePluginConfig, resolved);
220
- }, _corePluginList.default);
221
- return result;
222
- }
223
- function resolvePluginLists(pluginLists) {
224
- const result = [
225
- ...pluginLists
226
- ].reduceRight((resolved, pluginList)=>{
227
- return [
228
- ...resolved,
229
- ...pluginList
230
- ];
231
- }, []);
232
- return result;
233
- }
234
- function resolveConfig(configs) {
235
- let allConfigs = [
236
- ...extractPluginConfigs(configs),
237
- {
238
- prefix: '',
239
- important: false,
240
- separator: ':',
241
- variantOrder: _defaultConfigStub.default.variantOrder
242
- },
243
- ];
244
- var ref, ref2;
245
- return (0, _normalizeConfig).normalizeConfig((0, _defaults).defaults({
246
- theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
247
- return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
248
- })))),
249
- corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins
250
- )),
251
- plugins: resolvePluginLists(configs.map((c)=>{
252
- return (ref2 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref2 !== void 0 ? ref2 : [];
253
- }))
254
- }, ...allConfigs));
255
- }
@@ -1,51 +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
- return null;
51
- }
@@ -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,8 +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({}) : maybeFunction;
8
- }
@@ -1,14 +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
- let openBrackets = path.split('[').length - 1;
9
- let closedBrackets = path.split(']').length - 1;
10
- if (openBrackets !== closedBrackets) {
11
- throw new Error(`Path is invalid. Has unbalanced brackets: ${path}`);
12
- }
13
- return path.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean);
14
- }
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.default = transformThemeValue;
6
- var _postcss = _interopRequireDefault(require("postcss"));
7
- function _interopRequireDefault(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- function transformThemeValue(themeSection) {
13
- if ([
14
- 'fontSize',
15
- 'outline'
16
- ].includes(themeSection)) {
17
- return (value)=>{
18
- if (typeof value === 'function') value = value({});
19
- if (Array.isArray(value)) value = value[0];
20
- return value;
21
- };
22
- }
23
- if ([
24
- 'fontFamily',
25
- 'boxShadow',
26
- 'transitionProperty',
27
- 'transitionDuration',
28
- 'transitionDelay',
29
- 'transitionTimingFunction',
30
- 'backgroundImage',
31
- 'backgroundSize',
32
- 'backgroundColor',
33
- 'cursor',
34
- 'animation',
35
- ].includes(themeSection)) {
36
- return (value)=>{
37
- if (typeof value === 'function') value = value({});
38
- if (Array.isArray(value)) value = value.join(', ');
39
- return value;
40
- };
41
- }
42
- // For backwards compatibility reasons, before we switched to underscores
43
- // instead of commas for arbitrary values.
44
- if ([
45
- 'gridTemplateColumns',
46
- 'gridTemplateRows',
47
- 'objectPosition'
48
- ].includes(themeSection)) {
49
- return (value)=>{
50
- if (typeof value === 'function') value = value({});
51
- if (typeof value === 'string') value = _postcss.default.list.comma(value).join(' ');
52
- return value;
53
- };
54
- }
55
- return (value)=>{
56
- if (typeof value === 'function') value = value({});
57
- return value;
58
- };
59
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.withAlphaValue = withAlphaValue;
6
- exports.default = withAlphaVariable;
7
- var _color = require("./color");
8
- function withAlphaValue(color, alphaValue, defaultValue) {
9
- if (typeof color === 'function') {
10
- return color({
11
- opacityValue: alphaValue
12
- });
13
- }
14
- let parsed = (0, _color).parseColor(color);
15
- if (parsed === null) {
16
- return defaultValue;
17
- }
18
- return (0, _color).formatColor({
19
- ...parsed,
20
- alpha: alphaValue
21
- });
22
- }
23
- function withAlphaVariable({ color , property , variable }) {
24
- let properties = [].concat(property);
25
- if (typeof color === 'function') {
26
- return {
27
- [variable]: '1',
28
- ...Object.fromEntries(properties.map((p)=>{
29
- return [
30
- p,
31
- color({
32
- opacityVariable: variable,
33
- opacityValue: `var(${variable})`
34
- })
35
- ];
36
- }))
37
- };
38
- }
39
- const parsed = (0, _color).parseColor(color);
40
- if (parsed === null) {
41
- return Object.fromEntries(properties.map((p)=>[
42
- p,
43
- color
44
- ]
45
- ));
46
- }
47
- if (parsed.alpha !== undefined) {
48
- // Has an alpha value, return color as-is
49
- return Object.fromEntries(properties.map((p)=>[
50
- p,
51
- color
52
- ]
53
- ));
54
- }
55
- return {
56
- [variable]: '1',
57
- ...Object.fromEntries(properties.map((p)=>{
58
- return [
59
- p,
60
- (0, _color).formatColor({
61
- ...parsed,
62
- alpha: `var(${variable})`
63
- })
64
- ];
65
- }))
66
- };
67
- }
package/nesting/index.js DELETED
@@ -1,2 +0,0 @@
1
- let nesting = require('../lib/postcss-plugins/nesting')
2
- module.exports = (nesting.__esModule ? nesting : { default: nesting }).default