tailwindcss 0.0.0-insiders.ea10bb9 → 0.0.0-insiders.ea4e1cd
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 +1 -1
- package/lib/cli/build/deps.js +17 -9
- package/lib/cli/build/index.js +20 -10
- package/lib/cli/build/plugin.js +86 -70
- package/lib/cli/build/utils.js +18 -8
- package/lib/cli/build/watching.js +16 -12
- package/lib/cli/help/index.js +6 -4
- package/lib/cli/index.js +222 -10
- package/lib/cli/init/index.js +29 -12
- package/lib/cli-peer-dependencies.js +12 -4
- package/lib/cli.js +4 -226
- package/lib/corePluginList.js +7 -1
- package/lib/corePlugins.js +348 -75
- package/lib/css/preflight.css +2 -0
- package/lib/featureFlags.js +27 -15
- package/lib/index.js +1 -47
- package/lib/lib/cacheInvalidation.js +7 -5
- package/lib/lib/collapseAdjacentRules.js +5 -3
- package/lib/lib/collapseDuplicateDeclarations.js +12 -10
- package/lib/lib/content.js +34 -30
- package/lib/lib/defaultExtractor.js +15 -8
- package/lib/lib/detectNesting.js +10 -2
- package/lib/lib/evaluateTailwindFunctions.js +22 -20
- package/lib/lib/expandApplyAtRules.js +43 -35
- package/lib/lib/expandTailwindAtRules.js +46 -19
- package/lib/lib/findAtConfigPath.js +9 -7
- package/lib/lib/generateRules.js +157 -92
- package/lib/lib/getModuleDependencies.js +85 -37
- package/lib/lib/load-config.js +42 -0
- package/lib/lib/normalizeTailwindDirectives.js +5 -3
- package/lib/lib/offsets.js +93 -4
- package/lib/lib/partitionApplyAtRules.js +3 -1
- package/lib/lib/regex.js +21 -7
- package/lib/lib/remap-bitfield.js +89 -0
- package/lib/lib/resolveDefaultsAtRules.js +28 -24
- package/lib/lib/setupContextUtils.js +190 -131
- package/lib/lib/setupTrackingContext.js +49 -26
- package/lib/lib/sharedState.js +37 -10
- package/lib/lib/substituteScreenAtRules.js +5 -3
- package/lib/oxide/cli/build/deps.js +89 -0
- package/lib/oxide/cli/build/index.js +53 -0
- package/lib/oxide/cli/build/plugin.js +375 -0
- package/lib/oxide/cli/build/utils.js +87 -0
- package/lib/oxide/cli/build/watching.js +179 -0
- package/lib/oxide/cli/help/index.js +72 -0
- package/lib/oxide/cli/index.js +214 -0
- package/lib/oxide/cli/init/index.js +52 -0
- package/lib/oxide/cli.js +5 -0
- package/lib/oxide/postcss-plugin.js +2 -0
- package/lib/plugin.js +98 -0
- package/lib/postcss-plugins/nesting/index.js +3 -1
- package/lib/postcss-plugins/nesting/plugin.js +10 -8
- package/lib/processTailwindFeatures.js +14 -12
- package/lib/public/colors.js +49 -25
- package/lib/public/create-plugin.js +5 -3
- package/lib/public/default-config.js +6 -4
- package/lib/public/default-theme.js +6 -4
- package/lib/public/load-config.js +12 -0
- package/lib/public/resolve-config.js +6 -4
- package/lib/util/applyImportantSelector.js +36 -0
- package/lib/util/bigSign.js +3 -1
- package/lib/util/buildMediaQuery.js +3 -1
- package/lib/util/cloneDeep.js +3 -1
- package/lib/util/cloneNodes.js +5 -3
- package/lib/util/color.js +30 -12
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +3 -1
- package/lib/util/createPlugin.js +3 -1
- package/lib/util/createUtilityPlugin.js +7 -5
- package/lib/util/dataTypes.js +74 -17
- package/lib/util/defaults.js +9 -7
- package/lib/util/escapeClassName.js +10 -8
- package/lib/util/escapeCommas.js +3 -1
- package/lib/util/flattenColorPalette.js +3 -1
- package/lib/util/formatVariantSelector.js +138 -160
- package/lib/util/getAllConfigs.js +8 -6
- package/lib/util/hashConfig.js +6 -4
- package/lib/util/isKeyframeRule.js +3 -1
- package/lib/util/isPlainObject.js +3 -1
- package/lib/util/isSyntacticallyValidPropertyValue.js +3 -1
- package/lib/util/log.js +8 -4
- package/lib/util/nameClass.js +12 -6
- package/lib/util/negateValue.js +4 -2
- package/lib/util/normalizeConfig.js +28 -27
- package/lib/util/normalizeScreens.js +12 -4
- package/lib/util/parseAnimationValue.js +3 -1
- package/lib/util/parseBoxShadowValue.js +6 -2
- package/lib/util/parseDependency.js +3 -1
- package/lib/util/parseGlob.js +6 -4
- package/lib/util/parseObjectStyles.js +9 -7
- package/lib/util/pluginUtils.js +54 -54
- package/lib/util/prefixSelector.js +27 -11
- package/lib/util/pseudoElements.js +229 -0
- package/lib/util/removeAlphaVariables.js +3 -1
- package/lib/util/resolveConfig.js +17 -15
- package/lib/util/resolveConfigPath.js +26 -10
- package/lib/util/responsive.js +6 -4
- package/lib/util/splitAtTopLevelOnly.js +10 -2
- package/lib/util/tap.js +3 -1
- package/lib/util/toColorValue.js +3 -1
- package/lib/util/toPath.js +3 -1
- package/lib/util/transformThemeValue.js +6 -4
- package/lib/util/validateConfig.js +16 -3
- package/lib/util/validateFormalSyntax.js +3 -1
- package/lib/util/withAlphaVariable.js +6 -2
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/package.json +45 -37
- package/peers/index.js +63324 -46417
- package/resolveConfig.d.ts +11 -2
- package/scripts/swap-engines.js +40 -0
- package/src/cli/build/index.js +13 -9
- package/src/cli/build/plugin.js +42 -32
- package/src/cli/build/watching.js +4 -2
- package/src/cli/index.js +216 -3
- package/src/cli/init/index.js +37 -8
- package/src/cli.js +4 -220
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +207 -32
- package/src/css/preflight.css +2 -0
- package/src/featureFlags.js +6 -0
- package/src/index.js +1 -47
- package/src/lib/content.js +12 -17
- package/src/lib/defaultExtractor.js +9 -3
- package/src/lib/detectNesting.js +9 -1
- package/src/lib/expandApplyAtRules.js +8 -1
- package/src/lib/expandTailwindAtRules.js +36 -7
- package/src/lib/generateRules.js +124 -42
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +31 -0
- package/src/lib/offsets.js +104 -1
- package/src/lib/remap-bitfield.js +82 -0
- package/src/lib/setupContextUtils.js +103 -54
- package/src/lib/setupTrackingContext.js +36 -11
- package/src/lib/sharedState.js +15 -4
- package/src/oxide/cli/build/deps.ts +91 -0
- package/src/oxide/cli/build/index.ts +47 -0
- package/src/oxide/cli/build/plugin.ts +442 -0
- package/src/oxide/cli/build/utils.ts +74 -0
- package/src/oxide/cli/build/watching.ts +225 -0
- package/src/oxide/cli/help/index.ts +69 -0
- package/src/oxide/cli/index.ts +204 -0
- package/src/oxide/cli/init/index.ts +59 -0
- package/src/oxide/cli.ts +1 -0
- package/src/oxide/postcss-plugin.ts +1 -0
- package/src/plugin.js +107 -0
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +27 -0
- package/src/util/color.js +18 -3
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +33 -4
- package/src/util/formatVariantSelector.js +160 -163
- package/src/util/getAllConfigs.js +2 -2
- package/src/util/negateValue.js +1 -1
- package/src/util/normalizeConfig.js +2 -1
- package/src/util/pluginUtils.js +16 -31
- package/src/util/prefixSelector.js +28 -10
- package/src/util/pseudoElements.js +170 -0
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +8 -1
- package/src/util/validateConfig.js +13 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +183 -146
- package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
- package/stubs/postcss.config.js +6 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +15 -9
- package/types/generated/colors.d.ts +22 -0
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +108 -79
- package/CHANGELOG.md +0 -2336
- package/lib/cli/shared.js +0 -12
- package/lib/constants.js +0 -44
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/cli/shared.js +0 -5
- package/src/constants.js +0 -17
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ // There are some pseudo-elements that may or may not be:
|
|
2
|
+
// **Actionable**
|
|
3
|
+
// Zero or more user-action pseudo-classes may be attached to the pseudo-element itself
|
|
4
|
+
// structural-pseudo-classes are NOT allowed but we don't make
|
|
5
|
+
// The spec is not clear on whether this is allowed or not — but in practice it is.
|
|
6
|
+
// **Terminal**
|
|
7
|
+
// It MUST be placed at the end of a selector
|
|
8
|
+
//
|
|
9
|
+
// This is the required in the spec. However, some pseudo elements are not "terminal" because
|
|
10
|
+
// they represent a "boundary piercing" that is compiled out by a build step.
|
|
11
|
+
// **Jumpable**
|
|
12
|
+
// Any terminal element may "jump" over combinators when moving to the end of the selector
|
|
13
|
+
//
|
|
14
|
+
// This is a backwards-compat quirk of :before and :after variants.
|
|
15
|
+
/** @typedef {'terminal' | 'actionable' | 'jumpable'} PseudoProperty */ /** @type {Record<string, PseudoProperty[]>} */ "use strict";
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "movePseudos", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return movePseudos;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
let elementProperties = {
|
|
26
|
+
"::after": [
|
|
27
|
+
"terminal",
|
|
28
|
+
"jumpable"
|
|
29
|
+
],
|
|
30
|
+
"::backdrop": [
|
|
31
|
+
"terminal",
|
|
32
|
+
"jumpable"
|
|
33
|
+
],
|
|
34
|
+
"::before": [
|
|
35
|
+
"terminal",
|
|
36
|
+
"jumpable"
|
|
37
|
+
],
|
|
38
|
+
"::cue": [
|
|
39
|
+
"terminal"
|
|
40
|
+
],
|
|
41
|
+
"::cue-region": [
|
|
42
|
+
"terminal"
|
|
43
|
+
],
|
|
44
|
+
"::first-letter": [
|
|
45
|
+
"terminal",
|
|
46
|
+
"jumpable"
|
|
47
|
+
],
|
|
48
|
+
"::first-line": [
|
|
49
|
+
"terminal",
|
|
50
|
+
"jumpable"
|
|
51
|
+
],
|
|
52
|
+
"::grammar-error": [
|
|
53
|
+
"terminal"
|
|
54
|
+
],
|
|
55
|
+
"::marker": [
|
|
56
|
+
"terminal",
|
|
57
|
+
"jumpable"
|
|
58
|
+
],
|
|
59
|
+
"::part": [
|
|
60
|
+
"terminal",
|
|
61
|
+
"actionable"
|
|
62
|
+
],
|
|
63
|
+
"::placeholder": [
|
|
64
|
+
"terminal",
|
|
65
|
+
"jumpable"
|
|
66
|
+
],
|
|
67
|
+
"::selection": [
|
|
68
|
+
"terminal",
|
|
69
|
+
"jumpable"
|
|
70
|
+
],
|
|
71
|
+
"::slotted": [
|
|
72
|
+
"terminal"
|
|
73
|
+
],
|
|
74
|
+
"::spelling-error": [
|
|
75
|
+
"terminal"
|
|
76
|
+
],
|
|
77
|
+
"::target-text": [
|
|
78
|
+
"terminal"
|
|
79
|
+
],
|
|
80
|
+
// other
|
|
81
|
+
"::file-selector-button": [
|
|
82
|
+
"terminal",
|
|
83
|
+
"actionable"
|
|
84
|
+
],
|
|
85
|
+
"::-webkit-progress-bar": [
|
|
86
|
+
"terminal",
|
|
87
|
+
"actionable"
|
|
88
|
+
],
|
|
89
|
+
// Webkit scroll bar pseudo elements can be combined with user-action pseudo classes
|
|
90
|
+
"::-webkit-scrollbar": [
|
|
91
|
+
"terminal",
|
|
92
|
+
"actionable"
|
|
93
|
+
],
|
|
94
|
+
"::-webkit-scrollbar-button": [
|
|
95
|
+
"terminal",
|
|
96
|
+
"actionable"
|
|
97
|
+
],
|
|
98
|
+
"::-webkit-scrollbar-thumb": [
|
|
99
|
+
"terminal",
|
|
100
|
+
"actionable"
|
|
101
|
+
],
|
|
102
|
+
"::-webkit-scrollbar-track": [
|
|
103
|
+
"terminal",
|
|
104
|
+
"actionable"
|
|
105
|
+
],
|
|
106
|
+
"::-webkit-scrollbar-track-piece": [
|
|
107
|
+
"terminal",
|
|
108
|
+
"actionable"
|
|
109
|
+
],
|
|
110
|
+
"::-webkit-scrollbar-corner": [
|
|
111
|
+
"terminal",
|
|
112
|
+
"actionable"
|
|
113
|
+
],
|
|
114
|
+
"::-webkit-resizer": [
|
|
115
|
+
"terminal",
|
|
116
|
+
"actionable"
|
|
117
|
+
],
|
|
118
|
+
// Note: As a rule, double colons (::) should be used instead of a single colon
|
|
119
|
+
// (:). This distinguishes pseudo-classes from pseudo-elements. However, since
|
|
120
|
+
// this distinction was not present in older versions of the W3C spec, most
|
|
121
|
+
// browsers support both syntaxes for the original pseudo-elements.
|
|
122
|
+
":after": [
|
|
123
|
+
"terminal",
|
|
124
|
+
"jumpable"
|
|
125
|
+
],
|
|
126
|
+
":before": [
|
|
127
|
+
"terminal",
|
|
128
|
+
"jumpable"
|
|
129
|
+
],
|
|
130
|
+
":first-letter": [
|
|
131
|
+
"terminal",
|
|
132
|
+
"jumpable"
|
|
133
|
+
],
|
|
134
|
+
":first-line": [
|
|
135
|
+
"terminal",
|
|
136
|
+
"jumpable"
|
|
137
|
+
],
|
|
138
|
+
// The default value is used when the pseudo-element is not recognized
|
|
139
|
+
// Because it's not recognized, we don't know if it's terminal or not
|
|
140
|
+
// So we assume it can't be moved AND can have user-action pseudo classes attached to it
|
|
141
|
+
__default__: [
|
|
142
|
+
"actionable"
|
|
143
|
+
]
|
|
144
|
+
};
|
|
145
|
+
function movePseudos(sel) {
|
|
146
|
+
let [pseudos] = movablePseudos(sel);
|
|
147
|
+
// Remove all pseudo elements from their respective selectors
|
|
148
|
+
pseudos.forEach(([sel, pseudo])=>sel.removeChild(pseudo));
|
|
149
|
+
// Re-add them to the end of the selector in the correct order.
|
|
150
|
+
// This moves terminal pseudo elements to the end of the
|
|
151
|
+
// selector otherwise the selector will not be valid.
|
|
152
|
+
//
|
|
153
|
+
// Examples:
|
|
154
|
+
// - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
|
|
155
|
+
// - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
|
|
156
|
+
//
|
|
157
|
+
// The selector `::before:hover` does not work but we
|
|
158
|
+
// can make it work for you by flipping the order.
|
|
159
|
+
sel.nodes.push(...pseudos.map(([, pseudo])=>pseudo));
|
|
160
|
+
return sel;
|
|
161
|
+
}
|
|
162
|
+
/** @typedef {[sel: Selector, pseudo: Pseudo, attachedTo: Pseudo | null]} MovablePseudo */ /** @typedef {[pseudos: MovablePseudo[], lastSeenElement: Pseudo | null]} MovablePseudosResult */ /**
|
|
163
|
+
* @param {Selector} sel
|
|
164
|
+
* @returns {MovablePseudosResult}
|
|
165
|
+
*/ function movablePseudos(sel) {
|
|
166
|
+
/** @type {MovablePseudo[]} */ let buffer = [];
|
|
167
|
+
/** @type {Pseudo | null} */ let lastSeenElement = null;
|
|
168
|
+
for (let node of sel.nodes){
|
|
169
|
+
if (node.type === "combinator") {
|
|
170
|
+
buffer = buffer.filter(([, node])=>propertiesForPseudo(node).includes("jumpable"));
|
|
171
|
+
lastSeenElement = null;
|
|
172
|
+
} else if (node.type === "pseudo") {
|
|
173
|
+
if (isMovablePseudoElement(node)) {
|
|
174
|
+
lastSeenElement = node;
|
|
175
|
+
buffer.push([
|
|
176
|
+
sel,
|
|
177
|
+
node,
|
|
178
|
+
null
|
|
179
|
+
]);
|
|
180
|
+
} else if (lastSeenElement && isAttachablePseudoClass(node, lastSeenElement)) {
|
|
181
|
+
buffer.push([
|
|
182
|
+
sel,
|
|
183
|
+
node,
|
|
184
|
+
lastSeenElement
|
|
185
|
+
]);
|
|
186
|
+
} else {
|
|
187
|
+
lastSeenElement = null;
|
|
188
|
+
}
|
|
189
|
+
var _node_nodes;
|
|
190
|
+
for (let sub of (_node_nodes = node.nodes) !== null && _node_nodes !== void 0 ? _node_nodes : []){
|
|
191
|
+
let [movable, lastSeenElementInSub] = movablePseudos(sub);
|
|
192
|
+
lastSeenElement = lastSeenElementInSub || lastSeenElement;
|
|
193
|
+
buffer.push(...movable);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return [
|
|
198
|
+
buffer,
|
|
199
|
+
lastSeenElement
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @param {Node} node
|
|
204
|
+
* @returns {boolean}
|
|
205
|
+
*/ function isPseudoElement(node) {
|
|
206
|
+
return node.value.startsWith("::") || elementProperties[node.value] !== undefined;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @param {Node} node
|
|
210
|
+
* @returns {boolean}
|
|
211
|
+
*/ function isMovablePseudoElement(node) {
|
|
212
|
+
return isPseudoElement(node) && propertiesForPseudo(node).includes("terminal");
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @param {Node} node
|
|
216
|
+
* @param {Pseudo} pseudo
|
|
217
|
+
* @returns {boolean}
|
|
218
|
+
*/ function isAttachablePseudoClass(node, pseudo) {
|
|
219
|
+
if (node.type !== "pseudo") return false;
|
|
220
|
+
if (isPseudoElement(node)) return false;
|
|
221
|
+
return propertiesForPseudo(pseudo).includes("actionable");
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @param {Pseudo} pseudo
|
|
225
|
+
* @returns {PseudoProperty[]}
|
|
226
|
+
*/ function propertiesForPseudo(pseudo) {
|
|
227
|
+
var _elementProperties_pseudo_value;
|
|
228
|
+
return (_elementProperties_pseudo_value = elementProperties[pseudo.value]) !== null && _elementProperties_pseudo_value !== void 0 ? _elementProperties_pseudo_value : elementProperties.__default__;
|
|
229
|
+
}
|
|
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "removeAlphaVariables", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: ()
|
|
15
|
+
get: function() {
|
|
16
|
+
return removeAlphaVariables;
|
|
17
|
+
}
|
|
16
18
|
});
|
|
17
19
|
function removeAlphaVariables(container, toRemove) {
|
|
18
20
|
container.walkDecls((decl)=>{
|
|
@@ -4,21 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return resolveConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _negateValue = /*#__PURE__*/
|
|
10
|
-
const _corePluginList = /*#__PURE__*/
|
|
11
|
-
const _configurePlugins = /*#__PURE__*/
|
|
12
|
-
const _colors = /*#__PURE__*/
|
|
11
|
+
const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
|
|
12
|
+
const _corePluginList = /*#__PURE__*/ _interop_require_default(require("../corePluginList"));
|
|
13
|
+
const _configurePlugins = /*#__PURE__*/ _interop_require_default(require("./configurePlugins"));
|
|
14
|
+
const _colors = /*#__PURE__*/ _interop_require_default(require("../public/colors"));
|
|
13
15
|
const _defaults = require("./defaults");
|
|
14
16
|
const _toPath = require("./toPath");
|
|
15
17
|
const _normalizeConfig = require("./normalizeConfig");
|
|
16
|
-
const _isPlainObject = /*#__PURE__*/
|
|
18
|
+
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
|
|
17
19
|
const _cloneDeep = require("./cloneDeep");
|
|
18
20
|
const _pluginUtils = require("./pluginUtils");
|
|
19
21
|
const _withAlphaVariable = require("./withAlphaVariable");
|
|
20
|
-
const _toColorValue = /*#__PURE__*/
|
|
21
|
-
function
|
|
22
|
+
const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./toColorValue"));
|
|
23
|
+
function _interop_require_default(obj) {
|
|
22
24
|
return obj && obj.__esModule ? obj : {
|
|
23
25
|
default: obj
|
|
24
26
|
};
|
|
@@ -188,8 +190,8 @@ function extractPluginConfigs(configs) {
|
|
|
188
190
|
...allConfigs,
|
|
189
191
|
config
|
|
190
192
|
];
|
|
191
|
-
var
|
|
192
|
-
const plugins = (
|
|
193
|
+
var _config_plugins;
|
|
194
|
+
const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
|
|
193
195
|
if (plugins.length === 0) {
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
@@ -197,11 +199,11 @@ function extractPluginConfigs(configs) {
|
|
|
197
199
|
if (plugin.__isOptionsFunction) {
|
|
198
200
|
plugin = plugin();
|
|
199
201
|
}
|
|
200
|
-
var
|
|
202
|
+
var _plugin_config;
|
|
201
203
|
allConfigs = [
|
|
202
204
|
...allConfigs,
|
|
203
205
|
...extractPluginConfigs([
|
|
204
|
-
(
|
|
206
|
+
(_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
|
|
205
207
|
])
|
|
206
208
|
];
|
|
207
209
|
});
|
|
@@ -241,14 +243,14 @@ function resolveConfig(configs) {
|
|
|
241
243
|
separator: ":"
|
|
242
244
|
}
|
|
243
245
|
];
|
|
244
|
-
var
|
|
246
|
+
var _t_theme, _c_plugins;
|
|
245
247
|
return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
|
|
246
248
|
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
|
247
|
-
return (
|
|
249
|
+
return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
|
|
248
250
|
})))),
|
|
249
251
|
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
|
|
250
252
|
plugins: resolvePluginLists(configs.map((c)=>{
|
|
251
|
-
return (
|
|
253
|
+
return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
|
|
252
254
|
}))
|
|
253
255
|
}, ...allConfigs));
|
|
254
256
|
}
|
|
@@ -2,17 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
default: function() {
|
|
13
|
+
return resolveConfigPath;
|
|
14
|
+
},
|
|
15
|
+
resolveDefaultConfigPath: function() {
|
|
16
|
+
return resolveDefaultConfigPath;
|
|
17
|
+
}
|
|
8
18
|
});
|
|
9
|
-
const _fs = /*#__PURE__*/
|
|
10
|
-
const _path = /*#__PURE__*/
|
|
11
|
-
function
|
|
19
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
20
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
21
|
+
function _interop_require_default(obj) {
|
|
12
22
|
return obj && obj.__esModule ? obj : {
|
|
13
23
|
default: obj
|
|
14
24
|
};
|
|
15
25
|
}
|
|
26
|
+
const defaultConfigFiles = [
|
|
27
|
+
"./tailwind.config.js",
|
|
28
|
+
"./tailwind.config.cjs",
|
|
29
|
+
"./tailwind.config.mjs",
|
|
30
|
+
"./tailwind.config.ts"
|
|
31
|
+
];
|
|
16
32
|
function isObject(value) {
|
|
17
33
|
return typeof value === "object" && value !== null;
|
|
18
34
|
}
|
|
@@ -40,10 +56,10 @@ function resolveConfigPath(pathOrConfig) {
|
|
|
40
56
|
return _path.default.resolve(pathOrConfig);
|
|
41
57
|
}
|
|
42
58
|
// require('tailwindcss')
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
return resolveDefaultConfigPath();
|
|
60
|
+
}
|
|
61
|
+
function resolveDefaultConfigPath() {
|
|
62
|
+
for (const configFile of defaultConfigFiles){
|
|
47
63
|
try {
|
|
48
64
|
const configPath = _path.default.resolve(configFile);
|
|
49
65
|
_fs.default.accessSync(configPath);
|
package/lib/util/responsive.js
CHANGED
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return responsive;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _postcss = /*#__PURE__*/
|
|
10
|
-
const _cloneNodes = /*#__PURE__*/
|
|
11
|
-
function
|
|
11
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
12
|
+
const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("./cloneNodes"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -18,20 +18,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "splitAtTopLevelOnly", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: ()
|
|
21
|
+
get: function() {
|
|
22
|
+
return splitAtTopLevelOnly;
|
|
23
|
+
}
|
|
22
24
|
});
|
|
23
25
|
function splitAtTopLevelOnly(input, separator) {
|
|
24
26
|
let stack = [];
|
|
25
27
|
let parts = [];
|
|
26
28
|
let lastPos = 0;
|
|
29
|
+
let isEscaped = false;
|
|
27
30
|
for(let idx = 0; idx < input.length; idx++){
|
|
28
31
|
let char = input[idx];
|
|
29
|
-
if (stack.length === 0 && char === separator[0]) {
|
|
32
|
+
if (stack.length === 0 && char === separator[0] && !isEscaped) {
|
|
30
33
|
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
|
31
34
|
parts.push(input.slice(lastPos, idx));
|
|
32
35
|
lastPos = idx + separator.length;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
38
|
+
if (isEscaped) {
|
|
39
|
+
isEscaped = false;
|
|
40
|
+
} else if (char === "\\") {
|
|
41
|
+
isEscaped = true;
|
|
42
|
+
}
|
|
35
43
|
if (char === "(" || char === "[" || char === "{") {
|
|
36
44
|
stack.push(char);
|
|
37
45
|
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|
package/lib/util/tap.js
CHANGED
package/lib/util/toColorValue.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return toColorValue;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function toColorValue(maybeFunction) {
|
|
10
12
|
return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
|
package/lib/util/toPath.js
CHANGED
|
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "toPath", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: ()
|
|
20
|
+
get: function() {
|
|
21
|
+
return toPath;
|
|
22
|
+
}
|
|
21
23
|
});
|
|
22
24
|
function toPath(path) {
|
|
23
25
|
if (Array.isArray(path)) return path;
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return transformThemeValue;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _postcss = /*#__PURE__*/
|
|
10
|
-
const _isPlainObject = /*#__PURE__*/
|
|
11
|
-
function
|
|
11
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
12
|
+
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "validateConfig", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return validateConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _log = /*#__PURE__*/
|
|
10
|
-
function
|
|
11
|
+
const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
@@ -20,5 +22,16 @@ function validateConfig(config) {
|
|
|
20
22
|
"https://tailwindcss.com/docs/content-configuration"
|
|
21
23
|
]);
|
|
22
24
|
}
|
|
25
|
+
// Warn if the line-clamp plugin is installed
|
|
26
|
+
try {
|
|
27
|
+
let plugin = require("@tailwindcss/line-clamp");
|
|
28
|
+
if (config.plugins.includes(plugin)) {
|
|
29
|
+
_log.default.warn("line-clamp-in-core", [
|
|
30
|
+
"As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
|
|
31
|
+
"Remove it from the `plugins` array in your configuration to eliminate this warning."
|
|
32
|
+
]);
|
|
33
|
+
config.plugins = config.plugins.filter((p)=>p !== plugin);
|
|
34
|
+
}
|
|
35
|
+
} catch {}
|
|
23
36
|
return config;
|
|
24
37
|
}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "backgroundSize", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return backgroundSize;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _dataTypes = require("./dataTypes");
|
|
10
12
|
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
withAlphaValue: ()
|
|
13
|
-
|
|
12
|
+
withAlphaValue: function() {
|
|
13
|
+
return withAlphaValue;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return withAlphaVariable;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _color = require("./color");
|
|
16
20
|
function withAlphaValue(color, alphaValue, defaultValue) {
|
package/loadConfig.d.ts
ADDED
package/loadConfig.js
ADDED