tailwindcss 0.0.0-insiders.7c337f2 → 0.0.0-insiders.7d8eb21
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.
- package/CHANGELOG.md +246 -6
- package/README.md +13 -9
- package/defaultTheme.d.ts +2 -1
- package/lib/cli/build/deps.js +54 -0
- package/lib/cli/build/index.js +48 -0
- package/lib/cli/build/plugin.js +362 -0
- package/lib/cli/build/utils.js +78 -0
- package/lib/cli/build/watching.js +178 -0
- package/lib/cli/help/index.js +71 -0
- package/lib/cli/index.js +18 -0
- package/lib/cli/init/index.js +46 -0
- package/lib/cli/shared.js +12 -0
- package/lib/cli-peer-dependencies.js +18 -5
- package/lib/cli.js +62 -592
- package/lib/constants.js +19 -12
- package/lib/corePluginList.js +5 -3
- package/lib/corePlugins.js +619 -347
- package/lib/css/preflight.css +7 -0
- package/lib/featureFlags.js +34 -22
- package/lib/index.js +16 -9
- package/lib/lib/cacheInvalidation.js +42 -21
- package/lib/lib/collapseAdjacentRules.js +16 -14
- package/lib/lib/collapseDuplicateDeclarations.js +13 -10
- package/lib/lib/content.js +177 -0
- package/lib/lib/defaultExtractor.js +230 -33
- package/lib/lib/detectNesting.js +13 -4
- package/lib/lib/evaluateTailwindFunctions.js +105 -42
- package/lib/lib/expandApplyAtRules.js +151 -92
- package/lib/lib/expandTailwindAtRules.js +134 -149
- package/lib/lib/findAtConfigPath.js +44 -0
- package/lib/lib/generateRules.js +404 -185
- package/lib/lib/getModuleDependencies.js +21 -18
- package/lib/lib/normalizeTailwindDirectives.js +11 -8
- package/lib/lib/offsets.js +285 -0
- package/lib/lib/partitionApplyAtRules.js +14 -11
- package/lib/lib/regex.js +60 -0
- package/lib/lib/remap-bitfield.js +87 -0
- package/lib/lib/resolveDefaultsAtRules.js +97 -79
- package/lib/lib/setupContextUtils.js +567 -242
- package/lib/lib/setupTrackingContext.js +77 -106
- package/lib/lib/sharedState.js +18 -10
- package/lib/lib/substituteScreenAtRules.js +9 -7
- package/lib/postcss-plugins/nesting/index.js +7 -5
- package/lib/postcss-plugins/nesting/plugin.js +10 -8
- package/lib/processTailwindFeatures.js +34 -31
- package/lib/public/colors.js +7 -5
- package/lib/public/create-plugin.js +6 -4
- package/lib/public/default-config.js +7 -5
- package/lib/public/default-theme.js +7 -5
- package/lib/public/resolve-config.js +13 -10
- package/lib/util/bigSign.js +4 -1
- package/lib/util/buildMediaQuery.js +10 -5
- package/lib/util/cloneDeep.js +6 -5
- package/lib/util/cloneNodes.js +9 -2
- package/lib/util/color.js +20 -17
- package/lib/util/configurePlugins.js +5 -2
- package/lib/util/createPlugin.js +6 -5
- package/lib/util/createUtilityPlugin.js +15 -13
- package/lib/util/dataTypes.js +75 -51
- package/lib/util/defaults.js +8 -5
- package/lib/util/escapeClassName.js +13 -10
- package/lib/util/escapeCommas.js +4 -1
- package/lib/util/flattenColorPalette.js +7 -8
- package/lib/util/formatVariantSelector.js +270 -103
- package/lib/util/getAllConfigs.js +34 -15
- package/lib/util/hashConfig.js +10 -7
- package/lib/util/isKeyframeRule.js +4 -1
- package/lib/util/isPlainObject.js +4 -1
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +34 -26
- package/lib/util/log.js +14 -8
- package/lib/util/nameClass.js +19 -8
- package/lib/util/negateValue.js +20 -5
- package/lib/util/normalizeConfig.js +94 -53
- package/lib/util/normalizeScreens.js +115 -4
- package/lib/util/parseAnimationValue.js +43 -41
- package/lib/util/parseBoxShadowValue.js +12 -45
- package/lib/util/parseDependency.js +37 -55
- package/lib/util/parseGlob.js +34 -0
- package/lib/util/parseObjectStyles.js +15 -12
- package/lib/util/pluginUtils.js +146 -42
- package/lib/util/prefixSelector.js +26 -9
- package/lib/util/removeAlphaVariables.js +29 -0
- package/lib/util/resolveConfig.js +104 -105
- package/lib/util/resolveConfigPath.js +20 -17
- package/lib/util/responsive.js +12 -9
- package/lib/util/splitAtTopLevelOnly.js +43 -0
- package/lib/util/tap.js +4 -1
- package/lib/util/toColorValue.js +4 -1
- package/lib/util/toPath.js +18 -2
- package/lib/util/transformThemeValue.js +23 -11
- package/lib/util/validateConfig.js +24 -0
- package/lib/util/validateFormalSyntax.js +24 -0
- package/lib/util/withAlphaVariable.js +32 -24
- package/package.json +32 -29
- package/peers/index.js +6693 -3036
- package/plugin.d.ts +10 -5
- package/resolveConfig.d.ts +12 -0
- package/scripts/generate-types.js +53 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli/build/deps.js +56 -0
- package/src/cli/build/index.js +49 -0
- package/src/cli/build/plugin.js +434 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +227 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +3 -0
- package/src/cli/init/index.js +50 -0
- package/src/cli/shared.js +5 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +46 -659
- package/src/corePlugins.js +346 -79
- package/src/css/preflight.css +7 -0
- package/src/featureFlags.js +12 -2
- package/src/index.js +5 -0
- package/src/lib/content.js +213 -0
- package/src/lib/defaultExtractor.js +202 -35
- package/src/lib/detectNesting.js +9 -1
- package/src/lib/evaluateTailwindFunctions.js +78 -7
- package/src/lib/expandApplyAtRules.js +129 -34
- package/src/lib/expandTailwindAtRules.js +12 -50
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +379 -126
- package/src/lib/offsets.js +351 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/remap-bitfield.js +82 -0
- package/src/lib/resolveDefaultsAtRules.js +53 -36
- package/src/lib/setupContextUtils.js +510 -120
- package/src/lib/setupTrackingContext.js +8 -45
- package/src/lib/sharedState.js +2 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +5 -1
- package/src/util/dataTypes.js +51 -26
- package/src/util/formatVariantSelector.js +317 -101
- package/src/util/getAllConfigs.js +19 -0
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +1 -1
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +10 -2
- package/src/util/normalizeConfig.js +40 -10
- package/src/util/normalizeScreens.js +99 -4
- package/src/util/parseBoxShadowValue.js +3 -50
- package/src/util/parseDependency.js +37 -42
- package/src/util/parseGlob.js +24 -0
- package/src/util/pluginUtils.js +132 -10
- package/src/util/prefixSelector.js +28 -10
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -62
- package/src/util/splitAtTopLevelOnly.js +45 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +13 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +165 -164
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +77 -37
- package/types/generated/default-theme.d.ts +342 -0
- package/types/index.d.ts +7 -1
- package/types.d.ts +0 -1
|
@@ -2,39 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
important: false,
|
|
22
|
-
separator: ":",
|
|
23
|
-
variantOrder: _defaultConfigStub.default.variantOrder
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
var ref, ref1;
|
|
27
|
-
return (0, _normalizeConfig).normalizeConfig((0, _defaults).defaults({
|
|
28
|
-
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
|
29
|
-
return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
|
|
30
|
-
})))),
|
|
31
|
-
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins
|
|
32
|
-
)),
|
|
33
|
-
plugins: resolvePluginLists(configs.map((c)=>{
|
|
34
|
-
return (ref1 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref1 !== void 0 ? ref1 : [];
|
|
35
|
-
}))
|
|
36
|
-
}, ...allConfigs));
|
|
37
|
-
}
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>resolveConfig
|
|
8
|
+
});
|
|
9
|
+
const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
|
|
10
|
+
const _corePluginList = /*#__PURE__*/ _interopRequireDefault(require("../corePluginList"));
|
|
11
|
+
const _configurePlugins = /*#__PURE__*/ _interopRequireDefault(require("./configurePlugins"));
|
|
12
|
+
const _colors = /*#__PURE__*/ _interopRequireDefault(require("../public/colors"));
|
|
13
|
+
const _defaults = require("./defaults");
|
|
14
|
+
const _toPath = require("./toPath");
|
|
15
|
+
const _normalizeConfig = require("./normalizeConfig");
|
|
16
|
+
const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
|
|
17
|
+
const _cloneDeep = require("./cloneDeep");
|
|
18
|
+
const _pluginUtils = require("./pluginUtils");
|
|
19
|
+
const _withAlphaVariable = require("./withAlphaVariable");
|
|
20
|
+
const _toColorValue = /*#__PURE__*/ _interopRequireDefault(require("./toColorValue"));
|
|
38
21
|
function _interopRequireDefault(obj) {
|
|
39
22
|
return obj && obj.__esModule ? obj : {
|
|
40
23
|
default: obj
|
|
@@ -43,17 +26,14 @@ function _interopRequireDefault(obj) {
|
|
|
43
26
|
function isFunction(input) {
|
|
44
27
|
return typeof input === "function";
|
|
45
28
|
}
|
|
46
|
-
function isObject(input) {
|
|
47
|
-
return typeof input === "object" && input !== null;
|
|
48
|
-
}
|
|
49
29
|
function mergeWith(target, ...sources) {
|
|
50
30
|
let customizer = sources.pop();
|
|
51
31
|
for (let source of sources){
|
|
52
32
|
for(let k in source){
|
|
53
33
|
let merged = customizer(target[k], source[k]);
|
|
54
34
|
if (merged === undefined) {
|
|
55
|
-
if (
|
|
56
|
-
target[k] = mergeWith(target[k], source[k], customizer);
|
|
35
|
+
if ((0, _isPlainObject.default)(target[k]) && (0, _isPlainObject.default)(source[k])) {
|
|
36
|
+
target[k] = mergeWith({}, target[k], source[k], customizer);
|
|
57
37
|
} else {
|
|
58
38
|
target[k] = source[k];
|
|
59
39
|
}
|
|
@@ -68,9 +48,8 @@ const configUtils = {
|
|
|
68
48
|
colors: _colors.default,
|
|
69
49
|
negative (scale) {
|
|
70
50
|
// TODO: Log that this function isn't really needed anymore?
|
|
71
|
-
return Object.keys(scale).filter((key)=>scale[key] !== "0"
|
|
72
|
-
|
|
73
|
-
let negativeValue = (0, _negateValue).default(scale[key]);
|
|
51
|
+
return Object.keys(scale).filter((key)=>scale[key] !== "0").reduce((negativeScale, key)=>{
|
|
52
|
+
let negativeValue = (0, _negateValue.default)(scale[key]);
|
|
74
53
|
if (negativeValue !== undefined) {
|
|
75
54
|
negativeScale[`-${key}`] = negativeValue;
|
|
76
55
|
}
|
|
@@ -78,34 +57,10 @@ const configUtils = {
|
|
|
78
57
|
}, {});
|
|
79
58
|
},
|
|
80
59
|
breakpoints (screens) {
|
|
81
|
-
return Object.keys(screens).filter((key)=>typeof screens[key] === "string"
|
|
82
|
-
).reduce((breakpoints, key)=>({
|
|
60
|
+
return Object.keys(screens).filter((key)=>typeof screens[key] === "string").reduce((breakpoints, key)=>({
|
|
83
61
|
...breakpoints,
|
|
84
62
|
[`screen-${key}`]: screens[key]
|
|
85
|
-
})
|
|
86
|
-
, {});
|
|
87
|
-
},
|
|
88
|
-
rgb (property) {
|
|
89
|
-
if (!property.startsWith("--")) {
|
|
90
|
-
throw new Error("The rgb() helper requires a custom property name to be passed as the first argument.");
|
|
91
|
-
}
|
|
92
|
-
return ({ opacityValue })=>{
|
|
93
|
-
if (opacityValue === undefined || opacityValue === 1) {
|
|
94
|
-
return `rgb(var(${property}) / 1.0)`;
|
|
95
|
-
}
|
|
96
|
-
return `rgb(var(${property}) / ${opacityValue})`;
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
hsl (property) {
|
|
100
|
-
if (!property.startsWith("--")) {
|
|
101
|
-
throw new Error("The hsl() helper requires a custom property name to be passed as the first argument.");
|
|
102
|
-
}
|
|
103
|
-
return ({ opacityValue })=>{
|
|
104
|
-
if (opacityValue === undefined || opacityValue === 1) {
|
|
105
|
-
return `hsl(var(${property}) / 1)`;
|
|
106
|
-
}
|
|
107
|
-
return `hsl(var(${property}) / ${opacityValue})`;
|
|
108
|
-
};
|
|
63
|
+
}), {});
|
|
109
64
|
}
|
|
110
65
|
};
|
|
111
66
|
function value(valueToResolve, ...args) {
|
|
@@ -134,28 +89,27 @@ function collectExtends(items) {
|
|
|
134
89
|
}
|
|
135
90
|
function mergeThemes(themes) {
|
|
136
91
|
return {
|
|
137
|
-
...themes.reduce((merged, theme)=>(0, _defaults
|
|
138
|
-
, {}),
|
|
92
|
+
...themes.reduce((merged, theme)=>(0, _defaults.defaults)(merged, theme), {}),
|
|
139
93
|
// In order to resolve n config objects, we combine all of their `extend` properties
|
|
140
94
|
// into arrays instead of objects so they aren't overridden.
|
|
141
95
|
extend: collectExtends(themes)
|
|
142
96
|
};
|
|
143
97
|
}
|
|
144
|
-
function mergeExtensionCustomizer(merged,
|
|
98
|
+
function mergeExtensionCustomizer(merged, value) {
|
|
145
99
|
// When we have an array of objects, we do want to merge it
|
|
146
|
-
if (Array.isArray(merged) &&
|
|
147
|
-
return merged.concat(
|
|
100
|
+
if (Array.isArray(merged) && (0, _isPlainObject.default)(merged[0])) {
|
|
101
|
+
return merged.concat(value);
|
|
148
102
|
}
|
|
149
103
|
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
|
150
|
-
if (Array.isArray(
|
|
104
|
+
if (Array.isArray(value) && (0, _isPlainObject.default)(value[0]) && (0, _isPlainObject.default)(merged)) {
|
|
151
105
|
return [
|
|
152
106
|
merged,
|
|
153
|
-
...
|
|
107
|
+
...value
|
|
154
108
|
];
|
|
155
109
|
}
|
|
156
110
|
// Override arrays (for example for font-families, box-shadows, ...)
|
|
157
|
-
if (Array.isArray(
|
|
158
|
-
return
|
|
111
|
+
if (Array.isArray(value)) {
|
|
112
|
+
return value;
|
|
159
113
|
}
|
|
160
114
|
// Execute default behaviour
|
|
161
115
|
return undefined;
|
|
@@ -169,37 +123,62 @@ function mergeExtensions({ extend , ...theme }) {
|
|
|
169
123
|
return (resolveThemePath, utils)=>mergeWith({}, ...[
|
|
170
124
|
themeValue,
|
|
171
125
|
...extensions
|
|
172
|
-
].map((e)=>value(e, resolveThemePath, utils)
|
|
173
|
-
), mergeExtensionCustomizer)
|
|
174
|
-
;
|
|
126
|
+
].map((e)=>value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
|
|
175
127
|
});
|
|
176
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param {string} key
|
|
132
|
+
* @return {Iterable<string[] & {alpha: string | undefined}>}
|
|
133
|
+
*/ function* toPaths(key) {
|
|
134
|
+
let path = (0, _toPath.toPath)(key);
|
|
135
|
+
if (path.length === 0) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
yield path;
|
|
139
|
+
if (Array.isArray(key)) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
let pattern = /^(.*?)\s*\/\s*([^/]+)$/;
|
|
143
|
+
let matches = key.match(pattern);
|
|
144
|
+
if (matches !== null) {
|
|
145
|
+
let [, prefix, alpha] = matches;
|
|
146
|
+
let newPath = (0, _toPath.toPath)(prefix);
|
|
147
|
+
newPath.alpha = alpha;
|
|
148
|
+
yield newPath;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
177
151
|
function resolveFunctionKeys(object) {
|
|
152
|
+
// theme('colors.red.500 / 0.5') -> ['colors', 'red', '500 / 0', '5]
|
|
178
153
|
const resolvePath = (key, defaultValue)=>{
|
|
179
|
-
const path
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
154
|
+
for (const path of toPaths(key)){
|
|
155
|
+
let index = 0;
|
|
156
|
+
let val = object;
|
|
157
|
+
while(val !== undefined && val !== null && index < path.length){
|
|
158
|
+
val = val[path[index++]];
|
|
159
|
+
let shouldResolveAsFn = isFunction(val) && (path.alpha === undefined || index <= path.length - 1);
|
|
160
|
+
val = shouldResolveAsFn ? val(resolvePath, configUtils) : val;
|
|
161
|
+
}
|
|
162
|
+
if (val !== undefined) {
|
|
163
|
+
if (path.alpha !== undefined) {
|
|
164
|
+
let normalized = (0, _pluginUtils.parseColorFormat)(val);
|
|
165
|
+
return (0, _withAlphaVariable.withAlphaValue)(normalized, path.alpha, (0, _toColorValue.default)(normalized));
|
|
166
|
+
}
|
|
167
|
+
if ((0, _isPlainObject.default)(val)) {
|
|
168
|
+
return (0, _cloneDeep.cloneDeep)(val);
|
|
169
|
+
}
|
|
170
|
+
return val;
|
|
171
|
+
}
|
|
191
172
|
}
|
|
192
|
-
return
|
|
173
|
+
return defaultValue;
|
|
193
174
|
};
|
|
194
|
-
resolvePath
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
175
|
+
Object.assign(resolvePath, {
|
|
176
|
+
theme: resolvePath,
|
|
177
|
+
...configUtils
|
|
178
|
+
});
|
|
198
179
|
return Object.keys(object).reduce((resolved, key)=>{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
[key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key]
|
|
202
|
-
};
|
|
180
|
+
resolved[key] = isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key];
|
|
181
|
+
return resolved;
|
|
203
182
|
}, {});
|
|
204
183
|
}
|
|
205
184
|
function extractPluginConfigs(configs) {
|
|
@@ -209,8 +188,8 @@ function extractPluginConfigs(configs) {
|
|
|
209
188
|
...allConfigs,
|
|
210
189
|
config
|
|
211
190
|
];
|
|
212
|
-
var
|
|
213
|
-
const plugins = (
|
|
191
|
+
var _config_plugins;
|
|
192
|
+
const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
|
|
214
193
|
if (plugins.length === 0) {
|
|
215
194
|
return;
|
|
216
195
|
}
|
|
@@ -218,11 +197,11 @@ function extractPluginConfigs(configs) {
|
|
|
218
197
|
if (plugin.__isOptionsFunction) {
|
|
219
198
|
plugin = plugin();
|
|
220
199
|
}
|
|
221
|
-
var
|
|
200
|
+
var _plugin_config;
|
|
222
201
|
allConfigs = [
|
|
223
202
|
...allConfigs,
|
|
224
203
|
...extractPluginConfigs([
|
|
225
|
-
(
|
|
204
|
+
(_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
|
|
226
205
|
])
|
|
227
206
|
];
|
|
228
207
|
});
|
|
@@ -238,7 +217,7 @@ function resolveCorePlugins(corePluginConfigs) {
|
|
|
238
217
|
corePlugins: resolved
|
|
239
218
|
});
|
|
240
219
|
}
|
|
241
|
-
return (0, _configurePlugins
|
|
220
|
+
return (0, _configurePlugins.default)(corePluginConfig, resolved);
|
|
242
221
|
}, _corePluginList.default);
|
|
243
222
|
return result;
|
|
244
223
|
}
|
|
@@ -253,3 +232,23 @@ function resolvePluginLists(pluginLists) {
|
|
|
253
232
|
}, []);
|
|
254
233
|
return result;
|
|
255
234
|
}
|
|
235
|
+
function resolveConfig(configs) {
|
|
236
|
+
let allConfigs = [
|
|
237
|
+
...extractPluginConfigs(configs),
|
|
238
|
+
{
|
|
239
|
+
prefix: "",
|
|
240
|
+
important: false,
|
|
241
|
+
separator: ":"
|
|
242
|
+
}
|
|
243
|
+
];
|
|
244
|
+
var _t_theme, _c_plugins;
|
|
245
|
+
return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
|
|
246
|
+
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
|
247
|
+
return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
|
|
248
|
+
})))),
|
|
249
|
+
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
|
|
250
|
+
plugins: resolvePluginLists(configs.map((c)=>{
|
|
251
|
+
return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
|
|
252
|
+
}))
|
|
253
|
+
}, ...allConfigs));
|
|
254
|
+
}
|
|
@@ -2,9 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>resolveConfigPath
|
|
8
|
+
});
|
|
9
|
+
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
10
|
+
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function isObject(value) {
|
|
17
|
+
return typeof value === "object" && value !== null;
|
|
18
|
+
}
|
|
19
|
+
function isEmpty(obj) {
|
|
20
|
+
return Object.keys(obj).length === 0;
|
|
21
|
+
}
|
|
22
|
+
function isString(value) {
|
|
23
|
+
return typeof value === "string" || value instanceof String;
|
|
24
|
+
}
|
|
8
25
|
function resolveConfigPath(pathOrConfig) {
|
|
9
26
|
// require('tailwindcss')({ theme: ..., variants: ... })
|
|
10
27
|
if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
|
|
@@ -35,17 +52,3 @@ function resolveConfigPath(pathOrConfig) {
|
|
|
35
52
|
}
|
|
36
53
|
return null;
|
|
37
54
|
}
|
|
38
|
-
function _interopRequireDefault(obj) {
|
|
39
|
-
return obj && obj.__esModule ? obj : {
|
|
40
|
-
default: obj
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function isObject(value) {
|
|
44
|
-
return typeof value === "object" && value !== null;
|
|
45
|
-
}
|
|
46
|
-
function isEmpty(obj) {
|
|
47
|
-
return Object.keys(obj).length === 0;
|
|
48
|
-
}
|
|
49
|
-
function isString(value) {
|
|
50
|
-
return typeof value === "string" || value instanceof String;
|
|
51
|
-
}
|
package/lib/util/responsive.js
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>responsive
|
|
8
|
+
});
|
|
9
|
+
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
|
10
|
+
const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("./cloneNodes"));
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
8
16
|
function responsive(rules) {
|
|
9
17
|
return _postcss.default.atRule({
|
|
10
18
|
name: "responsive"
|
|
11
|
-
}).append((0, _cloneNodes
|
|
19
|
+
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [
|
|
12
20
|
rules
|
|
13
21
|
]));
|
|
14
22
|
}
|
|
15
|
-
function _interopRequireDefault(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This splits a string on a top-level character.
|
|
3
|
+
*
|
|
4
|
+
* Regex doesn't support recursion (at least not the JS-flavored version).
|
|
5
|
+
* So we have to use a tiny state machine to keep track of paren placement.
|
|
6
|
+
*
|
|
7
|
+
* Expected behavior using commas:
|
|
8
|
+
* var(--a, 0 0 1px rgb(0, 0, 0)), 0 0 1px rgb(0, 0, 0)
|
|
9
|
+
* ─┬─ ┬ ┬ ┬
|
|
10
|
+
* x x x ╰──────── Split because top-level
|
|
11
|
+
* ╰──────────────┴──┴───────────── Ignored b/c inside >= 1 levels of parens
|
|
12
|
+
*
|
|
13
|
+
* @param {string} input
|
|
14
|
+
* @param {string} separator
|
|
15
|
+
*/ "use strict";
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "splitAtTopLevelOnly", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: ()=>splitAtTopLevelOnly
|
|
22
|
+
});
|
|
23
|
+
function splitAtTopLevelOnly(input, separator) {
|
|
24
|
+
let stack = [];
|
|
25
|
+
let parts = [];
|
|
26
|
+
let lastPos = 0;
|
|
27
|
+
for(let idx = 0; idx < input.length; idx++){
|
|
28
|
+
let char = input[idx];
|
|
29
|
+
if (stack.length === 0 && char === separator[0]) {
|
|
30
|
+
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
|
31
|
+
parts.push(input.slice(lastPos, idx));
|
|
32
|
+
lastPos = idx + separator.length;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (char === "(" || char === "[" || char === "{") {
|
|
36
|
+
stack.push(char);
|
|
37
|
+
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|
|
38
|
+
stack.pop();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
parts.push(input.slice(lastPos));
|
|
42
|
+
return parts;
|
|
43
|
+
}
|
package/lib/util/tap.js
CHANGED
package/lib/util/toColorValue.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>toColorValue
|
|
8
|
+
});
|
|
6
9
|
function toColorValue(maybeFunction) {
|
|
7
10
|
return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
|
|
8
11
|
}
|
package/lib/util/toPath.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Parse a path string into an array of path segments.
|
|
3
|
+
*
|
|
4
|
+
* Square bracket notation `a[b]` may be used to "escape" dots that would otherwise be interpreted as path separators.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* a -> ['a']
|
|
8
|
+
* a.b.c -> ['a', 'b', 'c']
|
|
9
|
+
* a[b].c -> ['a', 'b', 'c']
|
|
10
|
+
* a[b.c].e.f -> ['a', 'b.c', 'e', 'f']
|
|
11
|
+
* a[b][c][d] -> ['a', 'b', 'c', 'd']
|
|
12
|
+
*
|
|
13
|
+
* @param {string|string[]} path
|
|
14
|
+
**/ "use strict";
|
|
2
15
|
Object.defineProperty(exports, "__esModule", {
|
|
3
16
|
value: true
|
|
4
17
|
});
|
|
5
|
-
exports
|
|
18
|
+
Object.defineProperty(exports, "toPath", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: ()=>toPath
|
|
21
|
+
});
|
|
6
22
|
function toPath(path) {
|
|
7
23
|
if (Array.isArray(path)) return path;
|
|
8
24
|
let openBrackets = path.split("[").length - 1;
|
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>transformThemeValue
|
|
8
|
+
});
|
|
9
|
+
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
|
10
|
+
const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
7
16
|
function transformThemeValue(themeSection) {
|
|
8
17
|
if ([
|
|
9
18
|
"fontSize",
|
|
@@ -15,8 +24,14 @@ function transformThemeValue(themeSection) {
|
|
|
15
24
|
return value;
|
|
16
25
|
};
|
|
17
26
|
}
|
|
27
|
+
if (themeSection === "fontFamily") {
|
|
28
|
+
return (value)=>{
|
|
29
|
+
if (typeof value === "function") value = value({});
|
|
30
|
+
let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
|
|
31
|
+
return Array.isArray(families) ? families.join(", ") : families;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
18
34
|
if ([
|
|
19
|
-
"fontFamily",
|
|
20
35
|
"boxShadow",
|
|
21
36
|
"transitionProperty",
|
|
22
37
|
"transitionDuration",
|
|
@@ -26,7 +41,7 @@ function transformThemeValue(themeSection) {
|
|
|
26
41
|
"backgroundSize",
|
|
27
42
|
"backgroundColor",
|
|
28
43
|
"cursor",
|
|
29
|
-
"animation"
|
|
44
|
+
"animation"
|
|
30
45
|
].includes(themeSection)) {
|
|
31
46
|
return (value)=>{
|
|
32
47
|
if (typeof value === "function") value = value({});
|
|
@@ -47,13 +62,10 @@ function transformThemeValue(themeSection) {
|
|
|
47
62
|
return value;
|
|
48
63
|
};
|
|
49
64
|
}
|
|
50
|
-
return (value)=>{
|
|
51
|
-
if (typeof value === "function")
|
|
65
|
+
return (value, opts = {})=>{
|
|
66
|
+
if (typeof value === "function") {
|
|
67
|
+
value = value(opts);
|
|
68
|
+
}
|
|
52
69
|
return value;
|
|
53
70
|
};
|
|
54
71
|
}
|
|
55
|
-
function _interopRequireDefault(obj) {
|
|
56
|
-
return obj && obj.__esModule ? obj : {
|
|
57
|
-
default: obj
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "validateConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>validateConfig
|
|
8
|
+
});
|
|
9
|
+
const _log = /*#__PURE__*/ _interopRequireDefault(require("./log"));
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function validateConfig(config) {
|
|
16
|
+
if (config.content.files.length === 0) {
|
|
17
|
+
_log.default.warn("content-problems", [
|
|
18
|
+
"The `content` option in your Tailwind CSS configuration is missing or empty.",
|
|
19
|
+
"Configure your content sources or your generated CSS will be missing styles.",
|
|
20
|
+
"https://tailwindcss.com/docs/content-configuration"
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
return config;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "backgroundSize", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>backgroundSize
|
|
8
|
+
});
|
|
9
|
+
const _dataTypes = require("./dataTypes");
|
|
10
|
+
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
11
|
+
function backgroundSize(value) {
|
|
12
|
+
let keywordValues = [
|
|
13
|
+
"cover",
|
|
14
|
+
"contain"
|
|
15
|
+
];
|
|
16
|
+
// the <length-percentage> type will probably be a css function
|
|
17
|
+
// so we have to use `splitAtTopLevelOnly`
|
|
18
|
+
return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
|
19
|
+
let sizes = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(part, "_").filter(Boolean);
|
|
20
|
+
if (sizes.length === 1 && keywordValues.includes(sizes[0])) return true;
|
|
21
|
+
if (sizes.length !== 1 && sizes.length !== 2) return false;
|
|
22
|
+
return sizes.every((size)=>(0, _dataTypes.length)(size) || (0, _dataTypes.percentage)(size) || size === "auto");
|
|
23
|
+
});
|
|
24
|
+
}
|