tailwindcss 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- package/lib/cli/build/deps.js +17 -9
- package/lib/cli/build/index.js +10 -8
- package/lib/cli/build/plugin.js +27 -25
- package/lib/cli/build/utils.js +18 -8
- package/lib/cli/build/watching.js +12 -10
- package/lib/cli/help/index.js +6 -4
- package/lib/cli/index.js +4 -4
- package/lib/cli/init/index.js +8 -6
- package/lib/cli-peer-dependencies.js +12 -4
- package/lib/cli.js +1 -1
- package/lib/corePluginList.js +3 -1
- package/lib/corePlugins.js +41 -35
- package/lib/featureFlags.js +14 -9
- package/lib/index.js +1 -5
- package/lib/lib/cacheInvalidation.js +7 -5
- package/lib/lib/collapseAdjacentRules.js +3 -1
- package/lib/lib/collapseDuplicateDeclarations.js +10 -8
- package/lib/lib/content.js +18 -14
- package/lib/lib/defaultExtractor.js +6 -4
- package/lib/lib/detectNesting.js +3 -1
- package/lib/lib/evaluateTailwindFunctions.js +18 -16
- package/lib/lib/expandApplyAtRules.js +39 -32
- package/lib/lib/expandTailwindAtRules.js +15 -13
- package/lib/lib/findAtConfigPath.js +6 -4
- package/lib/lib/generateRules.js +37 -31
- package/lib/lib/getModuleDependencies.js +10 -8
- package/lib/lib/load-config.js +14 -8
- package/lib/lib/normalizeTailwindDirectives.js +5 -3
- package/lib/lib/offsets.js +7 -5
- package/lib/lib/partitionApplyAtRules.js +3 -1
- package/lib/lib/regex.js +21 -7
- package/lib/lib/remap-bitfield.js +3 -1
- package/lib/lib/resolveDefaultsAtRules.js +24 -20
- package/lib/lib/setupContextUtils.js +67 -57
- package/lib/lib/setupTrackingContext.js +26 -24
- package/lib/lib/sharedState.js +32 -23
- package/lib/lib/substituteScreenAtRules.js +5 -3
- package/lib/oxide/cli/build/deps.js +16 -8
- package/lib/oxide/cli/build/index.js +6 -4
- package/lib/oxide/cli/build/plugin.js +19 -17
- package/lib/oxide/cli/build/utils.js +18 -8
- package/lib/oxide/cli/build/watching.js +10 -8
- package/lib/oxide/cli/help/index.js +6 -4
- package/lib/oxide/cli/index.js +4 -4
- package/lib/oxide/cli/init/index.js +6 -4
- package/lib/plugin.js +7 -7
- package/lib/postcss-plugins/nesting/index.js +3 -1
- package/lib/postcss-plugins/nesting/plugin.js +8 -6
- package/lib/processTailwindFeatures.js +14 -12
- package/lib/public/colors.js +5 -3
- 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 +5 -3
- package/lib/public/resolve-config.js +6 -4
- package/lib/util/applyImportantSelector.js +27 -13
- 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 +3 -1
- package/lib/util/color.js +10 -6
- 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 +5 -3
- package/lib/util/dataTypes.js +45 -15
- package/lib/util/defaults.js +6 -4
- package/lib/util/escapeClassName.js +7 -5
- package/lib/util/escapeCommas.js +3 -1
- package/lib/util/flattenColorPalette.js +3 -1
- package/lib/util/formatVariantSelector.js +28 -106
- package/lib/util/getAllConfigs.js +6 -4
- 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 +3 -1
- package/lib/util/normalizeConfig.js +7 -19
- 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 +30 -18
- package/lib/util/prefixSelector.js +6 -4
- package/lib/util/pseudoElements.js +225 -0
- package/lib/util/removeAlphaVariables.js +3 -1
- package/lib/util/resolveConfig.js +10 -8
- package/lib/util/resolveConfigPath.js +9 -5
- package/lib/util/responsive.js +6 -4
- package/lib/util/splitAtTopLevelOnly.js +3 -1
- 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/package.json +30 -34
- package/peers/index.js +65828 -48819
- package/src/cli/build/plugin.js +1 -1
- package/src/cli.js +1 -1
- package/src/corePlugins.js +16 -17
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/defaultExtractor.js +1 -1
- package/src/lib/expandApplyAtRules.js +6 -0
- package/src/lib/expandTailwindAtRules.js +3 -3
- package/src/lib/load-config.ts +9 -5
- package/src/lib/setupTrackingContext.js +1 -1
- package/src/lib/sharedState.js +13 -19
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +1 -1
- package/src/util/applyImportantSelector.js +20 -12
- package/src/util/color.js +1 -1
- package/src/util/colorNames.js +150 -0
- package/src/util/formatVariantSelector.js +2 -98
- package/src/util/normalizeConfig.js +0 -17
- package/src/util/pluginUtils.js +1 -5
- package/src/util/pseudoElements.js +170 -0
- package/src/util/validateConfig.js +13 -0
- package/types/config.d.ts +1 -6
package/lib/util/createPlugin.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return createUtilityPlugin;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _transformThemeValue = /*#__PURE__*/
|
|
10
|
-
function
|
|
11
|
+
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./transformThemeValue"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
package/lib/util/dataTypes.js
CHANGED
|
@@ -9,21 +9,51 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
normalize: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
normalize: function() {
|
|
13
|
+
return normalize;
|
|
14
|
+
},
|
|
15
|
+
url: function() {
|
|
16
|
+
return url;
|
|
17
|
+
},
|
|
18
|
+
number: function() {
|
|
19
|
+
return number;
|
|
20
|
+
},
|
|
21
|
+
percentage: function() {
|
|
22
|
+
return percentage;
|
|
23
|
+
},
|
|
24
|
+
length: function() {
|
|
25
|
+
return length;
|
|
26
|
+
},
|
|
27
|
+
lineWidth: function() {
|
|
28
|
+
return lineWidth;
|
|
29
|
+
},
|
|
30
|
+
shadow: function() {
|
|
31
|
+
return shadow;
|
|
32
|
+
},
|
|
33
|
+
color: function() {
|
|
34
|
+
return color;
|
|
35
|
+
},
|
|
36
|
+
image: function() {
|
|
37
|
+
return image;
|
|
38
|
+
},
|
|
39
|
+
gradient: function() {
|
|
40
|
+
return gradient;
|
|
41
|
+
},
|
|
42
|
+
position: function() {
|
|
43
|
+
return position;
|
|
44
|
+
},
|
|
45
|
+
familyName: function() {
|
|
46
|
+
return familyName;
|
|
47
|
+
},
|
|
48
|
+
genericName: function() {
|
|
49
|
+
return genericName;
|
|
50
|
+
},
|
|
51
|
+
absoluteSize: function() {
|
|
52
|
+
return absoluteSize;
|
|
53
|
+
},
|
|
54
|
+
relativeSize: function() {
|
|
55
|
+
return relativeSize;
|
|
56
|
+
}
|
|
27
57
|
});
|
|
28
58
|
const _color = require("./color");
|
|
29
59
|
const _parseBoxShadowValue = require("./parseBoxShadowValue");
|
package/lib/util/defaults.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "defaults", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return defaults;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function defaults(target, ...sources) {
|
|
10
12
|
for (let source of sources){
|
|
@@ -14,10 +16,10 @@ function defaults(target, ...sources) {
|
|
|
14
16
|
target[k] = source[k];
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
for (let
|
|
19
|
+
for (let k of Object.getOwnPropertySymbols(source)){
|
|
18
20
|
var _target_hasOwnProperty1;
|
|
19
|
-
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target,
|
|
20
|
-
target[
|
|
21
|
+
if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
|
|
22
|
+
target[k] = source[k];
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return escapeClassName;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _escapeCommas = /*#__PURE__*/
|
|
11
|
-
function
|
|
11
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
12
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
function escapeClassName(className) {
|
|
17
19
|
var _node_raws;
|
|
18
|
-
let node =
|
|
20
|
+
let node = _postcssselectorparser.default.className();
|
|
19
21
|
node.value = className;
|
|
20
22
|
var _node_raws_value;
|
|
21
23
|
return (0, _escapeCommas.default)((_node_raws_value = node === null || node === void 0 ? void 0 : (_node_raws = node.raws) === null || _node_raws === void 0 ? void 0 : _node_raws.value) !== null && _node_raws_value !== void 0 ? _node_raws_value : node.value);
|
package/lib/util/escapeCommas.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 escapeCommas;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function escapeCommas(className) {
|
|
10
12
|
return className.replace(/\\,/g, "\\2c ");
|
|
@@ -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 _default;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
|
|
10
12
|
[color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
|
|
@@ -9,16 +9,25 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
formatVariantSelector: ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
formatVariantSelector: function() {
|
|
13
|
+
return formatVariantSelector;
|
|
14
|
+
},
|
|
15
|
+
eliminateIrrelevantSelectors: function() {
|
|
16
|
+
return eliminateIrrelevantSelectors;
|
|
17
|
+
},
|
|
18
|
+
finalizeSelector: function() {
|
|
19
|
+
return finalizeSelector;
|
|
20
|
+
},
|
|
21
|
+
handleMergePseudo: function() {
|
|
22
|
+
return handleMergePseudo;
|
|
23
|
+
}
|
|
16
24
|
});
|
|
17
|
-
const
|
|
18
|
-
const _unesc = /*#__PURE__*/
|
|
19
|
-
const _escapeClassName = /*#__PURE__*/
|
|
20
|
-
const _prefixSelector = /*#__PURE__*/
|
|
21
|
-
|
|
25
|
+
const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser"));
|
|
26
|
+
const _unesc = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser/dist/util/unesc"));
|
|
27
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName"));
|
|
28
|
+
const _prefixSelector = /*#__PURE__*/ _interop_require_default(require("../util/prefixSelector"));
|
|
29
|
+
const _pseudoElements = require("./pseudoElements");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
22
31
|
return obj && obj.__esModule ? obj : {
|
|
23
32
|
default: obj
|
|
24
33
|
};
|
|
@@ -29,18 +38,18 @@ function formatVariantSelector(formats, { context , candidate }) {
|
|
|
29
38
|
let prefix = (_context_tailwindConfig_prefix = context === null || context === void 0 ? void 0 : context.tailwindConfig.prefix) !== null && _context_tailwindConfig_prefix !== void 0 ? _context_tailwindConfig_prefix : "";
|
|
30
39
|
// Parse the format selector into an AST
|
|
31
40
|
let parsedFormats = formats.map((format)=>{
|
|
32
|
-
let ast = (0,
|
|
41
|
+
let ast = (0, _postcssselectorparser.default)().astSync(format.format);
|
|
33
42
|
return {
|
|
34
43
|
...format,
|
|
35
44
|
ast: format.isArbitraryVariant ? ast : (0, _prefixSelector.default)(prefix, ast)
|
|
36
45
|
};
|
|
37
46
|
});
|
|
38
47
|
// We start with the candidate selector
|
|
39
|
-
let formatAst =
|
|
48
|
+
let formatAst = _postcssselectorparser.default.root({
|
|
40
49
|
nodes: [
|
|
41
|
-
|
|
50
|
+
_postcssselectorparser.default.selector({
|
|
42
51
|
nodes: [
|
|
43
|
-
|
|
52
|
+
_postcssselectorparser.default.className({
|
|
44
53
|
value: (0, _escapeClassName.default)(candidate)
|
|
45
54
|
})
|
|
46
55
|
]
|
|
@@ -131,7 +140,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
131
140
|
//
|
|
132
141
|
base = base !== null && base !== void 0 ? base : candidate.split(new RegExp(`\\${separator}(?![^[]*\\])`)).pop();
|
|
133
142
|
// Parse the selector into an AST
|
|
134
|
-
let selector = (0,
|
|
143
|
+
let selector = (0, _postcssselectorparser.default)().astSync(current);
|
|
135
144
|
// Normalize escaped classes, e.g.:
|
|
136
145
|
//
|
|
137
146
|
// The idea would be to replace the escaped `base` in the selector with the
|
|
@@ -159,10 +168,10 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
159
168
|
if (formatAst === null) {
|
|
160
169
|
return selector.toString();
|
|
161
170
|
}
|
|
162
|
-
let simpleStart =
|
|
171
|
+
let simpleStart = _postcssselectorparser.default.comment({
|
|
163
172
|
value: "/*__simple__*/"
|
|
164
173
|
});
|
|
165
|
-
let simpleEnd =
|
|
174
|
+
let simpleEnd = _postcssselectorparser.default.comment({
|
|
166
175
|
value: "/*__simple__*/"
|
|
167
176
|
});
|
|
168
177
|
// We can safely replace the escaped base now, since the `base` section is
|
|
@@ -188,7 +197,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
188
197
|
// Re-sort the simple selector to ensure it's in the correct order
|
|
189
198
|
simpleSelector = simpleSelectorForNode(simpleStart);
|
|
190
199
|
let firstNode = parent.index(simpleStart);
|
|
191
|
-
parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(
|
|
200
|
+
parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(_postcssselectorparser.default.selector({
|
|
192
201
|
nodes: simpleSelector
|
|
193
202
|
})).nodes);
|
|
194
203
|
simpleStart.remove();
|
|
@@ -201,12 +210,7 @@ function finalizeSelector(current, formats, { context , candidate , base }) {
|
|
|
201
210
|
}
|
|
202
211
|
});
|
|
203
212
|
// Move pseudo elements to the end of the selector (if necessary)
|
|
204
|
-
selector.each((sel)=>
|
|
205
|
-
let pseudoElements = collectPseudoElements(sel);
|
|
206
|
-
if (pseudoElements.length > 0) {
|
|
207
|
-
sel.nodes.push(pseudoElements.sort(sortSelector));
|
|
208
|
-
}
|
|
209
|
-
});
|
|
213
|
+
selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel));
|
|
210
214
|
return selector.toString();
|
|
211
215
|
}
|
|
212
216
|
function handleMergePseudo(selector, format) {
|
|
@@ -240,7 +244,7 @@ function handleMergePseudo(selector, format) {
|
|
|
240
244
|
next = next.next();
|
|
241
245
|
}
|
|
242
246
|
let combinator = next;
|
|
243
|
-
existing.pseudo.parent.insertAfter(existing.pseudo,
|
|
247
|
+
existing.pseudo.parent.insertAfter(existing.pseudo, _postcssselectorparser.default.selector({
|
|
244
248
|
nodes: attachments.map((node)=>node.clone())
|
|
245
249
|
}));
|
|
246
250
|
pseudo.remove();
|
|
@@ -257,85 +261,3 @@ function handleMergePseudo(selector, format) {
|
|
|
257
261
|
format
|
|
258
262
|
];
|
|
259
263
|
}
|
|
260
|
-
// Note: As a rule, double colons (::) should be used instead of a single colon
|
|
261
|
-
// (:). This distinguishes pseudo-classes from pseudo-elements. However, since
|
|
262
|
-
// this distinction was not present in older versions of the W3C spec, most
|
|
263
|
-
// browsers support both syntaxes for the original pseudo-elements.
|
|
264
|
-
let pseudoElementsBC = [
|
|
265
|
-
":before",
|
|
266
|
-
":after",
|
|
267
|
-
":first-line",
|
|
268
|
-
":first-letter"
|
|
269
|
-
];
|
|
270
|
-
// These pseudo-elements _can_ be combined with other pseudo selectors AND the order does matter.
|
|
271
|
-
let pseudoElementExceptions = [
|
|
272
|
-
"::file-selector-button",
|
|
273
|
-
// Webkit scroll bar pseudo elements can be combined with user-action pseudo classes
|
|
274
|
-
"::-webkit-scrollbar",
|
|
275
|
-
"::-webkit-scrollbar-button",
|
|
276
|
-
"::-webkit-scrollbar-thumb",
|
|
277
|
-
"::-webkit-scrollbar-track",
|
|
278
|
-
"::-webkit-scrollbar-track-piece",
|
|
279
|
-
"::-webkit-scrollbar-corner",
|
|
280
|
-
"::-webkit-resizer"
|
|
281
|
-
];
|
|
282
|
-
/**
|
|
283
|
-
* This will make sure to move pseudo's to the correct spot (the end for
|
|
284
|
-
* pseudo elements) because otherwise the selector will never work
|
|
285
|
-
* anyway.
|
|
286
|
-
*
|
|
287
|
-
* E.g.:
|
|
288
|
-
* - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
|
|
289
|
-
* - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
|
|
290
|
-
*
|
|
291
|
-
* `::before:hover` doesn't work, which means that we can make it work for you by flipping the order.
|
|
292
|
-
*
|
|
293
|
-
* @param {Selector} selector
|
|
294
|
-
**/ function collectPseudoElements(selector) {
|
|
295
|
-
/** @type {Node[]} */ let nodes = [];
|
|
296
|
-
for (let node of selector.nodes){
|
|
297
|
-
if (isPseudoElement(node)) {
|
|
298
|
-
nodes.push(node);
|
|
299
|
-
selector.removeChild(node);
|
|
300
|
-
}
|
|
301
|
-
if (node === null || node === void 0 ? void 0 : node.nodes) {
|
|
302
|
-
nodes.push(...collectPseudoElements(node));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return nodes;
|
|
306
|
-
}
|
|
307
|
-
// This will make sure to move pseudo's to the correct spot (the end for
|
|
308
|
-
// pseudo elements) because otherwise the selector will never work
|
|
309
|
-
// anyway.
|
|
310
|
-
//
|
|
311
|
-
// E.g.:
|
|
312
|
-
// - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
|
|
313
|
-
// - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
|
|
314
|
-
//
|
|
315
|
-
// `::before:hover` doesn't work, which means that we can make it work
|
|
316
|
-
// for you by flipping the order.
|
|
317
|
-
function sortSelector(a, z) {
|
|
318
|
-
// Both nodes are non-pseudo's so we can safely ignore them and keep
|
|
319
|
-
// them in the same order.
|
|
320
|
-
if (a.type !== "pseudo" && z.type !== "pseudo") {
|
|
321
|
-
return 0;
|
|
322
|
-
}
|
|
323
|
-
// If one of them is a combinator, we need to keep it in the same order
|
|
324
|
-
// because that means it will start a new "section" in the selector.
|
|
325
|
-
if (a.type === "combinator" ^ z.type === "combinator") {
|
|
326
|
-
return 0;
|
|
327
|
-
}
|
|
328
|
-
// One of the items is a pseudo and the other one isn't. Let's move
|
|
329
|
-
// the pseudo to the right.
|
|
330
|
-
if (a.type === "pseudo" ^ z.type === "pseudo") {
|
|
331
|
-
return (a.type === "pseudo") - (z.type === "pseudo");
|
|
332
|
-
}
|
|
333
|
-
// Both are pseudo's, move the pseudo elements (except for
|
|
334
|
-
// ::file-selector-button) to the right.
|
|
335
|
-
return isPseudoElement(a) - isPseudoElement(z);
|
|
336
|
-
}
|
|
337
|
-
function isPseudoElement(node) {
|
|
338
|
-
if (node.type !== "pseudo") return false;
|
|
339
|
-
if (pseudoElementExceptions.includes(node.value)) return false;
|
|
340
|
-
return node.value.startsWith("::") || pseudoElementsBC.includes(node.value);
|
|
341
|
-
}
|
|
@@ -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 getAllConfigs;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _configfull = /*#__PURE__*/ _interop_require_default(require("../../stubs/config.full.js"));
|
|
10
12
|
const _featureFlags = require("../featureFlags");
|
|
11
|
-
function
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -16,7 +18,7 @@ function _interopRequireDefault(obj) {
|
|
|
16
18
|
function getAllConfigs(config) {
|
|
17
19
|
var _config_presets;
|
|
18
20
|
const configs = ((_config_presets = config === null || config === void 0 ? void 0 : config.presets) !== null && _config_presets !== void 0 ? _config_presets : [
|
|
19
|
-
|
|
21
|
+
_configfull.default
|
|
20
22
|
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
|
21
23
|
const features = {
|
|
22
24
|
// Add experimental configs here...
|
package/lib/util/hashConfig.js
CHANGED
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return hashConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
+
const _objecthash = /*#__PURE__*/ _interop_require_default(require("object-hash"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function hashConfig(config) {
|
|
16
|
-
return (0,
|
|
18
|
+
return (0, _objecthash.default)(config, {
|
|
17
19
|
ignoreUnknown: true
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -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 isKeyframeRule;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isKeyframeRule(rule) {
|
|
10
12
|
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
|
@@ -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 isPlainObject;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function isPlainObject(value) {
|
|
10
12
|
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
|
@@ -10,7 +10,9 @@ Object.defineProperty(exports, // Arbitrary values must contain balanced bracket
|
|
|
10
10
|
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
|
11
11
|
"default", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: ()
|
|
13
|
+
get: function() {
|
|
14
|
+
return isSyntacticallyValidPropertyValue;
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
let matchingBrackets = new Map([
|
|
16
18
|
[
|
package/lib/util/log.js
CHANGED
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
dim: ()
|
|
13
|
-
|
|
12
|
+
dim: function() {
|
|
13
|
+
return dim;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const _picocolors = /*#__PURE__*/
|
|
16
|
-
function
|
|
19
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
20
|
+
function _interop_require_default(obj) {
|
|
17
21
|
return obj && obj.__esModule ? obj : {
|
|
18
22
|
default: obj
|
|
19
23
|
};
|
package/lib/util/nameClass.js
CHANGED
|
@@ -9,13 +9,19 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
asClass: ()
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
asClass: function() {
|
|
13
|
+
return asClass;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return nameClass;
|
|
17
|
+
},
|
|
18
|
+
formatClass: function() {
|
|
19
|
+
return formatClass;
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
|
-
const _escapeClassName = /*#__PURE__*/
|
|
17
|
-
const _escapeCommas = /*#__PURE__*/
|
|
18
|
-
function
|
|
22
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./escapeClassName"));
|
|
23
|
+
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
19
25
|
return obj && obj.__esModule ? obj : {
|
|
20
26
|
default: obj
|
|
21
27
|
};
|
package/lib/util/negateValue.js
CHANGED
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "normalizeConfig", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return normalizeConfig;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _featureFlags = require("../featureFlags");
|
|
10
|
-
const _log = /*#__PURE__*/
|
|
12
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
12
14
|
if (typeof WeakMap !== "function") return null;
|
|
13
15
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -16,7 +18,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
16
18
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
17
19
|
})(nodeInterop);
|
|
18
20
|
}
|
|
19
|
-
function
|
|
21
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
20
22
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
21
23
|
return obj;
|
|
22
24
|
}
|
|
@@ -129,8 +131,8 @@ function normalizeConfig(config) {
|
|
|
129
131
|
}
|
|
130
132
|
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
|
131
133
|
if (typeof config.content.transform === "object") {
|
|
132
|
-
for (let
|
|
133
|
-
if (typeof
|
|
134
|
+
for (let value of Object.values(config.content.transform)){
|
|
135
|
+
if (typeof value !== "function") {
|
|
134
136
|
return false;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -276,19 +278,5 @@ function normalizeConfig(config) {
|
|
|
276
278
|
break;
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
|
-
// Warn if the line-clamp plugin is installed
|
|
280
|
-
if (config.plugins.length > 0) {
|
|
281
|
-
let plugin;
|
|
282
|
-
try {
|
|
283
|
-
plugin = require("@tailwindcss/line-clamp");
|
|
284
|
-
} catch {}
|
|
285
|
-
if (plugin && config.plugins.includes(plugin)) {
|
|
286
|
-
_log.default.warn("line-clamp-in-core", [
|
|
287
|
-
"As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.",
|
|
288
|
-
"Remove it from the `plugins` array in your configuration to eliminate this warning."
|
|
289
|
-
]);
|
|
290
|
-
config.plugins = config.plugins.filter((p)=>p !== plugin);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
281
|
return config;
|
|
294
282
|
}
|
|
@@ -33,10 +33,18 @@ function _export(target, all) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
_export(exports, {
|
|
36
|
-
normalizeScreens: ()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
normalizeScreens: function() {
|
|
37
|
+
return normalizeScreens;
|
|
38
|
+
},
|
|
39
|
+
isScreenSortable: function() {
|
|
40
|
+
return isScreenSortable;
|
|
41
|
+
},
|
|
42
|
+
compareScreens: function() {
|
|
43
|
+
return compareScreens;
|
|
44
|
+
},
|
|
45
|
+
toScreen: function() {
|
|
46
|
+
return toScreen;
|
|
47
|
+
}
|
|
40
48
|
});
|
|
41
49
|
function normalizeScreens(screens, root = true) {
|
|
42
50
|
if (Array.isArray(screens)) {
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
parseBoxShadowValue: ()
|
|
13
|
-
|
|
12
|
+
parseBoxShadowValue: function() {
|
|
13
|
+
return parseBoxShadowValue;
|
|
14
|
+
},
|
|
15
|
+
formatBoxShadowValue: function() {
|
|
16
|
+
return formatBoxShadowValue;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
|
16
20
|
let KEYWORDS = new Set([
|
|
@@ -11,7 +11,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "default", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: ()
|
|
14
|
+
get: function() {
|
|
15
|
+
return parseDependency;
|
|
16
|
+
}
|
|
15
17
|
});
|
|
16
18
|
function parseDependency(contentPath) {
|
|
17
19
|
if (contentPath.ignore) {
|
package/lib/util/parseGlob.js
CHANGED
|
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "parseGlob", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return parseGlob;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
+
const _globparent = /*#__PURE__*/ _interop_require_default(require("glob-parent"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
11
13
|
return obj && obj.__esModule ? obj : {
|
|
12
14
|
default: obj
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
function parseGlob(pattern) {
|
|
16
18
|
let glob = pattern;
|
|
17
|
-
let base = (0,
|
|
19
|
+
let base = (0, _globparent.default)(pattern);
|
|
18
20
|
if (base !== ".") {
|
|
19
21
|
glob = pattern.substr(base.length);
|
|
20
22
|
if (glob.charAt(0) === "/") {
|