tailwindcss 3.0.0-alpha.1 → 3.0.0-alpha.2
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 +67 -1
- package/lib/cli.js +66 -62
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +7 -1
- package/lib/corePlugins.js +264 -203
- package/lib/css/preflight.css +12 -0
- package/lib/featureFlags.js +10 -7
- package/lib/lib/collapseDuplicateDeclarations.js +29 -0
- package/lib/lib/evaluateTailwindFunctions.js +3 -3
- package/lib/lib/expandApplyAtRules.js +7 -7
- package/lib/lib/expandTailwindAtRules.js +2 -1
- package/lib/lib/generateRules.js +115 -19
- package/lib/lib/resolveDefaultsAtRules.js +44 -47
- package/lib/lib/setupContextUtils.js +72 -15
- package/lib/lib/setupWatchingContext.js +5 -1
- package/lib/lib/sharedState.js +2 -2
- package/lib/processTailwindFeatures.js +4 -0
- package/lib/util/createUtilityPlugin.js +5 -5
- package/lib/util/dataTypes.js +24 -4
- package/lib/util/formatVariantSelector.js +102 -0
- package/lib/util/nameClass.js +1 -1
- package/lib/util/negateValue.js +3 -1
- package/lib/util/normalizeConfig.js +22 -8
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +62 -158
- package/lib/util/prefixSelector.js +1 -3
- package/lib/util/resolveConfig.js +13 -9
- package/lib/util/transformThemeValue.js +23 -13
- package/package.json +11 -11
- package/peers/index.js +873 -2505
- package/src/cli.js +9 -2
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +282 -348
- package/src/css/preflight.css +12 -0
- package/src/featureFlags.js +10 -4
- package/src/lib/collapseDuplicateDeclarations.js +28 -0
- package/src/lib/expandTailwindAtRules.js +3 -2
- package/src/lib/generateRules.js +121 -11
- package/src/lib/resolveDefaultsAtRules.js +39 -43
- package/src/lib/setupContextUtils.js +71 -9
- package/src/lib/setupWatchingContext.js +7 -0
- package/src/lib/sharedState.js +1 -1
- package/src/processTailwindFeatures.js +5 -0
- package/src/util/createUtilityPlugin.js +2 -2
- package/src/util/dataTypes.js +32 -5
- package/src/util/formatVariantSelector.js +105 -0
- package/src/util/nameClass.js +1 -1
- package/src/util/negateValue.js +4 -2
- package/src/util/normalizeConfig.js +17 -1
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/pluginUtils.js +50 -146
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +7 -1
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +101 -58
- package/peers/.svgo.yml +0 -75
- package/peers/orders/concentric-css.json +0 -299
- package/peers/orders/smacss.json +0 -299
- package/peers/orders/source.json +0 -295
- package/src/.DS_Store +0 -0
package/lib/util/pluginUtils.js
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.applyStateToMarker = applyStateToMarker;
|
|
6
5
|
exports.updateAllClasses = updateAllClasses;
|
|
7
|
-
exports.updateLastClasses = updateLastClasses;
|
|
8
|
-
exports.transformAllSelectors = transformAllSelectors;
|
|
9
|
-
exports.transformAllClasses = transformAllClasses;
|
|
10
|
-
exports.transformLastClasses = transformLastClasses;
|
|
11
6
|
exports.asValue = asValue;
|
|
12
7
|
exports.asColor = asColor;
|
|
13
8
|
exports.asLookupValue = asLookupValue;
|
|
@@ -15,167 +10,63 @@ exports.coerceValue = coerceValue;
|
|
|
15
10
|
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
|
16
11
|
var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
|
|
17
12
|
var _withAlphaVariable = require("./withAlphaVariable");
|
|
18
|
-
var _isKeyframeRule = _interopRequireDefault(require("./isKeyframeRule"));
|
|
19
13
|
var _dataTypes = require("./dataTypes");
|
|
14
|
+
var _negateValue = _interopRequireDefault(require("./negateValue"));
|
|
20
15
|
function _interopRequireDefault(obj) {
|
|
21
16
|
return obj && obj.__esModule ? obj : {
|
|
22
17
|
default: obj
|
|
23
18
|
};
|
|
24
19
|
}
|
|
25
|
-
function
|
|
26
|
-
let markerIdx = selector.search(new RegExp(`${marker}[:[]`));
|
|
27
|
-
if (markerIdx === -1) {
|
|
28
|
-
return join(marker + state, selector);
|
|
29
|
-
}
|
|
30
|
-
let markerSelector = selector.slice(markerIdx, selector.indexOf(' ', markerIdx));
|
|
31
|
-
return join(marker + state + markerSelector.slice(markerIdx + marker.length), selector.replace(markerSelector, ''));
|
|
32
|
-
}
|
|
33
|
-
function updateAllClasses(selectors, updateClass) {
|
|
20
|
+
function updateAllClasses(selectors1, updateClass) {
|
|
34
21
|
let parser = (0, _postcssSelectorParser).default((selectors)=>{
|
|
35
22
|
selectors.walkClasses((sel)=>{
|
|
36
|
-
let updatedClass = updateClass(sel.value
|
|
37
|
-
withAttr (className, attr) {
|
|
38
|
-
sel.parent.insertAfter(sel, _postcssSelectorParser.default.attribute({
|
|
39
|
-
attribute: attr.slice(1, -1)
|
|
40
|
-
}));
|
|
41
|
-
return className;
|
|
42
|
-
},
|
|
43
|
-
withPseudo (className, pseudo) {
|
|
44
|
-
sel.parent.insertAfter(sel, _postcssSelectorParser.default.pseudo({
|
|
45
|
-
value: pseudo
|
|
46
|
-
}));
|
|
47
|
-
return className;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
23
|
+
let updatedClass = updateClass(sel.value);
|
|
50
24
|
sel.value = updatedClass;
|
|
51
25
|
if (sel.raws && sel.raws.value) {
|
|
52
26
|
sel.raws.value = (0, _escapeCommas).default(sel.raws.value);
|
|
53
27
|
}
|
|
54
28
|
});
|
|
55
29
|
});
|
|
56
|
-
let result = parser.processSync(
|
|
30
|
+
let result = parser.processSync(selectors1);
|
|
57
31
|
return result;
|
|
58
32
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
let lastClass = sel.filter(({ type })=>type === 'class'
|
|
63
|
-
).pop();
|
|
64
|
-
if (lastClass === undefined) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
let updatedClass = updateClass(lastClass.value, {
|
|
68
|
-
withPseudo (className, pseudo) {
|
|
69
|
-
lastClass.parent.insertAfter(lastClass, _postcssSelectorParser.default.pseudo({
|
|
70
|
-
value: `${pseudo}`
|
|
71
|
-
}));
|
|
72
|
-
return className;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
lastClass.value = updatedClass;
|
|
76
|
-
if (lastClass.raws && lastClass.raws.value) {
|
|
77
|
-
lastClass.raws.value = (0, _escapeCommas).default(lastClass.raws.value);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
let result = parser.processSync(selectors);
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
function splitByNotEscapedCommas(str) {
|
|
85
|
-
let chunks = [];
|
|
86
|
-
let currentChunk = '';
|
|
87
|
-
for(let i = 0; i < str.length; i++){
|
|
88
|
-
if (str[i] === ',' && str[i - 1] !== '\\') {
|
|
89
|
-
chunks.push(currentChunk);
|
|
90
|
-
currentChunk = '';
|
|
91
|
-
} else {
|
|
92
|
-
currentChunk += str[i];
|
|
93
|
-
}
|
|
33
|
+
function resolveArbitraryValue(modifier, validate) {
|
|
34
|
+
if (!isArbitraryValue(modifier)) {
|
|
35
|
+
return undefined;
|
|
94
36
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return ({ container })=>{
|
|
101
|
-
container.walkRules((rule)=>{
|
|
102
|
-
if ((0, _isKeyframeRule).default(rule)) {
|
|
103
|
-
return rule;
|
|
104
|
-
}
|
|
105
|
-
let transformed = splitByNotEscapedCommas(rule.selector).map(transformSelector).join(',');
|
|
106
|
-
rule.selector = transformed;
|
|
107
|
-
if (withRule) {
|
|
108
|
-
withRule(rule);
|
|
109
|
-
}
|
|
110
|
-
return rule;
|
|
111
|
-
});
|
|
112
|
-
if (wrap) {
|
|
113
|
-
let wrapper = wrap();
|
|
114
|
-
let nodes = container.nodes;
|
|
115
|
-
container.removeAll();
|
|
116
|
-
wrapper.append(nodes);
|
|
117
|
-
container.append(wrapper);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function transformAllClasses(transformClass, { wrap , withRule } = {
|
|
122
|
-
}) {
|
|
123
|
-
return ({ container })=>{
|
|
124
|
-
container.walkRules((rule)=>{
|
|
125
|
-
let selector = rule.selector;
|
|
126
|
-
let variantSelector = updateAllClasses(selector, transformClass);
|
|
127
|
-
rule.selector = variantSelector;
|
|
128
|
-
if (withRule) {
|
|
129
|
-
withRule(rule);
|
|
130
|
-
}
|
|
131
|
-
return rule;
|
|
132
|
-
});
|
|
133
|
-
if (wrap) {
|
|
134
|
-
let wrapper = wrap();
|
|
135
|
-
let nodes = container.nodes;
|
|
136
|
-
container.removeAll();
|
|
137
|
-
wrapper.append(nodes);
|
|
138
|
-
container.append(wrapper);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
37
|
+
let value = modifier.slice(1, -1);
|
|
38
|
+
if (!validate(value)) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return (0, _dataTypes).normalize(value);
|
|
141
42
|
}
|
|
142
|
-
function
|
|
143
|
-
}) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return rule;
|
|
153
|
-
});
|
|
154
|
-
if (wrap) {
|
|
155
|
-
let wrapper = wrap();
|
|
156
|
-
let nodes = container.nodes;
|
|
157
|
-
container.removeAll();
|
|
158
|
-
wrapper.append(nodes);
|
|
159
|
-
container.append(wrapper);
|
|
43
|
+
function asNegativeValue(modifier, lookup = {
|
|
44
|
+
}, validate) {
|
|
45
|
+
let positiveValue = lookup[modifier];
|
|
46
|
+
if (positiveValue !== undefined) {
|
|
47
|
+
return (0, _negateValue).default(positiveValue);
|
|
48
|
+
}
|
|
49
|
+
if (isArbitraryValue(modifier)) {
|
|
50
|
+
let resolved = resolveArbitraryValue(modifier, validate);
|
|
51
|
+
if (resolved === undefined) {
|
|
52
|
+
return undefined;
|
|
160
53
|
}
|
|
161
|
-
|
|
54
|
+
return (0, _negateValue).default(resolved);
|
|
55
|
+
}
|
|
162
56
|
}
|
|
163
|
-
function asValue(modifier,
|
|
57
|
+
function asValue(modifier, options = {
|
|
164
58
|
}, { validate =()=>true
|
|
165
59
|
} = {
|
|
166
60
|
}) {
|
|
167
|
-
|
|
61
|
+
var ref;
|
|
62
|
+
let value = (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
|
|
168
63
|
if (value !== undefined) {
|
|
169
64
|
return value;
|
|
170
65
|
}
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
66
|
+
if (options.supportsNegativeValues && modifier.startsWith('-')) {
|
|
67
|
+
return asNegativeValue(modifier.slice(1), options.values, validate);
|
|
173
68
|
}
|
|
174
|
-
|
|
175
|
-
if (!validate(value)) {
|
|
176
|
-
return undefined;
|
|
177
|
-
}
|
|
178
|
-
return (0, _dataTypes).normalize(value);
|
|
69
|
+
return resolveArbitraryValue(modifier, validate);
|
|
179
70
|
}
|
|
180
71
|
function isArbitraryValue(input) {
|
|
181
72
|
return input.startsWith('[') && input.endsWith(']');
|
|
@@ -192,39 +83,43 @@ function splitAlpha(modifier) {
|
|
|
192
83
|
modifier.slice(slashIdx + 1)
|
|
193
84
|
];
|
|
194
85
|
}
|
|
195
|
-
function asColor(modifier,
|
|
196
|
-
}, tailwindConfig =
|
|
86
|
+
function asColor(modifier, options = {
|
|
87
|
+
}, { tailwindConfig ={
|
|
88
|
+
} } = {
|
|
197
89
|
}) {
|
|
198
|
-
|
|
199
|
-
|
|
90
|
+
var ref;
|
|
91
|
+
if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier]) !== undefined) {
|
|
92
|
+
var ref1;
|
|
93
|
+
return (ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[modifier];
|
|
200
94
|
}
|
|
201
95
|
let [color, alpha] = splitAlpha(modifier);
|
|
202
96
|
if (alpha !== undefined) {
|
|
203
|
-
var
|
|
204
|
-
var
|
|
205
|
-
let normalizedColor = (
|
|
97
|
+
var ref2, ref3, ref4;
|
|
98
|
+
var ref5;
|
|
99
|
+
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;
|
|
206
100
|
if (normalizedColor === undefined) {
|
|
207
101
|
return undefined;
|
|
208
102
|
}
|
|
209
103
|
if (isArbitraryValue(alpha)) {
|
|
210
104
|
return (0, _withAlphaVariable).withAlphaValue(normalizedColor, alpha.slice(1, -1));
|
|
211
105
|
}
|
|
212
|
-
if (((
|
|
106
|
+
if (((ref3 = tailwindConfig.theme) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.opacity) === null || ref4 === void 0 ? void 0 : ref4[alpha]) === undefined) {
|
|
213
107
|
return undefined;
|
|
214
108
|
}
|
|
215
109
|
return (0, _withAlphaVariable).withAlphaValue(normalizedColor, tailwindConfig.theme.opacity[alpha]);
|
|
216
110
|
}
|
|
217
|
-
return asValue(modifier,
|
|
111
|
+
return asValue(modifier, options, {
|
|
218
112
|
validate: _dataTypes.color
|
|
219
113
|
});
|
|
220
114
|
}
|
|
221
|
-
function asLookupValue(modifier,
|
|
115
|
+
function asLookupValue(modifier, options = {
|
|
222
116
|
}) {
|
|
223
|
-
|
|
117
|
+
var ref;
|
|
118
|
+
return (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
|
|
224
119
|
}
|
|
225
120
|
function guess(validate) {
|
|
226
|
-
return (modifier,
|
|
227
|
-
return asValue(modifier,
|
|
121
|
+
return (modifier, options)=>{
|
|
122
|
+
return asValue(modifier, options, {
|
|
228
123
|
validate
|
|
229
124
|
});
|
|
230
125
|
};
|
|
@@ -243,7 +138,8 @@ let typeMap = {
|
|
|
243
138
|
number: guess(_dataTypes.number),
|
|
244
139
|
'line-width': guess(_dataTypes.lineWidth),
|
|
245
140
|
'absolute-size': guess(_dataTypes.absoluteSize),
|
|
246
|
-
'relative-size': guess(_dataTypes.relativeSize)
|
|
141
|
+
'relative-size': guess(_dataTypes.relativeSize),
|
|
142
|
+
shadow: guess(_dataTypes.shadow)
|
|
247
143
|
};
|
|
248
144
|
let supportedTypes = Object.keys(typeMap);
|
|
249
145
|
function splitAtFirst(input, delim) {
|
|
@@ -257,22 +153,30 @@ function splitAtFirst(input, delim) {
|
|
|
257
153
|
input.slice(idx + 1)
|
|
258
154
|
];
|
|
259
155
|
}
|
|
260
|
-
function coerceValue(types, modifier,
|
|
156
|
+
function coerceValue(types, modifier, options, tailwindConfig) {
|
|
261
157
|
if (isArbitraryValue(modifier)) {
|
|
262
|
-
let
|
|
263
|
-
|
|
158
|
+
let arbitraryValue = modifier.slice(1, -1);
|
|
159
|
+
let [explicitType, value] = splitAtFirst(arbitraryValue, ':');
|
|
160
|
+
// It could be that this resolves to `url(https` which is not a valid
|
|
161
|
+
// identifier. We currently only support "simple" words with dashes or
|
|
162
|
+
// underscores. E.g.: family-name
|
|
163
|
+
if (!/^[\w-_]+$/g.test(explicitType)) {
|
|
164
|
+
value = arbitraryValue;
|
|
165
|
+
} else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
|
|
264
166
|
return [];
|
|
265
167
|
}
|
|
266
168
|
if (value.length > 0 && supportedTypes.includes(explicitType)) {
|
|
267
169
|
return [
|
|
268
|
-
asValue(`[${value}]`,
|
|
170
|
+
asValue(`[${value}]`, options),
|
|
269
171
|
explicitType
|
|
270
172
|
];
|
|
271
173
|
}
|
|
272
174
|
}
|
|
273
175
|
// Find first matching type
|
|
274
176
|
for (let type of [].concat(types)){
|
|
275
|
-
let result = typeMap[type](modifier,
|
|
177
|
+
let result = typeMap[type](modifier, options, {
|
|
178
|
+
tailwindConfig
|
|
179
|
+
});
|
|
276
180
|
if (result) return [
|
|
277
181
|
result,
|
|
278
182
|
type
|
|
@@ -11,12 +11,10 @@ function _interopRequireDefault(obj) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function _default(prefix, selector) {
|
|
14
|
-
const getPrefix = typeof prefix === 'function' ? prefix : ()=>prefix === undefined ? '' : prefix
|
|
15
|
-
;
|
|
16
14
|
return (0, _postcssSelectorParser).default((selectors)=>{
|
|
17
15
|
selectors.walkClasses((classSelector)=>{
|
|
18
16
|
(0, _tap).tap(classSelector.value, (baseClass)=>{
|
|
19
|
-
classSelector.value = `${
|
|
17
|
+
classSelector.value = `${prefix}${baseClass}`;
|
|
20
18
|
});
|
|
21
19
|
});
|
|
22
20
|
}).processSync(selector);
|
|
@@ -43,9 +43,13 @@ function mergeWith(target, ...sources) {
|
|
|
43
43
|
const configUtils = {
|
|
44
44
|
colors: _colors.default,
|
|
45
45
|
negative (scale) {
|
|
46
|
+
// TODO: Log that this function isn't really needed anymore?
|
|
46
47
|
return Object.keys(scale).filter((key)=>scale[key] !== '0'
|
|
47
48
|
).reduce((negativeScale, key)=>{
|
|
48
|
-
|
|
49
|
+
let negativeValue = (0, _negateValue).default(scale[key]);
|
|
50
|
+
if (negativeValue !== undefined) {
|
|
51
|
+
negativeScale[`-${key}`] = negativeValue;
|
|
52
|
+
}
|
|
49
53
|
return negativeScale;
|
|
50
54
|
}, {
|
|
51
55
|
});
|
|
@@ -60,7 +64,7 @@ const configUtils = {
|
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
|
-
function
|
|
67
|
+
function value1(valueToResolve, ...args) {
|
|
64
68
|
return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
|
|
65
69
|
}
|
|
66
70
|
function collectExtends(items) {
|
|
@@ -125,7 +129,7 @@ function mergeExtensions({ extend , ...theme }) {
|
|
|
125
129
|
}, ...[
|
|
126
130
|
themeValue,
|
|
127
131
|
...extensions
|
|
128
|
-
].map((e)=>
|
|
132
|
+
].map((e)=>value1(e, resolveThemePath, utils)
|
|
129
133
|
), mergeExtensionCustomizer)
|
|
130
134
|
;
|
|
131
135
|
});
|
|
@@ -142,8 +146,8 @@ function resolveFunctionKeys(object) {
|
|
|
142
146
|
return val === undefined ? defaultValue : val;
|
|
143
147
|
};
|
|
144
148
|
resolvePath.theme = resolvePath;
|
|
145
|
-
for(let
|
|
146
|
-
resolvePath[
|
|
149
|
+
for(let key1 in configUtils){
|
|
150
|
+
resolvePath[key1] = configUtils[key1];
|
|
147
151
|
}
|
|
148
152
|
return Object.keys(object).reduce((resolved, key)=>{
|
|
149
153
|
return {
|
|
@@ -160,8 +164,8 @@ function extractPluginConfigs(configs) {
|
|
|
160
164
|
...allConfigs,
|
|
161
165
|
config
|
|
162
166
|
];
|
|
163
|
-
var
|
|
164
|
-
const plugins = (
|
|
167
|
+
var ref1;
|
|
168
|
+
const plugins = (ref1 = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref1 !== void 0 ? ref1 : [];
|
|
165
169
|
if (plugins.length === 0) {
|
|
166
170
|
return;
|
|
167
171
|
}
|
|
@@ -215,7 +219,7 @@ function resolveConfig(configs) {
|
|
|
215
219
|
variantOrder: _defaultConfigStub.default.variantOrder
|
|
216
220
|
},
|
|
217
221
|
];
|
|
218
|
-
var ref,
|
|
222
|
+
var ref, ref2;
|
|
219
223
|
return (0, _normalizeConfig).normalizeConfig((0, _defaults).defaults({
|
|
220
224
|
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
|
221
225
|
return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {
|
|
@@ -224,7 +228,7 @@ function resolveConfig(configs) {
|
|
|
224
228
|
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins
|
|
225
229
|
)),
|
|
226
230
|
plugins: resolvePluginLists(configs.map((c)=>{
|
|
227
|
-
return (
|
|
231
|
+
return (ref2 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref2 !== void 0 ? ref2 : [];
|
|
228
232
|
}))
|
|
229
233
|
}, ...allConfigs));
|
|
230
234
|
}
|
|
@@ -14,8 +14,12 @@ function transformThemeValue(themeSection) {
|
|
|
14
14
|
'fontSize',
|
|
15
15
|
'outline'
|
|
16
16
|
].includes(themeSection)) {
|
|
17
|
-
return (value)=>
|
|
18
|
-
|
|
17
|
+
return (value)=>{
|
|
18
|
+
if (typeof value === 'function') value = value({
|
|
19
|
+
});
|
|
20
|
+
if (Array.isArray(value)) value = value[0];
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
19
23
|
}
|
|
20
24
|
if ([
|
|
21
25
|
'fontFamily',
|
|
@@ -30,8 +34,12 @@ function transformThemeValue(themeSection) {
|
|
|
30
34
|
'cursor',
|
|
31
35
|
'animation',
|
|
32
36
|
].includes(themeSection)) {
|
|
33
|
-
return (value)=>
|
|
34
|
-
|
|
37
|
+
return (value)=>{
|
|
38
|
+
if (typeof value === 'function') value = value({
|
|
39
|
+
});
|
|
40
|
+
if (Array.isArray(value)) value = value.join(', ');
|
|
41
|
+
return value;
|
|
42
|
+
};
|
|
35
43
|
}
|
|
36
44
|
// For backwards compatibility reasons, before we switched to underscores
|
|
37
45
|
// instead of commas for arbitrary values.
|
|
@@ -40,14 +48,16 @@ function transformThemeValue(themeSection) {
|
|
|
40
48
|
'gridTemplateRows',
|
|
41
49
|
'objectPosition'
|
|
42
50
|
].includes(themeSection)) {
|
|
43
|
-
return (value)=>
|
|
44
|
-
|
|
51
|
+
return (value)=>{
|
|
52
|
+
if (typeof value === 'function') value = value({
|
|
53
|
+
});
|
|
54
|
+
if (typeof value === 'string') value = _postcss.default.list.comma(value).join(' ');
|
|
55
|
+
return value;
|
|
56
|
+
};
|
|
45
57
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
;
|
|
50
|
-
}
|
|
51
|
-
return (value)=>value
|
|
52
|
-
;
|
|
58
|
+
return (value)=>{
|
|
59
|
+
if (typeof value === 'function') value = value({
|
|
60
|
+
});
|
|
61
|
+
return value;
|
|
62
|
+
};
|
|
53
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"*.js"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@swc/cli": "^0.1.
|
|
47
|
-
"@swc/core": "^1.2.
|
|
46
|
+
"@swc/cli": "^0.1.51",
|
|
47
|
+
"@swc/core": "^1.2.106",
|
|
48
48
|
"@swc/jest": "^0.1.5",
|
|
49
49
|
"@swc/register": "^0.1.7",
|
|
50
|
-
"autoprefixer": "^10.
|
|
50
|
+
"autoprefixer": "^10.4.0",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
52
52
|
"cssnano": "^5.0.8",
|
|
53
|
-
"esbuild": "^0.13.
|
|
54
|
-
"eslint": "^
|
|
53
|
+
"esbuild": "^0.13.12",
|
|
54
|
+
"eslint": "^8.0.1",
|
|
55
55
|
"eslint-config-prettier": "^8.3.0",
|
|
56
56
|
"eslint-plugin-prettier": "^4.0.0",
|
|
57
|
-
"jest": "^27.1
|
|
58
|
-
"jest-diff": "^27.2.
|
|
59
|
-
"postcss": "^8.3.
|
|
57
|
+
"jest": "^27.3.1",
|
|
58
|
+
"jest-diff": "^27.2.5",
|
|
59
|
+
"postcss": "^8.3.11",
|
|
60
60
|
"postcss-cli": "^8.3.1",
|
|
61
61
|
"prettier": "^2.4.1",
|
|
62
62
|
"rimraf": "^3.0.0"
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"didyoumean": "^1.2.2",
|
|
76
76
|
"dlv": "^1.1.3",
|
|
77
77
|
"fast-glob": "^3.2.7",
|
|
78
|
-
"glob-parent": "^6.0.
|
|
79
|
-
"is-glob": "^4.0.
|
|
78
|
+
"glob-parent": "^6.0.2",
|
|
79
|
+
"is-glob": "^4.0.3",
|
|
80
80
|
"normalize-path": "^3.0.0",
|
|
81
81
|
"object-hash": "^2.2.0",
|
|
82
82
|
"postcss-js": "^3.0.3",
|