tailwindcss 0.0.0-insiders.ea80db2 → 0.0.0-insiders.eae2b7a
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/README.md +13 -9
- package/defaultTheme.d.ts +2 -1
- package/index.css +5 -0
- package/lib/cli/build/index.js +57 -0
- package/lib/cli/build/plugin.js +427 -0
- package/lib/cli/build/utils.js +88 -0
- package/lib/cli/build/watching.js +182 -0
- package/lib/cli/help/index.js +73 -0
- package/lib/cli/index.js +231 -0
- package/lib/cli/init/index.js +63 -0
- package/lib/cli.js +1 -759
- package/lib/corePluginList.js +12 -3
- package/lib/corePlugins.js +2308 -1739
- package/lib/css/preflight.css +13 -5
- package/lib/featureFlags.js +50 -25
- package/lib/index.js +1 -40
- package/lib/lib/cacheInvalidation.js +48 -25
- package/lib/lib/collapseAdjacentRules.js +17 -10
- package/lib/lib/collapseDuplicateDeclarations.js +13 -8
- package/lib/lib/content.js +207 -0
- package/lib/lib/defaultExtractor.js +232 -33
- package/lib/lib/detectNesting.js +21 -10
- package/lib/lib/evaluateTailwindFunctions.js +117 -50
- package/lib/lib/expandApplyAtRules.js +316 -215
- package/lib/lib/expandTailwindAtRules.js +167 -115
- package/lib/lib/findAtConfigPath.js +46 -0
- package/lib/lib/generateRules.js +444 -211
- package/lib/lib/getModuleDependencies.js +88 -37
- package/lib/lib/handleImportAtRules.js +50 -0
- package/lib/lib/load-config.js +42 -0
- package/lib/lib/normalizeTailwindDirectives.js +29 -39
- package/lib/lib/offsets.js +306 -0
- package/lib/lib/partitionApplyAtRules.js +13 -8
- package/lib/lib/regex.js +74 -0
- package/lib/lib/remap-bitfield.js +89 -0
- package/lib/lib/resolveDefaultsAtRules.js +96 -74
- package/lib/lib/setupContextUtils.js +672 -300
- package/lib/lib/setupTrackingContext.js +63 -68
- package/lib/lib/sharedState.js +44 -17
- package/lib/lib/substituteScreenAtRules.js +14 -10
- package/lib/plugin.js +160 -0
- package/lib/postcss-plugins/nesting/README.md +2 -2
- package/lib/postcss-plugins/nesting/index.js +10 -6
- package/lib/postcss-plugins/nesting/plugin.js +24 -20
- package/lib/processTailwindFeatures.js +34 -29
- package/lib/public/colors.js +272 -246
- package/lib/public/create-plugin.js +9 -5
- package/lib/public/default-config.js +10 -6
- package/lib/public/default-theme.js +10 -6
- package/lib/public/load-config.js +12 -0
- package/lib/public/resolve-config.js +11 -6
- package/lib/util/applyImportantSelector.js +36 -0
- package/lib/util/bigSign.js +6 -1
- package/lib/util/buildMediaQuery.js +13 -6
- package/lib/util/cloneDeep.js +9 -6
- package/lib/util/cloneNodes.js +12 -3
- package/lib/util/color.js +66 -50
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +7 -2
- package/lib/util/createPlugin.js +8 -5
- package/lib/util/createUtilityPlugin.js +13 -9
- package/lib/util/dataTypes.js +182 -111
- package/lib/util/defaults.js +12 -7
- package/lib/util/escapeClassName.js +13 -8
- package/lib/util/escapeCommas.js +7 -2
- package/lib/util/flattenColorPalette.js +11 -10
- package/lib/util/formatVariantSelector.js +228 -151
- package/lib/util/getAllConfigs.js +33 -12
- package/lib/util/hashConfig.js +9 -4
- package/lib/util/isKeyframeRule.js +7 -2
- package/lib/util/isPlainObject.js +7 -2
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
- package/lib/util/log.js +40 -13
- package/lib/util/nameClass.js +27 -10
- package/lib/util/negateValue.js +25 -8
- package/lib/util/normalizeConfig.js +155 -87
- package/lib/util/normalizeScreens.js +127 -8
- package/lib/util/parseAnimationValue.js +44 -40
- package/lib/util/parseBoxShadowValue.js +33 -62
- package/lib/util/parseDependency.js +39 -55
- package/lib/util/parseGlob.js +36 -0
- package/lib/util/parseObjectStyles.js +15 -10
- package/lib/util/pluginUtils.js +154 -59
- package/lib/util/prefixSelector.js +29 -10
- package/lib/util/pseudoElements.js +209 -0
- package/lib/util/removeAlphaVariables.js +31 -0
- package/lib/util/resolveConfig.js +96 -95
- package/lib/util/resolveConfigPath.js +29 -10
- package/lib/util/responsive.js +11 -6
- package/lib/util/splitAtTopLevelOnly.js +51 -0
- package/lib/util/tap.js +6 -1
- package/lib/util/toColorValue.js +7 -2
- package/lib/util/toPath.js +22 -4
- package/lib/util/transformThemeValue.js +40 -26
- package/lib/util/validateConfig.js +48 -0
- package/lib/util/validateFormalSyntax.js +26 -0
- package/lib/util/withAlphaVariable.js +27 -15
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/package.json +54 -52
- 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/index.js +53 -0
- package/src/cli/build/plugin.js +465 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +229 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +217 -0
- package/src/cli/init/index.js +79 -0
- package/src/cli.js +1 -836
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +576 -106
- package/src/css/preflight.css +13 -5
- package/src/featureFlags.js +17 -3
- package/src/index.js +1 -42
- package/src/lib/collapseAdjacentRules.js +5 -1
- package/src/lib/content.js +240 -0
- package/src/lib/defaultExtractor.js +202 -35
- package/src/lib/detectNesting.js +9 -1
- package/src/lib/evaluateTailwindFunctions.js +82 -8
- package/src/lib/expandApplyAtRules.js +322 -189
- package/src/lib/expandTailwindAtRules.js +82 -59
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +413 -132
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/handleImportAtRules.js +34 -0
- package/src/lib/load-config.ts +31 -0
- package/src/lib/normalizeTailwindDirectives.js +0 -27
- package/src/lib/offsets.js +373 -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 +570 -151
- package/src/lib/setupTrackingContext.js +44 -58
- package/src/lib/sharedState.js +13 -4
- package/src/plugin.js +128 -0
- package/src/postcss-plugins/nesting/README.md +2 -2
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +27 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +5 -1
- package/src/util/color.js +34 -17
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +67 -23
- package/src/util/formatVariantSelector.js +264 -144
- package/src/util/getAllConfigs.js +21 -2
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +25 -1
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +78 -20
- 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 +118 -23
- package/src/util/prefixSelector.js +28 -10
- package/src/util/pseudoElements.js +167 -0
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -62
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +52 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +36 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +215 -165
- package/stubs/{simpleConfig.stub.js → config.simple.js} +1 -1
- package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -1
- package/stubs/postcss.config.js +5 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +102 -56
- package/types/generated/colors.d.ts +22 -0
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +372 -0
- package/types/index.d.ts +7 -1
- package/CHANGELOG.md +0 -2099
- package/lib/cli-peer-dependencies.js +0 -15
- package/lib/constants.js +0 -37
- package/peers/index.js +0 -75156
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/cli-peer-dependencies.js +0 -9
- package/src/constants.js +0 -17
- package/types.d.ts +0 -1
|
@@ -2,27 +2,31 @@
|
|
|
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
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return resolveConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
|
|
12
|
+
const _corePluginList = /*#__PURE__*/ _interop_require_default(require("../corePluginList"));
|
|
13
|
+
const _configurePlugins = /*#__PURE__*/ _interop_require_default(require("./configurePlugins"));
|
|
14
|
+
const _colors = /*#__PURE__*/ _interop_require_default(require("../public/colors"));
|
|
15
|
+
const _defaults = require("./defaults");
|
|
16
|
+
const _toPath = require("./toPath");
|
|
17
|
+
const _normalizeConfig = require("./normalizeConfig");
|
|
18
|
+
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
|
|
19
|
+
const _cloneDeep = require("./cloneDeep");
|
|
20
|
+
const _pluginUtils = require("./pluginUtils");
|
|
21
|
+
const _withAlphaVariable = require("./withAlphaVariable");
|
|
22
|
+
const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./toColorValue"));
|
|
23
|
+
function _interop_require_default(obj) {
|
|
17
24
|
return obj && obj.__esModule ? obj : {
|
|
18
25
|
default: obj
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
28
|
function isFunction(input) {
|
|
22
|
-
return typeof input ===
|
|
23
|
-
}
|
|
24
|
-
function isObject(input) {
|
|
25
|
-
return typeof input === 'object' && input !== null;
|
|
29
|
+
return typeof input === "function";
|
|
26
30
|
}
|
|
27
31
|
function mergeWith(target, ...sources) {
|
|
28
32
|
let customizer = sources.pop();
|
|
@@ -30,8 +34,8 @@ function mergeWith(target, ...sources) {
|
|
|
30
34
|
for(let k in source){
|
|
31
35
|
let merged = customizer(target[k], source[k]);
|
|
32
36
|
if (merged === undefined) {
|
|
33
|
-
if (
|
|
34
|
-
target[k] = mergeWith(target[k], source[k], customizer);
|
|
37
|
+
if ((0, _isPlainObject.default)(target[k]) && (0, _isPlainObject.default)(source[k])) {
|
|
38
|
+
target[k] = mergeWith({}, target[k], source[k], customizer);
|
|
35
39
|
} else {
|
|
36
40
|
target[k] = source[k];
|
|
37
41
|
}
|
|
@@ -46,9 +50,8 @@ const configUtils = {
|
|
|
46
50
|
colors: _colors.default,
|
|
47
51
|
negative (scale) {
|
|
48
52
|
// TODO: Log that this function isn't really needed anymore?
|
|
49
|
-
return Object.keys(scale).filter((key)=>scale[key] !==
|
|
50
|
-
|
|
51
|
-
let negativeValue = (0, _negateValue).default(scale[key]);
|
|
53
|
+
return Object.keys(scale).filter((key)=>scale[key] !== "0").reduce((negativeScale, key)=>{
|
|
54
|
+
let negativeValue = (0, _negateValue.default)(scale[key]);
|
|
52
55
|
if (negativeValue !== undefined) {
|
|
53
56
|
negativeScale[`-${key}`] = negativeValue;
|
|
54
57
|
}
|
|
@@ -56,34 +59,10 @@ const configUtils = {
|
|
|
56
59
|
}, {});
|
|
57
60
|
},
|
|
58
61
|
breakpoints (screens) {
|
|
59
|
-
return Object.keys(screens).filter((key)=>typeof screens[key] ===
|
|
60
|
-
).reduce((breakpoints, key)=>({
|
|
62
|
+
return Object.keys(screens).filter((key)=>typeof screens[key] === "string").reduce((breakpoints, key)=>({
|
|
61
63
|
...breakpoints,
|
|
62
64
|
[`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
|
-
};
|
|
65
|
+
}), {});
|
|
87
66
|
}
|
|
88
67
|
};
|
|
89
68
|
function value(valueToResolve, ...args) {
|
|
@@ -112,28 +91,27 @@ function collectExtends(items) {
|
|
|
112
91
|
}
|
|
113
92
|
function mergeThemes(themes) {
|
|
114
93
|
return {
|
|
115
|
-
...themes.reduce((merged, theme)=>(0, _defaults
|
|
116
|
-
, {}),
|
|
94
|
+
...themes.reduce((merged, theme)=>(0, _defaults.defaults)(merged, theme), {}),
|
|
117
95
|
// In order to resolve n config objects, we combine all of their `extend` properties
|
|
118
96
|
// into arrays instead of objects so they aren't overridden.
|
|
119
97
|
extend: collectExtends(themes)
|
|
120
98
|
};
|
|
121
99
|
}
|
|
122
|
-
function mergeExtensionCustomizer(merged,
|
|
100
|
+
function mergeExtensionCustomizer(merged, value) {
|
|
123
101
|
// When we have an array of objects, we do want to merge it
|
|
124
|
-
if (Array.isArray(merged) &&
|
|
125
|
-
return merged.concat(
|
|
102
|
+
if (Array.isArray(merged) && (0, _isPlainObject.default)(merged[0])) {
|
|
103
|
+
return merged.concat(value);
|
|
126
104
|
}
|
|
127
105
|
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
|
128
|
-
if (Array.isArray(
|
|
106
|
+
if (Array.isArray(value) && (0, _isPlainObject.default)(value[0]) && (0, _isPlainObject.default)(merged)) {
|
|
129
107
|
return [
|
|
130
108
|
merged,
|
|
131
|
-
...
|
|
109
|
+
...value
|
|
132
110
|
];
|
|
133
111
|
}
|
|
134
112
|
// Override arrays (for example for font-families, box-shadows, ...)
|
|
135
|
-
if (Array.isArray(
|
|
136
|
-
return
|
|
113
|
+
if (Array.isArray(value)) {
|
|
114
|
+
return value;
|
|
137
115
|
}
|
|
138
116
|
// Execute default behaviour
|
|
139
117
|
return undefined;
|
|
@@ -147,37 +125,62 @@ function mergeExtensions({ extend , ...theme }) {
|
|
|
147
125
|
return (resolveThemePath, utils)=>mergeWith({}, ...[
|
|
148
126
|
themeValue,
|
|
149
127
|
...extensions
|
|
150
|
-
].map((e)=>value(e, resolveThemePath, utils)
|
|
151
|
-
), mergeExtensionCustomizer)
|
|
152
|
-
;
|
|
128
|
+
].map((e)=>value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
|
|
153
129
|
});
|
|
154
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @param {string} key
|
|
134
|
+
* @return {Iterable<string[] & {alpha: string | undefined}>}
|
|
135
|
+
*/ function* toPaths(key) {
|
|
136
|
+
let path = (0, _toPath.toPath)(key);
|
|
137
|
+
if (path.length === 0) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
yield path;
|
|
141
|
+
if (Array.isArray(key)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
let pattern = /^(.*?)\s*\/\s*([^/]+)$/;
|
|
145
|
+
let matches = key.match(pattern);
|
|
146
|
+
if (matches !== null) {
|
|
147
|
+
let [, prefix, alpha] = matches;
|
|
148
|
+
let newPath = (0, _toPath.toPath)(prefix);
|
|
149
|
+
newPath.alpha = alpha;
|
|
150
|
+
yield newPath;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
155
153
|
function resolveFunctionKeys(object) {
|
|
154
|
+
// theme('colors.red.500 / 0.5') -> ['colors', 'red', '500 / 0', '5]
|
|
156
155
|
const resolvePath = (key, defaultValue)=>{
|
|
157
|
-
const path
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
for (const path of toPaths(key)){
|
|
157
|
+
let index = 0;
|
|
158
|
+
let val = object;
|
|
159
|
+
while(val !== undefined && val !== null && index < path.length){
|
|
160
|
+
val = val[path[index++]];
|
|
161
|
+
let shouldResolveAsFn = isFunction(val) && (path.alpha === undefined || index <= path.length - 1);
|
|
162
|
+
val = shouldResolveAsFn ? val(resolvePath, configUtils) : val;
|
|
163
|
+
}
|
|
164
|
+
if (val !== undefined) {
|
|
165
|
+
if (path.alpha !== undefined) {
|
|
166
|
+
let normalized = (0, _pluginUtils.parseColorFormat)(val);
|
|
167
|
+
return (0, _withAlphaVariable.withAlphaValue)(normalized, path.alpha, (0, _toColorValue.default)(normalized));
|
|
168
|
+
}
|
|
169
|
+
if ((0, _isPlainObject.default)(val)) {
|
|
170
|
+
return (0, _cloneDeep.cloneDeep)(val);
|
|
171
|
+
}
|
|
172
|
+
return val;
|
|
173
|
+
}
|
|
169
174
|
}
|
|
170
|
-
return
|
|
175
|
+
return defaultValue;
|
|
171
176
|
};
|
|
172
|
-
resolvePath
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
177
|
+
Object.assign(resolvePath, {
|
|
178
|
+
theme: resolvePath,
|
|
179
|
+
...configUtils
|
|
180
|
+
});
|
|
176
181
|
return Object.keys(object).reduce((resolved, key)=>{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
[key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key]
|
|
180
|
-
};
|
|
182
|
+
resolved[key] = isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key];
|
|
183
|
+
return resolved;
|
|
181
184
|
}, {});
|
|
182
185
|
}
|
|
183
186
|
function extractPluginConfigs(configs) {
|
|
@@ -187,8 +190,8 @@ function extractPluginConfigs(configs) {
|
|
|
187
190
|
...allConfigs,
|
|
188
191
|
config
|
|
189
192
|
];
|
|
190
|
-
var
|
|
191
|
-
const plugins = (
|
|
193
|
+
var _config_plugins;
|
|
194
|
+
const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
|
|
192
195
|
if (plugins.length === 0) {
|
|
193
196
|
return;
|
|
194
197
|
}
|
|
@@ -196,11 +199,11 @@ function extractPluginConfigs(configs) {
|
|
|
196
199
|
if (plugin.__isOptionsFunction) {
|
|
197
200
|
plugin = plugin();
|
|
198
201
|
}
|
|
199
|
-
var
|
|
202
|
+
var _plugin_config;
|
|
200
203
|
allConfigs = [
|
|
201
204
|
...allConfigs,
|
|
202
205
|
...extractPluginConfigs([
|
|
203
|
-
(
|
|
206
|
+
(_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
|
|
204
207
|
])
|
|
205
208
|
];
|
|
206
209
|
});
|
|
@@ -216,7 +219,7 @@ function resolveCorePlugins(corePluginConfigs) {
|
|
|
216
219
|
corePlugins: resolved
|
|
217
220
|
});
|
|
218
221
|
}
|
|
219
|
-
return (0, _configurePlugins
|
|
222
|
+
return (0, _configurePlugins.default)(corePluginConfig, resolved);
|
|
220
223
|
}, _corePluginList.default);
|
|
221
224
|
return result;
|
|
222
225
|
}
|
|
@@ -235,21 +238,19 @@ function resolveConfig(configs) {
|
|
|
235
238
|
let allConfigs = [
|
|
236
239
|
...extractPluginConfigs(configs),
|
|
237
240
|
{
|
|
238
|
-
prefix:
|
|
241
|
+
prefix: "",
|
|
239
242
|
important: false,
|
|
240
|
-
separator:
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
+
separator: ":"
|
|
244
|
+
}
|
|
243
245
|
];
|
|
244
|
-
var
|
|
245
|
-
return (0, _normalizeConfig
|
|
246
|
+
var _t_theme, _c_plugins;
|
|
247
|
+
return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
|
|
246
248
|
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
|
247
|
-
return (
|
|
249
|
+
return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
|
|
248
250
|
})))),
|
|
249
|
-
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins
|
|
250
|
-
)),
|
|
251
|
+
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
|
|
251
252
|
plugins: resolvePluginLists(configs.map((c)=>{
|
|
252
|
-
return (
|
|
253
|
+
return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
|
|
253
254
|
}))
|
|
254
255
|
}, ...allConfigs));
|
|
255
256
|
}
|
|
@@ -2,22 +2,41 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
default: function() {
|
|
13
|
+
return resolveConfigPath;
|
|
14
|
+
},
|
|
15
|
+
resolveDefaultConfigPath: function() {
|
|
16
|
+
return resolveDefaultConfigPath;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
20
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
21
|
+
function _interop_require_default(obj) {
|
|
9
22
|
return obj && obj.__esModule ? obj : {
|
|
10
23
|
default: obj
|
|
11
24
|
};
|
|
12
25
|
}
|
|
26
|
+
const defaultConfigFiles = [
|
|
27
|
+
"./tailwind.config.js",
|
|
28
|
+
"./tailwind.config.cjs",
|
|
29
|
+
"./tailwind.config.mjs",
|
|
30
|
+
"./tailwind.config.ts"
|
|
31
|
+
];
|
|
13
32
|
function isObject(value) {
|
|
14
|
-
return typeof value ===
|
|
33
|
+
return typeof value === "object" && value !== null;
|
|
15
34
|
}
|
|
16
35
|
function isEmpty(obj) {
|
|
17
36
|
return Object.keys(obj).length === 0;
|
|
18
37
|
}
|
|
19
38
|
function isString(value) {
|
|
20
|
-
return typeof value ===
|
|
39
|
+
return typeof value === "string" || value instanceof String;
|
|
21
40
|
}
|
|
22
41
|
function resolveConfigPath(pathOrConfig) {
|
|
23
42
|
// require('tailwindcss')({ theme: ..., variants: ... })
|
|
@@ -37,10 +56,10 @@ function resolveConfigPath(pathOrConfig) {
|
|
|
37
56
|
return _path.default.resolve(pathOrConfig);
|
|
38
57
|
}
|
|
39
58
|
// require('tailwindcss')
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
return resolveDefaultConfigPath();
|
|
60
|
+
}
|
|
61
|
+
function resolveDefaultConfigPath() {
|
|
62
|
+
for (const configFile of defaultConfigFiles){
|
|
44
63
|
try {
|
|
45
64
|
const configPath = _path.default.resolve(configFile);
|
|
46
65
|
_fs.default.accessSync(configPath);
|
package/lib/util/responsive.js
CHANGED
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return responsive;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
12
|
+
const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("./cloneNodes"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
9
14
|
return obj && obj.__esModule ? obj : {
|
|
10
15
|
default: obj
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
function responsive(rules) {
|
|
14
19
|
return _postcss.default.atRule({
|
|
15
|
-
name:
|
|
16
|
-
}).append((0, _cloneNodes
|
|
20
|
+
name: "responsive"
|
|
21
|
+
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [
|
|
17
22
|
rules
|
|
18
23
|
]));
|
|
19
24
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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: function() {
|
|
22
|
+
return splitAtTopLevelOnly;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function splitAtTopLevelOnly(input, separator) {
|
|
26
|
+
let stack = [];
|
|
27
|
+
let parts = [];
|
|
28
|
+
let lastPos = 0;
|
|
29
|
+
let isEscaped = false;
|
|
30
|
+
for(let idx = 0; idx < input.length; idx++){
|
|
31
|
+
let char = input[idx];
|
|
32
|
+
if (stack.length === 0 && char === separator[0] && !isEscaped) {
|
|
33
|
+
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
|
34
|
+
parts.push(input.slice(lastPos, idx));
|
|
35
|
+
lastPos = idx + separator.length;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (isEscaped) {
|
|
39
|
+
isEscaped = false;
|
|
40
|
+
} else if (char === "\\") {
|
|
41
|
+
isEscaped = true;
|
|
42
|
+
}
|
|
43
|
+
if (char === "(" || char === "[" || char === "{") {
|
|
44
|
+
stack.push(char);
|
|
45
|
+
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|
|
46
|
+
stack.pop();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
parts.push(input.slice(lastPos));
|
|
50
|
+
return parts;
|
|
51
|
+
}
|
package/lib/util/tap.js
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "tap", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return tap;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
6
11
|
function tap(value, mutator) {
|
|
7
12
|
mutator(value);
|
|
8
13
|
return value;
|
package/lib/util/toColorValue.js
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return toColorValue;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
6
11
|
function toColorValue(maybeFunction) {
|
|
7
|
-
return typeof maybeFunction ===
|
|
12
|
+
return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
|
|
8
13
|
}
|
package/lib/util/toPath.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
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: function() {
|
|
21
|
+
return toPath;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
6
24
|
function toPath(path) {
|
|
7
25
|
if (Array.isArray(path)) return path;
|
|
8
|
-
let openBrackets = path.split(
|
|
9
|
-
let closedBrackets = path.split(
|
|
26
|
+
let openBrackets = path.split("[").length - 1;
|
|
27
|
+
let closedBrackets = path.split("]").length - 1;
|
|
10
28
|
if (openBrackets !== closedBrackets) {
|
|
11
29
|
throw new Error(`Path is invalid. Has unbalanced brackets: ${path}`);
|
|
12
30
|
}
|
|
@@ -2,58 +2,72 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports
|
|
6
|
-
|
|
7
|
-
function
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return transformThemeValue;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
12
|
+
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
8
14
|
return obj && obj.__esModule ? obj : {
|
|
9
15
|
default: obj
|
|
10
16
|
};
|
|
11
17
|
}
|
|
12
18
|
function transformThemeValue(themeSection) {
|
|
13
19
|
if ([
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
"fontSize",
|
|
21
|
+
"outline"
|
|
16
22
|
].includes(themeSection)) {
|
|
17
23
|
return (value)=>{
|
|
18
|
-
if (typeof value ===
|
|
24
|
+
if (typeof value === "function") value = value({});
|
|
19
25
|
if (Array.isArray(value)) value = value[0];
|
|
20
26
|
return value;
|
|
21
27
|
};
|
|
22
28
|
}
|
|
29
|
+
if (themeSection === "fontFamily") {
|
|
30
|
+
return (value)=>{
|
|
31
|
+
if (typeof value === "function") value = value({});
|
|
32
|
+
let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
|
|
33
|
+
return Array.isArray(families) ? families.join(", ") : families;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
23
36
|
if ([
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'animation',
|
|
37
|
+
"boxShadow",
|
|
38
|
+
"transitionProperty",
|
|
39
|
+
"transitionDuration",
|
|
40
|
+
"transitionDelay",
|
|
41
|
+
"transitionTimingFunction",
|
|
42
|
+
"backgroundImage",
|
|
43
|
+
"backgroundSize",
|
|
44
|
+
"backgroundColor",
|
|
45
|
+
"cursor",
|
|
46
|
+
"animation"
|
|
35
47
|
].includes(themeSection)) {
|
|
36
48
|
return (value)=>{
|
|
37
|
-
if (typeof value ===
|
|
38
|
-
if (Array.isArray(value)) value = value.join(
|
|
49
|
+
if (typeof value === "function") value = value({});
|
|
50
|
+
if (Array.isArray(value)) value = value.join(", ");
|
|
39
51
|
return value;
|
|
40
52
|
};
|
|
41
53
|
}
|
|
42
54
|
// For backwards compatibility reasons, before we switched to underscores
|
|
43
55
|
// instead of commas for arbitrary values.
|
|
44
56
|
if ([
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
"gridTemplateColumns",
|
|
58
|
+
"gridTemplateRows",
|
|
59
|
+
"objectPosition"
|
|
48
60
|
].includes(themeSection)) {
|
|
49
61
|
return (value)=>{
|
|
50
|
-
if (typeof value ===
|
|
51
|
-
if (typeof value ===
|
|
62
|
+
if (typeof value === "function") value = value({});
|
|
63
|
+
if (typeof value === "string") value = _postcss.default.list.comma(value).join(" ");
|
|
52
64
|
return value;
|
|
53
65
|
};
|
|
54
66
|
}
|
|
55
|
-
return (value)=>{
|
|
56
|
-
if (typeof value ===
|
|
67
|
+
return (value, opts = {})=>{
|
|
68
|
+
if (typeof value === "function") {
|
|
69
|
+
value = value(opts);
|
|
70
|
+
}
|
|
57
71
|
return value;
|
|
58
72
|
};
|
|
59
73
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "validateConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return validateConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
12
|
+
const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function validateConfig(config) {
|
|
19
|
+
if (config.content.files.length === 0) {
|
|
20
|
+
_log.default.warn("content-problems", [
|
|
21
|
+
"The `content` option in your Tailwind CSS configuration is missing or empty.",
|
|
22
|
+
"Configure your content sources or your generated CSS will be missing styles.",
|
|
23
|
+
"https://tailwindcss.com/docs/content-configuration"
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
if (config.content.files.includes("auto")) {
|
|
27
|
+
_log.default.group("auto-content-experimental", (log)=>{
|
|
28
|
+
log.info([
|
|
29
|
+
_picocolors.default.bold("Automatically detecting Tailwind CSS content sources...")
|
|
30
|
+
]);
|
|
31
|
+
log.warn([
|
|
32
|
+
"Automatic content detection is experimental, and the behavior may change at any time."
|
|
33
|
+
]);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
// Warn if the line-clamp plugin is installed
|
|
37
|
+
try {
|
|
38
|
+
let plugin = require("@tailwindcss/line-clamp");
|
|
39
|
+
if (config.plugins.includes(plugin)) {
|
|
40
|
+
_log.default.warn("line-clamp-in-core", [
|
|
41
|
+
"As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
|
|
42
|
+
"Remove it from the `plugins` array in your configuration to eliminate this warning."
|
|
43
|
+
]);
|
|
44
|
+
config.plugins = config.plugins.filter((p)=>p !== plugin);
|
|
45
|
+
}
|
|
46
|
+
} catch {}
|
|
47
|
+
return config;
|
|
48
|
+
}
|