tailwindcss 3.3.1 → 3.3.3
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 +47 -6
- package/lib/cli/build/deps.js +17 -9
- package/lib/cli/build/index.js +10 -8
- package/lib/cli/build/plugin.js +29 -27
- 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 +52 -42
- package/lib/css/preflight.css +9 -0
- 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 +20 -16
- package/lib/lib/expandApplyAtRules.js +37 -40
- package/lib/lib/expandTailwindAtRules.js +19 -17
- package/lib/lib/findAtConfigPath.js +6 -4
- package/lib/lib/generateRules.js +52 -38
- package/lib/lib/getModuleDependencies.js +10 -8
- package/lib/lib/load-config.js +5 -3
- 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 +91 -63
- package/lib/lib/setupTrackingContext.js +27 -24
- package/lib/lib/sharedState.js +28 -24
- 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 +9 -9
- package/lib/postcss-plugins/nesting/index.js +3 -1
- package/lib/postcss-plugins/nesting/plugin.js +8 -6
- package/lib/processTailwindFeatures.js +16 -14
- 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 +9 -10
- 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 +59 -21
- 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 +30 -110
- 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 -5
- 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 +209 -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 +5 -3
- package/lib/util/validateFormalSyntax.js +3 -1
- package/lib/util/withAlphaVariable.js +6 -2
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/package.json +30 -35
- package/peers/index.js +65828 -48819
- package/src/cli/build/plugin.js +3 -3
- package/src/cli.js +1 -1
- package/src/corePlugins.js +29 -24
- package/src/css/preflight.css +9 -0
- package/src/featureFlags.js +2 -3
- package/src/index.js +1 -5
- package/src/lib/defaultExtractor.js +1 -1
- package/src/lib/evaluateTailwindFunctions.js +4 -1
- package/src/lib/expandApplyAtRules.js +2 -8
- package/src/lib/expandTailwindAtRules.js +12 -10
- package/src/lib/generateRules.js +15 -8
- package/src/lib/setupContextUtils.js +18 -5
- package/src/lib/setupTrackingContext.js +2 -4
- package/src/lib/sharedState.js +0 -15
- package/src/oxide/cli/build/plugin.ts +1 -1
- package/src/plugin.js +4 -4
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/applyImportantSelector.js +2 -5
- package/src/util/color.js +1 -1
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +17 -6
- package/src/util/formatVariantSelector.js +4 -126
- package/src/util/pluginUtils.js +1 -5
- package/src/util/prefixSelector.js +1 -0
- package/src/util/pseudoElements.js +167 -0
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/config.full.js +1 -0
- package/types/generated/default-theme.d.ts +1 -0
package/lib/corePlugins.js
CHANGED
|
@@ -9,30 +9,34 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
variantPlugins: ()
|
|
13
|
-
|
|
12
|
+
variantPlugins: function() {
|
|
13
|
+
return variantPlugins;
|
|
14
|
+
},
|
|
15
|
+
corePlugins: function() {
|
|
16
|
+
return corePlugins;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const _fs = /*#__PURE__*/
|
|
16
|
-
const _path = /*#__PURE__*/
|
|
17
|
-
const _postcss = /*#__PURE__*/
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const _log = /*#__PURE__*/ _interopRequireDefault(require("./util/log"));
|
|
19
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
20
|
+
const _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
|
|
21
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
22
|
+
const _createUtilityPlugin = /*#__PURE__*/ _interop_require_default(require("./util/createUtilityPlugin"));
|
|
23
|
+
const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("./util/buildMediaQuery"));
|
|
24
|
+
const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./util/escapeClassName"));
|
|
25
|
+
const _parseAnimationValue = /*#__PURE__*/ _interop_require_default(require("./util/parseAnimationValue"));
|
|
26
|
+
const _flattenColorPalette = /*#__PURE__*/ _interop_require_default(require("./util/flattenColorPalette"));
|
|
27
|
+
const _withAlphaVariable = /*#__PURE__*/ _interop_require_wildcard(require("./util/withAlphaVariable"));
|
|
28
|
+
const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./util/toColorValue"));
|
|
29
|
+
const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./util/isPlainObject"));
|
|
30
|
+
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./util/transformThemeValue"));
|
|
31
|
+
const _packagejson = require("../package.json");
|
|
32
|
+
const _log = /*#__PURE__*/ _interop_require_default(require("./util/log"));
|
|
30
33
|
const _normalizeScreens = require("./util/normalizeScreens");
|
|
31
34
|
const _parseBoxShadowValue = require("./util/parseBoxShadowValue");
|
|
32
35
|
const _removeAlphaVariables = require("./util/removeAlphaVariables");
|
|
33
36
|
const _featureFlags = require("./featureFlags");
|
|
34
37
|
const _dataTypes = require("./util/dataTypes");
|
|
35
|
-
|
|
38
|
+
const _setupContextUtils = require("./lib/setupContextUtils");
|
|
39
|
+
function _interop_require_default(obj) {
|
|
36
40
|
return obj && obj.__esModule ? obj : {
|
|
37
41
|
default: obj
|
|
38
42
|
};
|
|
@@ -45,7 +49,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
45
49
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
46
50
|
})(nodeInterop);
|
|
47
51
|
}
|
|
48
|
-
function
|
|
52
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
49
53
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
50
54
|
return obj;
|
|
51
55
|
}
|
|
@@ -132,7 +136,7 @@ let variantPlugins = {
|
|
|
132
136
|
return "&::after";
|
|
133
137
|
});
|
|
134
138
|
},
|
|
135
|
-
pseudoClassVariants: ({ addVariant , matchVariant , config })=>{
|
|
139
|
+
pseudoClassVariants: ({ addVariant , matchVariant , config , prefix })=>{
|
|
136
140
|
let pseudoVariants = [
|
|
137
141
|
// Positional
|
|
138
142
|
[
|
|
@@ -213,17 +217,17 @@ let variantPlugins = {
|
|
|
213
217
|
}
|
|
214
218
|
let variants = {
|
|
215
219
|
group: (_, { modifier })=>modifier ? [
|
|
216
|
-
`:merge(.group\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
220
|
+
`:merge(${prefix(".group")}\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
217
221
|
" &"
|
|
218
222
|
] : [
|
|
219
|
-
`:merge(.group)`,
|
|
223
|
+
`:merge(${prefix(".group")})`,
|
|
220
224
|
" &"
|
|
221
225
|
],
|
|
222
226
|
peer: (_, { modifier })=>modifier ? [
|
|
223
|
-
`:merge(.peer\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
227
|
+
`:merge(${prefix(".peer")}\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
224
228
|
" ~ &"
|
|
225
229
|
] : [
|
|
226
|
-
`:merge(.peer)`,
|
|
230
|
+
`:merge(${prefix(".peer")})`,
|
|
227
231
|
" ~ &"
|
|
228
232
|
]
|
|
229
233
|
};
|
|
@@ -252,7 +256,10 @@ let variantPlugins = {
|
|
|
252
256
|
// result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
|
|
253
257
|
return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end);
|
|
254
258
|
}, {
|
|
255
|
-
values: Object.fromEntries(pseudoVariants)
|
|
259
|
+
values: Object.fromEntries(pseudoVariants),
|
|
260
|
+
[_setupContextUtils.INTERNAL_FEATURES]: {
|
|
261
|
+
respectPrefix: false
|
|
262
|
+
}
|
|
256
263
|
});
|
|
257
264
|
}
|
|
258
265
|
},
|
|
@@ -378,11 +385,11 @@ let variantPlugins = {
|
|
|
378
385
|
});
|
|
379
386
|
// screens and min-* are sorted together when they can be
|
|
380
387
|
let id = "min-screens";
|
|
381
|
-
for (let
|
|
382
|
-
addVariant(
|
|
388
|
+
for (let screen of screens){
|
|
389
|
+
addVariant(screen.name, `@media ${(0, _buildMediaQuery.default)(screen)}`, {
|
|
383
390
|
id,
|
|
384
391
|
sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined,
|
|
385
|
-
value:
|
|
392
|
+
value: screen
|
|
386
393
|
});
|
|
387
394
|
}
|
|
388
395
|
matchVariant("min", buildScreenVariant("min"), {
|
|
@@ -484,7 +491,7 @@ let corePlugins = {
|
|
|
484
491
|
let preflightStyles = _postcss.default.parse(_fs.default.readFileSync(_path.join(__dirname, "./css/preflight.css"), "utf8"));
|
|
485
492
|
addBase([
|
|
486
493
|
_postcss.default.comment({
|
|
487
|
-
text: `! tailwindcss v${
|
|
494
|
+
text: `! tailwindcss v${_packagejson.version} | MIT License | https://tailwindcss.com`
|
|
488
495
|
}),
|
|
489
496
|
...preflightStyles.nodes
|
|
490
497
|
]);
|
|
@@ -1280,7 +1287,7 @@ let corePlugins = {
|
|
|
1280
1287
|
});
|
|
1281
1288
|
},
|
|
1282
1289
|
animation: ({ matchUtilities , theme , config })=>{
|
|
1283
|
-
let prefixName = (name)
|
|
1290
|
+
let prefixName = (name)=>(0, _escapeClassName.default)(config("prefix") + name);
|
|
1284
1291
|
var _theme;
|
|
1285
1292
|
let keyframes = Object.fromEntries(Object.entries((_theme = theme("keyframes")) !== null && _theme !== void 0 ? _theme : {}).map(([key, value])=>{
|
|
1286
1293
|
return [
|
|
@@ -1936,7 +1943,7 @@ let corePlugins = {
|
|
|
1936
1943
|
matchUtilities({
|
|
1937
1944
|
"space-x": (value)=>{
|
|
1938
1945
|
value = value === "0" ? "0px" : value;
|
|
1939
|
-
if (
|
|
1946
|
+
if (false) {
|
|
1940
1947
|
return {
|
|
1941
1948
|
"& > :not([hidden]) ~ :not([hidden])": {
|
|
1942
1949
|
"--tw-space-x-reverse": "0",
|
|
@@ -1980,7 +1987,7 @@ let corePlugins = {
|
|
|
1980
1987
|
matchUtilities({
|
|
1981
1988
|
"divide-x": (value)=>{
|
|
1982
1989
|
value = value === "0" ? "0px" : value;
|
|
1983
|
-
if (
|
|
1990
|
+
if (false) {
|
|
1984
1991
|
return {
|
|
1985
1992
|
"& > :not([hidden]) ~ :not([hidden])": {
|
|
1986
1993
|
"@defaults border-width": {},
|
|
@@ -2732,7 +2739,12 @@ let corePlugins = {
|
|
|
2732
2739
|
function transparentTo(value) {
|
|
2733
2740
|
return (0, _withAlphaVariable.withAlphaValue)(value, 0, "rgb(255 255 255 / 0)");
|
|
2734
2741
|
}
|
|
2735
|
-
return function({ matchUtilities , theme }) {
|
|
2742
|
+
return function({ matchUtilities , theme , addDefaults }) {
|
|
2743
|
+
addDefaults("gradient-color-stops", {
|
|
2744
|
+
"--tw-gradient-from-position": " ",
|
|
2745
|
+
"--tw-gradient-via-position": " ",
|
|
2746
|
+
"--tw-gradient-to-position": " "
|
|
2747
|
+
});
|
|
2736
2748
|
let options = {
|
|
2737
2749
|
values: (0, _flattenColorPalette.default)(theme("gradientColorStops")),
|
|
2738
2750
|
type: [
|
|
@@ -2751,10 +2763,9 @@ let corePlugins = {
|
|
|
2751
2763
|
from: (value)=>{
|
|
2752
2764
|
let transparentToValue = transparentTo(value);
|
|
2753
2765
|
return {
|
|
2754
|
-
"
|
|
2755
|
-
"--tw-gradient-from
|
|
2756
|
-
"--tw-gradient-to": `${transparentToValue}
|
|
2757
|
-
"--tw-gradient-to-position": " ",
|
|
2766
|
+
"@defaults gradient-color-stops": {},
|
|
2767
|
+
"--tw-gradient-from": `${(0, _toColorValue.default)(value)} var(--tw-gradient-from-position)`,
|
|
2768
|
+
"--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
2758
2769
|
"--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)`
|
|
2759
2770
|
};
|
|
2760
2771
|
}
|
|
@@ -2770,10 +2781,9 @@ let corePlugins = {
|
|
|
2770
2781
|
via: (value)=>{
|
|
2771
2782
|
let transparentToValue = transparentTo(value);
|
|
2772
2783
|
return {
|
|
2773
|
-
"
|
|
2784
|
+
"@defaults gradient-color-stops": {},
|
|
2774
2785
|
"--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
2775
|
-
"--tw-gradient-
|
|
2776
|
-
"--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue.default)(value, "via")} var(--tw-gradient-via-position), var(--tw-gradient-to)`
|
|
2786
|
+
"--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue.default)(value)} var(--tw-gradient-via-position), var(--tw-gradient-to)`
|
|
2777
2787
|
};
|
|
2778
2788
|
}
|
|
2779
2789
|
}, options);
|
|
@@ -2786,8 +2796,8 @@ let corePlugins = {
|
|
|
2786
2796
|
}, positionOptions);
|
|
2787
2797
|
matchUtilities({
|
|
2788
2798
|
to: (value)=>({
|
|
2789
|
-
"
|
|
2790
|
-
"--tw-gradient-to
|
|
2799
|
+
"@defaults gradient-color-stops": {},
|
|
2800
|
+
"--tw-gradient-to": `${(0, _toColorValue.default)(value)} var(--tw-gradient-to-position)`
|
|
2791
2801
|
})
|
|
2792
2802
|
}, options);
|
|
2793
2803
|
matchUtilities({
|
package/lib/css/preflight.css
CHANGED
|
@@ -163,6 +163,8 @@ optgroup,
|
|
|
163
163
|
select,
|
|
164
164
|
textarea {
|
|
165
165
|
font-family: inherit; /* 1 */
|
|
166
|
+
font-feature-settings: inherit; /* 1 */
|
|
167
|
+
font-variation-settings: inherit; /* 1 */
|
|
166
168
|
font-size: 100%; /* 1 */
|
|
167
169
|
font-weight: inherit; /* 1 */
|
|
168
170
|
line-height: inherit; /* 1 */
|
|
@@ -300,6 +302,13 @@ menu {
|
|
|
300
302
|
padding: 0;
|
|
301
303
|
}
|
|
302
304
|
|
|
305
|
+
/*
|
|
306
|
+
Reset default styling for dialogs.
|
|
307
|
+
*/
|
|
308
|
+
dialog {
|
|
309
|
+
padding: 0;
|
|
310
|
+
}
|
|
311
|
+
|
|
303
312
|
/*
|
|
304
313
|
Prevent resizing textareas horizontally by default.
|
|
305
314
|
*/
|
package/lib/featureFlags.js
CHANGED
|
@@ -9,14 +9,19 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
flagEnabled: ()
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
flagEnabled: function() {
|
|
13
|
+
return flagEnabled;
|
|
14
|
+
},
|
|
15
|
+
issueFlagNotices: function() {
|
|
16
|
+
return issueFlagNotices;
|
|
17
|
+
},
|
|
18
|
+
default: function() {
|
|
19
|
+
return _default;
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
|
-
const _picocolors = /*#__PURE__*/
|
|
17
|
-
const _log = /*#__PURE__*/
|
|
18
|
-
|
|
19
|
-
function _interopRequireDefault(obj) {
|
|
22
|
+
const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
|
|
23
|
+
const _log = /*#__PURE__*/ _interop_require_default(require("./util/log"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
20
25
|
return obj && obj.__esModule ? obj : {
|
|
21
26
|
default: obj
|
|
22
27
|
};
|
|
@@ -25,10 +30,10 @@ let defaults = {
|
|
|
25
30
|
optimizeUniversalDefaults: false,
|
|
26
31
|
generalizedModifiers: true,
|
|
27
32
|
get disableColorOpacityUtilitiesByDefault () {
|
|
28
|
-
return
|
|
33
|
+
return false;
|
|
29
34
|
},
|
|
30
35
|
get relativeContentPathsByDefault () {
|
|
31
|
-
return
|
|
36
|
+
return false;
|
|
32
37
|
}
|
|
33
38
|
};
|
|
34
39
|
let featureFlags = {
|
package/lib/index.js
CHANGED
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "hasContentChanged", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return hasContentChanged;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const _crypto = /*#__PURE__*/
|
|
10
|
-
const _sharedState = /*#__PURE__*/
|
|
11
|
-
function
|
|
11
|
+
const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
|
|
12
|
+
const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -21,7 +23,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
21
23
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
22
24
|
})(nodeInterop);
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
25
27
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
26
28
|
return obj;
|
|
27
29
|
}
|
|
@@ -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 collapseDuplicateDeclarations;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function collapseDuplicateDeclarations() {
|
|
10
12
|
return (root)=>{
|
|
@@ -51,21 +53,21 @@ function collapseDuplicateDeclarations() {
|
|
|
51
53
|
// with the same unit but the last one in the list.
|
|
52
54
|
for (let declarations of byProperty.values()){
|
|
53
55
|
let byUnit = new Map();
|
|
54
|
-
for (let
|
|
55
|
-
let unit = resolveUnit(
|
|
56
|
+
for (let decl of declarations){
|
|
57
|
+
let unit = resolveUnit(decl.value);
|
|
56
58
|
if (unit === null) {
|
|
57
59
|
continue;
|
|
58
60
|
}
|
|
59
61
|
if (!byUnit.has(unit)) {
|
|
60
62
|
byUnit.set(unit, new Set());
|
|
61
63
|
}
|
|
62
|
-
byUnit.get(unit).add(
|
|
64
|
+
byUnit.get(unit).add(decl);
|
|
63
65
|
}
|
|
64
|
-
for (let
|
|
66
|
+
for (let declarations of byUnit.values()){
|
|
65
67
|
// Get all but the last one
|
|
66
|
-
let removableDeclarations = Array.from(
|
|
67
|
-
for (let
|
|
68
|
-
|
|
68
|
+
let removableDeclarations = Array.from(declarations).slice(0, -1);
|
|
69
|
+
for (let decl of removableDeclarations){
|
|
70
|
+
decl.remove();
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
package/lib/lib/content.js
CHANGED
|
@@ -10,17 +10,21 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
parseCandidateFiles: ()
|
|
14
|
-
|
|
13
|
+
parseCandidateFiles: function() {
|
|
14
|
+
return parseCandidateFiles;
|
|
15
|
+
},
|
|
16
|
+
resolvedChangedContent: function() {
|
|
17
|
+
return resolvedChangedContent;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
|
-
const _fs = /*#__PURE__*/
|
|
17
|
-
const _path = /*#__PURE__*/
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
20
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
21
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
22
|
+
const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
|
|
23
|
+
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
|
24
|
+
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
|
21
25
|
const _parseGlob = require("../util/parseGlob");
|
|
22
26
|
const _sharedState = require("./sharedState");
|
|
23
|
-
function
|
|
27
|
+
function _interop_require_default(obj) {
|
|
24
28
|
return obj && obj.__esModule ? obj : {
|
|
25
29
|
default: obj
|
|
26
30
|
};
|
|
@@ -29,9 +33,9 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
29
33
|
let files = tailwindConfig.content.files;
|
|
30
34
|
// Normalize the file globs
|
|
31
35
|
files = files.filter((filePath)=>typeof filePath === "string");
|
|
32
|
-
files = files.map(
|
|
36
|
+
files = files.map(_normalizepath.default);
|
|
33
37
|
// Split into included and excluded globs
|
|
34
|
-
let tasks =
|
|
38
|
+
let tasks = _fastglob.default.generateTasks(files);
|
|
35
39
|
/** @type {ContentPath[]} */ let included = [];
|
|
36
40
|
/** @type {ContentPath[]} */ let excluded = [];
|
|
37
41
|
for (const task of tasks){
|
|
@@ -63,7 +67,7 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
63
67
|
pattern: filePath,
|
|
64
68
|
glob: null
|
|
65
69
|
};
|
|
66
|
-
if ((0,
|
|
70
|
+
if ((0, _isglob.default)(filePath)) {
|
|
67
71
|
Object.assign(contentPath, (0, _parseGlob.parseGlob)(filePath));
|
|
68
72
|
}
|
|
69
73
|
return contentPath;
|
|
@@ -77,10 +81,10 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
77
81
|
// Afaik, this technically shouldn't be needed but there's probably
|
|
78
82
|
// some internal, direct path matching with a normalized path in
|
|
79
83
|
// a package which can't handle mixed directory separators
|
|
80
|
-
let base = (0,
|
|
84
|
+
let base = (0, _normalizepath.default)(contentPath.base);
|
|
81
85
|
// If the user's file path contains any special characters (like parens) for instance fast-glob
|
|
82
86
|
// is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
|
|
83
|
-
base =
|
|
87
|
+
base = _fastglob.default.escapePath(base);
|
|
84
88
|
contentPath.pattern = contentPath.glob ? `${base}/${contentPath.glob}` : base;
|
|
85
89
|
contentPath.pattern = contentPath.ignore ? `!${contentPath.pattern}` : contentPath.pattern;
|
|
86
90
|
return contentPath;
|
|
@@ -158,7 +162,7 @@ function resolvedChangedContent(context, candidateFiles, fileModifiedMap) {
|
|
|
158
162
|
let mTimesToCommit = new Map();
|
|
159
163
|
let changedFiles = new Set();
|
|
160
164
|
_sharedState.env.DEBUG && console.time("Finding changed files");
|
|
161
|
-
let files =
|
|
165
|
+
let files = _fastglob.default.sync(paths, {
|
|
162
166
|
absolute: true
|
|
163
167
|
});
|
|
164
168
|
for (let file of files){
|
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "defaultExtractor", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return defaultExtractor;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _featureFlags = require("../featureFlags");
|
|
10
|
-
const _regex = /*#__PURE__*/
|
|
12
|
+
const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
|
|
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
|
}
|
|
@@ -77,7 +79,7 @@ function* buildRegExps(context) {
|
|
|
77
79
|
// This is a targeted fix to continue to allow theme()
|
|
78
80
|
// with square brackets to work in arbitrary properties
|
|
79
81
|
// while fixing a problem with the regex matching too much
|
|
80
|
-
/\[[^\s:'"`]+:[^\s]+?\[[^\s]
|
|
82
|
+
/\[[^\s:'"`]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
|
|
81
83
|
// Utilities
|
|
82
84
|
_regex.pattern([
|
|
83
85
|
// Utility Name / Group Name
|
package/lib/lib/detectNesting.js
CHANGED
|
@@ -4,19 +4,21 @@ 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
|
-
const _dlv = /*#__PURE__*/
|
|
10
|
-
const _didyoumean = /*#__PURE__*/
|
|
11
|
-
const _transformThemeValue = /*#__PURE__*/
|
|
12
|
-
const
|
|
11
|
+
const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv"));
|
|
12
|
+
const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean"));
|
|
13
|
+
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue"));
|
|
14
|
+
const _index = /*#__PURE__*/ _interop_require_default(require("../value-parser/index"));
|
|
13
15
|
const _normalizeScreens = require("../util/normalizeScreens");
|
|
14
|
-
const _buildMediaQuery = /*#__PURE__*/
|
|
16
|
+
const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
|
|
15
17
|
const _toPath = require("../util/toPath");
|
|
16
18
|
const _withAlphaVariable = require("../util/withAlphaVariable");
|
|
17
19
|
const _pluginUtils = require("../util/pluginUtils");
|
|
18
|
-
const _log = /*#__PURE__*/
|
|
19
|
-
function
|
|
20
|
+
const _log = /*#__PURE__*/ _interop_require_default(require("../util/log"));
|
|
21
|
+
function _interop_require_default(obj) {
|
|
20
22
|
return obj && obj.__esModule ? obj : {
|
|
21
23
|
default: obj
|
|
22
24
|
};
|
|
@@ -86,22 +88,22 @@ function validatePath(config, path, defaultValue, themeOpts = {}) {
|
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) {
|
|
89
|
-
let
|
|
91
|
+
let error = `'${pathString}' was found but does not resolve to a string.`;
|
|
90
92
|
if (isObject(value)) {
|
|
91
|
-
let
|
|
93
|
+
let validKeys = Object.keys(value).filter((key)=>validatePath(config, [
|
|
92
94
|
...pathSegments,
|
|
93
95
|
key
|
|
94
96
|
]).isValid);
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
+
if (validKeys.length) {
|
|
98
|
+
error += ` Did you mean something like '${pathToString([
|
|
97
99
|
...pathSegments,
|
|
98
|
-
|
|
100
|
+
validKeys[0]
|
|
99
101
|
])}'?`;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
return {
|
|
103
105
|
isValid: false,
|
|
104
|
-
error
|
|
106
|
+
error
|
|
105
107
|
};
|
|
106
108
|
}
|
|
107
109
|
const [themeSection] = pathSegments;
|
|
@@ -119,7 +121,7 @@ function extractArgs(node, vNodes, functions) {
|
|
|
119
121
|
if (vNode.type === "div" && vNode.value === ",") {
|
|
120
122
|
args.push("");
|
|
121
123
|
} else {
|
|
122
|
-
args[args.length - 1] +=
|
|
124
|
+
args[args.length - 1] += _index.default.stringify(vNode);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
return args;
|
|
@@ -133,7 +135,9 @@ function resolveVNode(node, vNode, functions) {
|
|
|
133
135
|
return vNode;
|
|
134
136
|
}
|
|
135
137
|
function resolveFunctions(node, input, functions) {
|
|
136
|
-
|
|
138
|
+
let hasAnyFn = Object.keys(functions).some((fn)=>input.includes(`${fn}(`));
|
|
139
|
+
if (!hasAnyFn) return input;
|
|
140
|
+
return (0, _index.default)(input).walk((vNode)=>{
|
|
137
141
|
resolveVNode(node, vNode, functions);
|
|
138
142
|
}).toString();
|
|
139
143
|
}
|