tailwindcss 0.0.0-insiders.ff2c25f → 0.0.0-internal.b2586d4e
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 +5 -6
- package/dist/lib.d.mts +339 -0
- package/dist/lib.d.ts +339 -0
- package/dist/lib.js +17 -0
- package/dist/lib.mjs +17 -0
- package/index.css +5 -0
- package/package.json +36 -107
- package/preflight.css +334 -0
- package/theme.css +463 -0
- package/base.css +0 -1
- package/colors.d.ts +0 -3
- package/colors.js +0 -2
- package/components.css +0 -1
- package/defaultConfig.d.ts +0 -3
- package/defaultConfig.js +0 -2
- package/defaultTheme.d.ts +0 -4
- package/defaultTheme.js +0 -2
- package/lib/cli/build/deps.js +0 -54
- package/lib/cli/build/index.js +0 -48
- package/lib/cli/build/plugin.js +0 -367
- package/lib/cli/build/utils.js +0 -78
- package/lib/cli/build/watching.js +0 -178
- package/lib/cli/help/index.js +0 -71
- package/lib/cli/index.js +0 -239
- package/lib/cli/init/index.js +0 -46
- package/lib/cli-peer-dependencies.js +0 -28
- package/lib/cli.js +0 -7
- package/lib/constants.js +0 -44
- package/lib/corePluginList.js +0 -181
- package/lib/corePlugins.js +0 -4062
- package/lib/css/LICENSE +0 -25
- package/lib/css/preflight.css +0 -367
- package/lib/featureFlags.js +0 -71
- package/lib/index.js +0 -6
- package/lib/lib/cacheInvalidation.js +0 -90
- package/lib/lib/collapseAdjacentRules.js +0 -59
- package/lib/lib/collapseDuplicateDeclarations.js +0 -83
- package/lib/lib/content.js +0 -177
- package/lib/lib/defaultExtractor.js +0 -241
- package/lib/lib/detectNesting.js +0 -43
- package/lib/lib/evaluateTailwindFunctions.js +0 -234
- package/lib/lib/expandApplyAtRules.js +0 -526
- package/lib/lib/expandTailwindAtRules.js +0 -273
- package/lib/lib/findAtConfigPath.js +0 -44
- package/lib/lib/generateRules.js +0 -866
- package/lib/lib/getModuleDependencies.js +0 -51
- package/lib/lib/normalizeTailwindDirectives.js +0 -87
- package/lib/lib/offsets.js +0 -299
- package/lib/lib/partitionApplyAtRules.js +0 -56
- package/lib/lib/regex.js +0 -60
- package/lib/lib/remap-bitfield.js +0 -87
- package/lib/lib/resolveDefaultsAtRules.js +0 -161
- package/lib/lib/setupContextUtils.js +0 -1218
- package/lib/lib/setupTrackingContext.js +0 -163
- package/lib/lib/sharedState.js +0 -78
- package/lib/lib/substituteScreenAtRules.js +0 -29
- package/lib/oxide/cli/build/deps.js +0 -81
- package/lib/oxide/cli/build/index.js +0 -47
- package/lib/oxide/cli/build/plugin.js +0 -364
- package/lib/oxide/cli/build/utils.js +0 -77
- package/lib/oxide/cli/build/watching.js +0 -177
- package/lib/oxide/cli/help/index.js +0 -70
- package/lib/oxide/cli/index.js +0 -220
- package/lib/oxide/cli/init/index.js +0 -35
- package/lib/oxide/cli.js +0 -5
- package/lib/oxide/postcss-plugin.js +0 -2
- package/lib/plugin.js +0 -48
- package/lib/postcss-plugins/nesting/README.md +0 -42
- package/lib/postcss-plugins/nesting/index.js +0 -19
- package/lib/postcss-plugins/nesting/plugin.js +0 -87
- package/lib/processTailwindFeatures.js +0 -62
- package/lib/public/colors.js +0 -331
- package/lib/public/create-plugin.js +0 -15
- package/lib/public/default-config.js +0 -16
- package/lib/public/default-theme.js +0 -16
- package/lib/public/resolve-config.js +0 -22
- package/lib/util/bigSign.js +0 -11
- package/lib/util/buildMediaQuery.js +0 -25
- package/lib/util/cloneDeep.js +0 -20
- package/lib/util/cloneNodes.js +0 -32
- package/lib/util/color.js +0 -98
- package/lib/util/configurePlugins.js +0 -21
- package/lib/util/createPlugin.js +0 -30
- package/lib/util/createUtilityPlugin.js +0 -51
- package/lib/util/dataTypes.js +0 -266
- package/lib/util/defaults.js +0 -25
- package/lib/util/escapeClassName.js +0 -22
- package/lib/util/escapeCommas.js +0 -11
- package/lib/util/flattenColorPalette.js +0 -16
- package/lib/util/formatVariantSelector.js +0 -351
- package/lib/util/getAllConfigs.js +0 -48
- package/lib/util/hashConfig.js +0 -19
- package/lib/util/isKeyframeRule.js +0 -11
- package/lib/util/isPlainObject.js +0 -15
- package/lib/util/isSyntacticallyValidPropertyValue.js +0 -72
- package/lib/util/log.js +0 -57
- package/lib/util/nameClass.js +0 -43
- package/lib/util/negateValue.js +0 -34
- package/lib/util/normalizeConfig.js +0 -281
- package/lib/util/normalizeScreens.js +0 -170
- package/lib/util/parseAnimationValue.js +0 -91
- package/lib/util/parseBoxShadowValue.js +0 -84
- package/lib/util/parseDependency.js +0 -45
- package/lib/util/parseGlob.js +0 -34
- package/lib/util/parseObjectStyles.js +0 -34
- package/lib/util/pluginUtils.js +0 -283
- package/lib/util/prefixSelector.js +0 -37
- package/lib/util/removeAlphaVariables.js +0 -29
- package/lib/util/resolveConfig.js +0 -254
- package/lib/util/resolveConfigPath.js +0 -54
- package/lib/util/responsive.js +0 -22
- package/lib/util/splitAtTopLevelOnly.js +0 -43
- package/lib/util/tap.js +0 -12
- package/lib/util/toColorValue.js +0 -11
- package/lib/util/toPath.js +0 -30
- package/lib/util/transformThemeValue.js +0 -71
- package/lib/util/validateConfig.js +0 -24
- package/lib/util/validateFormalSyntax.js +0 -24
- package/lib/util/withAlphaVariable.js +0 -75
- package/nesting/index.js +0 -2
- package/oxide-node-api-shim/index.js +0 -21
- package/oxide-node-api-shim/package.json +0 -5
- package/peers/index.js +0 -79461
- package/plugin.d.ts +0 -11
- package/plugin.js +0 -2
- package/prettier.config.js +0 -19
- package/resolveConfig.d.ts +0 -12
- package/resolveConfig.js +0 -2
- package/screens.css +0 -1
- package/scripts/create-plugin-list.js +0 -10
- package/scripts/generate-types.js +0 -105
- package/scripts/release-channel.js +0 -18
- package/scripts/release-notes.js +0 -21
- package/scripts/swap-engines.js +0 -40
- package/scripts/type-utils.js +0 -27
- package/src/cli/build/deps.js +0 -56
- package/src/cli/build/index.js +0 -49
- package/src/cli/build/plugin.js +0 -439
- package/src/cli/build/utils.js +0 -76
- package/src/cli/build/watching.js +0 -227
- package/src/cli/help/index.js +0 -70
- package/src/cli/index.js +0 -234
- package/src/cli/init/index.js +0 -50
- package/src/cli-peer-dependencies.js +0 -15
- package/src/cli.js +0 -7
- package/src/constants.js +0 -17
- package/src/corePluginList.js +0 -1
- package/src/corePlugins.js +0 -2744
- package/src/css/LICENSE +0 -25
- package/src/css/preflight.css +0 -367
- package/src/featureFlags.js +0 -64
- package/src/index.js +0 -5
- package/src/lib/cacheInvalidation.js +0 -52
- package/src/lib/collapseAdjacentRules.js +0 -58
- package/src/lib/collapseDuplicateDeclarations.js +0 -93
- package/src/lib/content.js +0 -208
- package/src/lib/defaultExtractor.js +0 -217
- package/src/lib/detectNesting.js +0 -47
- package/src/lib/evaluateTailwindFunctions.js +0 -269
- package/src/lib/expandApplyAtRules.js +0 -606
- package/src/lib/expandTailwindAtRules.js +0 -285
- package/src/lib/findAtConfigPath.js +0 -48
- package/src/lib/generateRules.js +0 -899
- package/src/lib/getModuleDependencies.js +0 -39
- package/src/lib/normalizeTailwindDirectives.js +0 -84
- package/src/lib/offsets.js +0 -367
- package/src/lib/partitionApplyAtRules.js +0 -52
- package/src/lib/regex.js +0 -74
- package/src/lib/remap-bitfield.js +0 -82
- package/src/lib/resolveDefaultsAtRules.js +0 -163
- package/src/lib/setupContextUtils.js +0 -1308
- package/src/lib/setupTrackingContext.js +0 -171
- package/src/lib/sharedState.js +0 -67
- package/src/lib/substituteScreenAtRules.js +0 -19
- package/src/oxide/cli/build/deps.ts +0 -91
- package/src/oxide/cli/build/index.ts +0 -47
- package/src/oxide/cli/build/plugin.ts +0 -436
- package/src/oxide/cli/build/utils.ts +0 -74
- package/src/oxide/cli/build/watching.ts +0 -225
- package/src/oxide/cli/help/index.ts +0 -69
- package/src/oxide/cli/index.ts +0 -212
- package/src/oxide/cli/init/index.ts +0 -32
- package/src/oxide/cli.ts +0 -1
- package/src/oxide/postcss-plugin.ts +0 -1
- package/src/plugin.js +0 -47
- package/src/postcss-plugins/nesting/README.md +0 -42
- package/src/postcss-plugins/nesting/index.js +0 -13
- package/src/postcss-plugins/nesting/plugin.js +0 -80
- package/src/processTailwindFeatures.js +0 -58
- package/src/public/colors.js +0 -300
- 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 -22
- package/src/util/cloneDeep.js +0 -11
- package/src/util/cloneNodes.js +0 -28
- package/src/util/color.js +0 -73
- 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 -281
- package/src/util/defaults.js +0 -17
- package/src/util/escapeClassName.js +0 -8
- package/src/util/escapeCommas.js +0 -3
- package/src/util/flattenColorPalette.js +0 -13
- package/src/util/formatVariantSelector.js +0 -412
- package/src/util/getAllConfigs.js +0 -38
- package/src/util/hashConfig.js +0 -5
- package/src/util/isKeyframeRule.js +0 -3
- package/src/util/isPlainObject.js +0 -8
- package/src/util/isSyntacticallyValidPropertyValue.js +0 -61
- package/src/util/log.js +0 -29
- package/src/util/nameClass.js +0 -30
- package/src/util/negateValue.js +0 -24
- package/src/util/normalizeConfig.js +0 -300
- package/src/util/normalizeScreens.js +0 -140
- package/src/util/parseAnimationValue.js +0 -68
- package/src/util/parseBoxShadowValue.js +0 -72
- package/src/util/parseDependency.js +0 -44
- package/src/util/parseGlob.js +0 -24
- package/src/util/parseObjectStyles.js +0 -19
- package/src/util/pluginUtils.js +0 -314
- package/src/util/prefixSelector.js +0 -32
- package/src/util/removeAlphaVariables.js +0 -24
- package/src/util/resolveConfig.js +0 -277
- package/src/util/resolveConfigPath.js +0 -55
- package/src/util/responsive.js +0 -10
- package/src/util/splitAtTopLevelOnly.js +0 -45
- package/src/util/tap.js +0 -4
- package/src/util/toColorValue.js +0 -3
- package/src/util/toPath.js +0 -26
- package/src/util/transformThemeValue.js +0 -62
- package/src/util/validateConfig.js +0 -13
- package/src/util/validateFormalSyntax.js +0 -34
- package/src/util/withAlphaVariable.js +0 -49
- package/stubs/defaultConfig.stub.js +0 -956
- package/stubs/defaultPostCssConfig.stub.js +0 -6
- package/stubs/simpleConfig.stub.js +0 -8
- package/tailwind.css +0 -5
- package/types/config.d.ts +0 -367
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +0 -276
- package/types/generated/corePluginList.d.ts +0 -1
- package/types/generated/default-theme.d.ts +0 -345
- package/types/index.d.ts +0 -7
- package/variants.css +0 -1
package/lib/util/pluginUtils.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
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
|
-
updateAllClasses: ()=>updateAllClasses,
|
|
13
|
-
filterSelectorsForClass: ()=>filterSelectorsForClass,
|
|
14
|
-
asValue: ()=>asValue,
|
|
15
|
-
parseColorFormat: ()=>parseColorFormat,
|
|
16
|
-
asColor: ()=>asColor,
|
|
17
|
-
asLookupValue: ()=>asLookupValue,
|
|
18
|
-
typeMap: ()=>typeMap,
|
|
19
|
-
coerceValue: ()=>coerceValue,
|
|
20
|
-
getMatchingTypes: ()=>getMatchingTypes
|
|
21
|
-
});
|
|
22
|
-
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
|
23
|
-
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
|
24
|
-
const _withAlphaVariable = require("./withAlphaVariable");
|
|
25
|
-
const _dataTypes = require("./dataTypes");
|
|
26
|
-
const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
|
|
27
|
-
const _validateFormalSyntax = require("./validateFormalSyntax");
|
|
28
|
-
const _featureFlagsJs = require("../featureFlags.js");
|
|
29
|
-
function _interopRequireDefault(obj) {
|
|
30
|
-
return obj && obj.__esModule ? obj : {
|
|
31
|
-
default: obj
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function updateAllClasses(selectors, updateClass) {
|
|
35
|
-
let parser = (0, _postcssSelectorParser.default)((selectors)=>{
|
|
36
|
-
selectors.walkClasses((sel)=>{
|
|
37
|
-
let updatedClass = updateClass(sel.value);
|
|
38
|
-
sel.value = updatedClass;
|
|
39
|
-
if (sel.raws && sel.raws.value) {
|
|
40
|
-
sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
let result = parser.processSync(selectors);
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
function filterSelectorsForClass(selectors, classCandidate) {
|
|
48
|
-
let parser = (0, _postcssSelectorParser.default)((selectors)=>{
|
|
49
|
-
selectors.each((sel)=>{
|
|
50
|
-
const containsClass = sel.nodes.some((node)=>node.type === "class" && node.value === classCandidate);
|
|
51
|
-
if (!containsClass) {
|
|
52
|
-
sel.remove();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
let result = parser.processSync(selectors);
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
function resolveArbitraryValue(modifier, validate) {
|
|
60
|
-
if (!isArbitraryValue(modifier)) {
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
|
-
let value = modifier.slice(1, -1);
|
|
64
|
-
if (!validate(value)) {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
return (0, _dataTypes.normalize)(value);
|
|
68
|
-
}
|
|
69
|
-
function asNegativeValue(modifier, lookup = {}, validate) {
|
|
70
|
-
let positiveValue = lookup[modifier];
|
|
71
|
-
if (positiveValue !== undefined) {
|
|
72
|
-
return (0, _negateValue.default)(positiveValue);
|
|
73
|
-
}
|
|
74
|
-
if (isArbitraryValue(modifier)) {
|
|
75
|
-
let resolved = resolveArbitraryValue(modifier, validate);
|
|
76
|
-
if (resolved === undefined) {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
return (0, _negateValue.default)(resolved);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function asValue(modifier, options = {}, { validate =()=>true } = {}) {
|
|
83
|
-
var _options_values;
|
|
84
|
-
let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
|
|
85
|
-
if (value !== undefined) {
|
|
86
|
-
return value;
|
|
87
|
-
}
|
|
88
|
-
if (options.supportsNegativeValues && modifier.startsWith("-")) {
|
|
89
|
-
return asNegativeValue(modifier.slice(1), options.values, validate);
|
|
90
|
-
}
|
|
91
|
-
return resolveArbitraryValue(modifier, validate);
|
|
92
|
-
}
|
|
93
|
-
function isArbitraryValue(input) {
|
|
94
|
-
return input.startsWith("[") && input.endsWith("]");
|
|
95
|
-
}
|
|
96
|
-
function splitUtilityModifier(modifier) {
|
|
97
|
-
let slashIdx = modifier.lastIndexOf("/");
|
|
98
|
-
if (slashIdx === -1 || slashIdx === modifier.length - 1) {
|
|
99
|
-
return [
|
|
100
|
-
modifier,
|
|
101
|
-
undefined
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
|
-
let arbitrary = isArbitraryValue(modifier);
|
|
105
|
-
// The modifier could be of the form `[foo]/[bar]`
|
|
106
|
-
// We want to handle this case properly
|
|
107
|
-
// without affecting `[foo/bar]`
|
|
108
|
-
if (arbitrary && !modifier.includes("]/[")) {
|
|
109
|
-
return [
|
|
110
|
-
modifier,
|
|
111
|
-
undefined
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
return [
|
|
115
|
-
modifier.slice(0, slashIdx),
|
|
116
|
-
modifier.slice(slashIdx + 1)
|
|
117
|
-
];
|
|
118
|
-
}
|
|
119
|
-
function parseColorFormat(value) {
|
|
120
|
-
if (typeof value === "string" && value.includes("<alpha-value>")) {
|
|
121
|
-
let oldValue = value;
|
|
122
|
-
return ({ opacityValue =1 })=>oldValue.replace("<alpha-value>", opacityValue);
|
|
123
|
-
}
|
|
124
|
-
return value;
|
|
125
|
-
}
|
|
126
|
-
function unwrapArbitraryModifier(modifier) {
|
|
127
|
-
modifier = modifier.slice(1, -1);
|
|
128
|
-
if (modifier.startsWith("--")) {
|
|
129
|
-
modifier = `var(${modifier})`;
|
|
130
|
-
}
|
|
131
|
-
return modifier;
|
|
132
|
-
}
|
|
133
|
-
function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
|
|
134
|
-
var _options_values;
|
|
135
|
-
if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
|
|
136
|
-
var _options_values1;
|
|
137
|
-
return parseColorFormat((_options_values1 = options.values) === null || _options_values1 === void 0 ? void 0 : _options_values1[modifier]);
|
|
138
|
-
}
|
|
139
|
-
// TODO: Hoist this up to getMatchingTypes or something
|
|
140
|
-
// We do this here because we need the alpha value (if any)
|
|
141
|
-
let [color, alpha] = splitUtilityModifier(modifier);
|
|
142
|
-
if (alpha !== undefined) {
|
|
143
|
-
var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
|
|
144
|
-
var _options_values_color;
|
|
145
|
-
let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
|
|
146
|
-
if (normalizedColor === undefined) {
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
normalizedColor = parseColorFormat(normalizedColor);
|
|
150
|
-
if (isArbitraryValue(alpha)) {
|
|
151
|
-
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, unwrapArbitraryModifier(alpha));
|
|
152
|
-
}
|
|
153
|
-
if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
|
|
157
|
-
}
|
|
158
|
-
return asValue(modifier, options, {
|
|
159
|
-
validate: _dataTypes.color
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function asLookupValue(modifier, options = {}) {
|
|
163
|
-
var _options_values;
|
|
164
|
-
return (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
|
|
165
|
-
}
|
|
166
|
-
function guess(validate) {
|
|
167
|
-
return (modifier, options)=>{
|
|
168
|
-
return asValue(modifier, options, {
|
|
169
|
-
validate
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
let typeMap = {
|
|
174
|
-
any: asValue,
|
|
175
|
-
color: asColor,
|
|
176
|
-
url: guess(_dataTypes.url),
|
|
177
|
-
image: guess(_dataTypes.image),
|
|
178
|
-
length: guess(_dataTypes.length),
|
|
179
|
-
percentage: guess(_dataTypes.percentage),
|
|
180
|
-
position: guess(_dataTypes.position),
|
|
181
|
-
lookup: asLookupValue,
|
|
182
|
-
"generic-name": guess(_dataTypes.genericName),
|
|
183
|
-
"family-name": guess(_dataTypes.familyName),
|
|
184
|
-
number: guess(_dataTypes.number),
|
|
185
|
-
"line-width": guess(_dataTypes.lineWidth),
|
|
186
|
-
"absolute-size": guess(_dataTypes.absoluteSize),
|
|
187
|
-
"relative-size": guess(_dataTypes.relativeSize),
|
|
188
|
-
shadow: guess(_dataTypes.shadow),
|
|
189
|
-
size: guess(_validateFormalSyntax.backgroundSize)
|
|
190
|
-
};
|
|
191
|
-
let supportedTypes = Object.keys(typeMap);
|
|
192
|
-
function splitAtFirst(input, delim) {
|
|
193
|
-
let idx = input.indexOf(delim);
|
|
194
|
-
if (idx === -1) return [
|
|
195
|
-
undefined,
|
|
196
|
-
input
|
|
197
|
-
];
|
|
198
|
-
return [
|
|
199
|
-
input.slice(0, idx),
|
|
200
|
-
input.slice(idx + 1)
|
|
201
|
-
];
|
|
202
|
-
}
|
|
203
|
-
function coerceValue(types, modifier, options, tailwindConfig) {
|
|
204
|
-
if (options.values && modifier in options.values) {
|
|
205
|
-
for (let { type } of types !== null && types !== void 0 ? types : []){
|
|
206
|
-
let result = typeMap[type](modifier, options, {
|
|
207
|
-
tailwindConfig
|
|
208
|
-
});
|
|
209
|
-
if (result === undefined) {
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
return [
|
|
213
|
-
result,
|
|
214
|
-
type,
|
|
215
|
-
null
|
|
216
|
-
];
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (isArbitraryValue(modifier)) {
|
|
220
|
-
let arbitraryValue = modifier.slice(1, -1);
|
|
221
|
-
let [explicitType, value] = splitAtFirst(arbitraryValue, ":");
|
|
222
|
-
// It could be that this resolves to `url(https` which is not a valid
|
|
223
|
-
// identifier. We currently only support "simple" words with dashes or
|
|
224
|
-
// underscores. E.g.: family-name
|
|
225
|
-
if (!/^[\w-_]+$/g.test(explicitType)) {
|
|
226
|
-
value = arbitraryValue;
|
|
227
|
-
} else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
|
|
228
|
-
return [];
|
|
229
|
-
}
|
|
230
|
-
if (value.length > 0 && supportedTypes.includes(explicitType)) {
|
|
231
|
-
return [
|
|
232
|
-
asValue(`[${value}]`, options),
|
|
233
|
-
explicitType,
|
|
234
|
-
null
|
|
235
|
-
];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
let matches = getMatchingTypes(types, modifier, options, tailwindConfig);
|
|
239
|
-
// Find first matching type
|
|
240
|
-
for (let match of matches){
|
|
241
|
-
return match;
|
|
242
|
-
}
|
|
243
|
-
return [];
|
|
244
|
-
}
|
|
245
|
-
function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
|
|
246
|
-
let modifiersEnabled = (0, _featureFlagsJs.flagEnabled)(tailwindConfig, "generalizedModifiers");
|
|
247
|
-
let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
|
|
248
|
-
let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
|
|
249
|
-
if (!canUseUtilityModifier) {
|
|
250
|
-
modifier = rawModifier;
|
|
251
|
-
utilityModifier = undefined;
|
|
252
|
-
}
|
|
253
|
-
if (utilityModifier !== undefined && modifier === "") {
|
|
254
|
-
modifier = "DEFAULT";
|
|
255
|
-
}
|
|
256
|
-
// Check the full value first
|
|
257
|
-
// TODO: Move to asValue… somehow
|
|
258
|
-
if (utilityModifier !== undefined) {
|
|
259
|
-
if (typeof options.modifiers === "object") {
|
|
260
|
-
var _options_modifiers;
|
|
261
|
-
var _options_modifiers_utilityModifier;
|
|
262
|
-
let configValue = (_options_modifiers_utilityModifier = (_options_modifiers = options.modifiers) === null || _options_modifiers === void 0 ? void 0 : _options_modifiers[utilityModifier]) !== null && _options_modifiers_utilityModifier !== void 0 ? _options_modifiers_utilityModifier : null;
|
|
263
|
-
if (configValue !== null) {
|
|
264
|
-
utilityModifier = configValue;
|
|
265
|
-
} else if (isArbitraryValue(utilityModifier)) {
|
|
266
|
-
utilityModifier = unwrapArbitraryModifier(utilityModifier);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
for (let { type } of types !== null && types !== void 0 ? types : []){
|
|
271
|
-
let result = typeMap[type](modifier, options, {
|
|
272
|
-
tailwindConfig
|
|
273
|
-
});
|
|
274
|
-
if (result === undefined) {
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
yield [
|
|
278
|
-
result,
|
|
279
|
-
type,
|
|
280
|
-
utilityModifier !== null && utilityModifier !== void 0 ? utilityModifier : null
|
|
281
|
-
];
|
|
282
|
-
}
|
|
283
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, /**
|
|
6
|
-
* @template {string | import('postcss-selector-parser').Root} T
|
|
7
|
-
*
|
|
8
|
-
* Prefix all classes in the selector with the given prefix
|
|
9
|
-
*
|
|
10
|
-
* It can take either a string or a selector AST and will return the same type
|
|
11
|
-
*
|
|
12
|
-
* @param {string} prefix
|
|
13
|
-
* @param {T} selector
|
|
14
|
-
* @param {boolean} prependNegative
|
|
15
|
-
* @returns {T}
|
|
16
|
-
*/ "default", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: ()=>_default
|
|
19
|
-
});
|
|
20
|
-
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
|
21
|
-
function _interopRequireDefault(obj) {
|
|
22
|
-
return obj && obj.__esModule ? obj : {
|
|
23
|
-
default: obj
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function _default(prefix, selector, prependNegative = false) {
|
|
27
|
-
if (prefix === "") {
|
|
28
|
-
return selector;
|
|
29
|
-
}
|
|
30
|
-
let ast = typeof selector === "string" ? (0, _postcssSelectorParser.default)().astSync(selector) : selector;
|
|
31
|
-
ast.walkClasses((classSelector)=>{
|
|
32
|
-
let baseClass = classSelector.value;
|
|
33
|
-
let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
|
|
34
|
-
classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
|
|
35
|
-
});
|
|
36
|
-
return typeof selector === "string" ? ast.toString() : ast;
|
|
37
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function removes any uses of CSS variables used as an alpha channel
|
|
3
|
-
*
|
|
4
|
-
* This is required for selectors like `:visited` which do not allow
|
|
5
|
-
* changes in opacity or external control using CSS variables.
|
|
6
|
-
*
|
|
7
|
-
* @param {import('postcss').Container} container
|
|
8
|
-
* @param {string[]} toRemove
|
|
9
|
-
*/ "use strict";
|
|
10
|
-
Object.defineProperty(exports, "__esModule", {
|
|
11
|
-
value: true
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "removeAlphaVariables", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: ()=>removeAlphaVariables
|
|
16
|
-
});
|
|
17
|
-
function removeAlphaVariables(container, toRemove) {
|
|
18
|
-
container.walkDecls((decl)=>{
|
|
19
|
-
if (toRemove.includes(decl.prop)) {
|
|
20
|
-
decl.remove();
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
for (let varName of toRemove){
|
|
24
|
-
if (decl.value.includes(`/ var(${varName})`)) {
|
|
25
|
-
decl.value = decl.value.replace(`/ var(${varName})`, "");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
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"));
|
|
21
|
-
function _interopRequireDefault(obj) {
|
|
22
|
-
return obj && obj.__esModule ? obj : {
|
|
23
|
-
default: obj
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function isFunction(input) {
|
|
27
|
-
return typeof input === "function";
|
|
28
|
-
}
|
|
29
|
-
function mergeWith(target, ...sources) {
|
|
30
|
-
let customizer = sources.pop();
|
|
31
|
-
for (let source of sources){
|
|
32
|
-
for(let k in source){
|
|
33
|
-
let merged = customizer(target[k], source[k]);
|
|
34
|
-
if (merged === undefined) {
|
|
35
|
-
if ((0, _isPlainObject.default)(target[k]) && (0, _isPlainObject.default)(source[k])) {
|
|
36
|
-
target[k] = mergeWith({}, target[k], source[k], customizer);
|
|
37
|
-
} else {
|
|
38
|
-
target[k] = source[k];
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
target[k] = merged;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return target;
|
|
46
|
-
}
|
|
47
|
-
const configUtils = {
|
|
48
|
-
colors: _colors.default,
|
|
49
|
-
negative (scale) {
|
|
50
|
-
// TODO: Log that this function isn't really needed anymore?
|
|
51
|
-
return Object.keys(scale).filter((key)=>scale[key] !== "0").reduce((negativeScale, key)=>{
|
|
52
|
-
let negativeValue = (0, _negateValue.default)(scale[key]);
|
|
53
|
-
if (negativeValue !== undefined) {
|
|
54
|
-
negativeScale[`-${key}`] = negativeValue;
|
|
55
|
-
}
|
|
56
|
-
return negativeScale;
|
|
57
|
-
}, {});
|
|
58
|
-
},
|
|
59
|
-
breakpoints (screens) {
|
|
60
|
-
return Object.keys(screens).filter((key)=>typeof screens[key] === "string").reduce((breakpoints, key)=>({
|
|
61
|
-
...breakpoints,
|
|
62
|
-
[`screen-${key}`]: screens[key]
|
|
63
|
-
}), {});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
function value(valueToResolve, ...args) {
|
|
67
|
-
return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
|
|
68
|
-
}
|
|
69
|
-
function collectExtends(items) {
|
|
70
|
-
return items.reduce((merged, { extend })=>{
|
|
71
|
-
return mergeWith(merged, extend, (mergedValue, extendValue)=>{
|
|
72
|
-
if (mergedValue === undefined) {
|
|
73
|
-
return [
|
|
74
|
-
extendValue
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
if (Array.isArray(mergedValue)) {
|
|
78
|
-
return [
|
|
79
|
-
extendValue,
|
|
80
|
-
...mergedValue
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
return [
|
|
84
|
-
extendValue,
|
|
85
|
-
mergedValue
|
|
86
|
-
];
|
|
87
|
-
});
|
|
88
|
-
}, {});
|
|
89
|
-
}
|
|
90
|
-
function mergeThemes(themes) {
|
|
91
|
-
return {
|
|
92
|
-
...themes.reduce((merged, theme)=>(0, _defaults.defaults)(merged, theme), {}),
|
|
93
|
-
// In order to resolve n config objects, we combine all of their `extend` properties
|
|
94
|
-
// into arrays instead of objects so they aren't overridden.
|
|
95
|
-
extend: collectExtends(themes)
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function mergeExtensionCustomizer(merged, value) {
|
|
99
|
-
// When we have an array of objects, we do want to merge it
|
|
100
|
-
if (Array.isArray(merged) && (0, _isPlainObject.default)(merged[0])) {
|
|
101
|
-
return merged.concat(value);
|
|
102
|
-
}
|
|
103
|
-
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
|
104
|
-
if (Array.isArray(value) && (0, _isPlainObject.default)(value[0]) && (0, _isPlainObject.default)(merged)) {
|
|
105
|
-
return [
|
|
106
|
-
merged,
|
|
107
|
-
...value
|
|
108
|
-
];
|
|
109
|
-
}
|
|
110
|
-
// Override arrays (for example for font-families, box-shadows, ...)
|
|
111
|
-
if (Array.isArray(value)) {
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
// Execute default behaviour
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
function mergeExtensions({ extend , ...theme }) {
|
|
118
|
-
return mergeWith(theme, extend, (themeValue, extensions)=>{
|
|
119
|
-
// The `extend` property is an array, so we need to check if it contains any functions
|
|
120
|
-
if (!isFunction(themeValue) && !extensions.some(isFunction)) {
|
|
121
|
-
return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
|
|
122
|
-
}
|
|
123
|
-
return (resolveThemePath, utils)=>mergeWith({}, ...[
|
|
124
|
-
themeValue,
|
|
125
|
-
...extensions
|
|
126
|
-
].map((e)=>value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
|
|
127
|
-
});
|
|
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
|
-
}
|
|
151
|
-
function resolveFunctionKeys(object) {
|
|
152
|
-
// theme('colors.red.500 / 0.5') -> ['colors', 'red', '500 / 0', '5]
|
|
153
|
-
const resolvePath = (key, defaultValue)=>{
|
|
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
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return defaultValue;
|
|
174
|
-
};
|
|
175
|
-
Object.assign(resolvePath, {
|
|
176
|
-
theme: resolvePath,
|
|
177
|
-
...configUtils
|
|
178
|
-
});
|
|
179
|
-
return Object.keys(object).reduce((resolved, key)=>{
|
|
180
|
-
resolved[key] = isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key];
|
|
181
|
-
return resolved;
|
|
182
|
-
}, {});
|
|
183
|
-
}
|
|
184
|
-
function extractPluginConfigs(configs) {
|
|
185
|
-
let allConfigs = [];
|
|
186
|
-
configs.forEach((config)=>{
|
|
187
|
-
allConfigs = [
|
|
188
|
-
...allConfigs,
|
|
189
|
-
config
|
|
190
|
-
];
|
|
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 : [];
|
|
193
|
-
if (plugins.length === 0) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
plugins.forEach((plugin)=>{
|
|
197
|
-
if (plugin.__isOptionsFunction) {
|
|
198
|
-
plugin = plugin();
|
|
199
|
-
}
|
|
200
|
-
var _plugin_config;
|
|
201
|
-
allConfigs = [
|
|
202
|
-
...allConfigs,
|
|
203
|
-
...extractPluginConfigs([
|
|
204
|
-
(_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
|
|
205
|
-
])
|
|
206
|
-
];
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
return allConfigs;
|
|
210
|
-
}
|
|
211
|
-
function resolveCorePlugins(corePluginConfigs) {
|
|
212
|
-
const result = [
|
|
213
|
-
...corePluginConfigs
|
|
214
|
-
].reduceRight((resolved, corePluginConfig)=>{
|
|
215
|
-
if (isFunction(corePluginConfig)) {
|
|
216
|
-
return corePluginConfig({
|
|
217
|
-
corePlugins: resolved
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
return (0, _configurePlugins.default)(corePluginConfig, resolved);
|
|
221
|
-
}, _corePluginList.default);
|
|
222
|
-
return result;
|
|
223
|
-
}
|
|
224
|
-
function resolvePluginLists(pluginLists) {
|
|
225
|
-
const result = [
|
|
226
|
-
...pluginLists
|
|
227
|
-
].reduceRight((resolved, pluginList)=>{
|
|
228
|
-
return [
|
|
229
|
-
...resolved,
|
|
230
|
-
...pluginList
|
|
231
|
-
];
|
|
232
|
-
}, []);
|
|
233
|
-
return result;
|
|
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
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
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
|
-
}
|
|
25
|
-
function resolveConfigPath(pathOrConfig) {
|
|
26
|
-
// require('tailwindcss')({ theme: ..., variants: ... })
|
|
27
|
-
if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
// require('tailwindcss')({ config: 'custom-config.js' })
|
|
31
|
-
if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isString(pathOrConfig.config)) {
|
|
32
|
-
return _path.default.resolve(pathOrConfig.config);
|
|
33
|
-
}
|
|
34
|
-
// require('tailwindcss')({ config: { theme: ..., variants: ... } })
|
|
35
|
-
if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isObject(pathOrConfig.config)) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
// require('tailwindcss')('custom-config.js')
|
|
39
|
-
if (isString(pathOrConfig)) {
|
|
40
|
-
return _path.default.resolve(pathOrConfig);
|
|
41
|
-
}
|
|
42
|
-
// require('tailwindcss')
|
|
43
|
-
for (const configFile of [
|
|
44
|
-
"./tailwind.config.js",
|
|
45
|
-
"./tailwind.config.cjs"
|
|
46
|
-
]){
|
|
47
|
-
try {
|
|
48
|
-
const configPath = _path.default.resolve(configFile);
|
|
49
|
-
_fs.default.accessSync(configPath);
|
|
50
|
-
return configPath;
|
|
51
|
-
} catch (err) {}
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
package/lib/util/responsive.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
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
|
-
}
|
|
16
|
-
function responsive(rules) {
|
|
17
|
-
return _postcss.default.atRule({
|
|
18
|
-
name: "responsive"
|
|
19
|
-
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [
|
|
20
|
-
rules
|
|
21
|
-
]));
|
|
22
|
-
}
|