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