tailwindcss 0.0.0-insiders.ac8fbc6 → 0.0.0-insiders.ad98a61
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 +36 -8
- package/lib/cli.js +60 -60
- package/lib/corePlugins.js +55 -46
- package/lib/featureFlags.js +3 -5
- package/lib/index.js +1 -2
- package/lib/lib/cacheInvalidation.js +32 -14
- package/lib/lib/collapseAdjacentRules.js +1 -2
- package/lib/lib/defaultExtractor.js +42 -26
- package/lib/lib/evaluateTailwindFunctions.js +8 -11
- package/lib/lib/expandApplyAtRules.js +11 -26
- package/lib/lib/expandTailwindAtRules.js +36 -22
- package/lib/lib/generateRules.js +63 -37
- package/lib/lib/regex.js +1 -2
- package/lib/lib/resolveDefaultsAtRules.js +56 -45
- package/lib/lib/setupContextUtils.js +56 -47
- package/lib/lib/setupTrackingContext.js +4 -9
- package/lib/lib/sharedState.js +1 -2
- package/lib/lib/substituteScreenAtRules.js +1 -2
- package/lib/postcss-plugins/nesting/plugin.js +1 -2
- package/lib/util/buildMediaQuery.js +1 -2
- package/lib/util/cloneDeep.js +2 -4
- package/lib/util/color.js +5 -10
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +1 -2
- package/lib/util/dataTypes.js +5 -10
- package/lib/util/flattenColorPalette.js +2 -5
- package/lib/util/formatVariantSelector.js +1 -2
- package/lib/util/getAllConfigs.js +2 -5
- package/lib/util/isValidArbitraryValue.js +1 -2
- package/lib/util/log.js +2 -3
- package/lib/util/negateValue.js +1 -2
- package/lib/util/normalizeConfig.js +33 -16
- package/lib/util/normalizeScreens.js +1 -2
- package/lib/util/parseAnimationValue.js +1 -2
- package/lib/util/pluginUtils.js +11 -3
- package/lib/util/resolveConfig.js +10 -37
- package/lib/util/splitAtTopLevelOnly.js +32 -14
- package/lib/util/withAlphaVariable.js +5 -5
- package/package.json +7 -6
- package/peers/index.js +9 -7
- package/src/cli.js +48 -28
- package/src/corePlugins.js +9 -2
- package/src/featureFlags.js +1 -1
- package/src/lib/defaultExtractor.js +7 -7
- package/src/lib/evaluateTailwindFunctions.js +3 -1
- package/src/lib/generateRules.js +21 -1
- package/src/lib/resolveDefaultsAtRules.js +53 -36
- package/src/lib/setupContextUtils.js +10 -2
- package/src/util/log.js +1 -1
- package/src/util/pluginUtils.js +13 -1
- package/src/util/resolveConfig.js +5 -33
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +1 -0
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +1 -1
- package/types/index.d.ts +7 -1
- package/types.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
- Nothing yet!
|
|
11
|
+
|
|
12
|
+
## [3.1.2] - 2022-06-10
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576))
|
|
17
|
+
- Enable `postcss-import` in the CLI by default in watch mode ([#8574](https://github.com/tailwindlabs/tailwindcss/pull/8574), [#8580](https://github.com/tailwindlabs/tailwindcss/pull/8580))
|
|
18
|
+
- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587))
|
|
19
|
+
|
|
20
|
+
## [3.1.1] - 2022-06-09
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558))
|
|
25
|
+
- Split `::backdrop` into separate defaults group ([#8567](https://github.com/tailwindlabs/tailwindcss/pull/8567))
|
|
26
|
+
- Fix postcss plugin type ([#8564](https://github.com/tailwindlabs/tailwindcss/pull/8564))
|
|
27
|
+
- Fix class detection in markdown code fences and slim templates ([#8569](https://github.com/tailwindlabs/tailwindcss/pull/8569))
|
|
28
|
+
|
|
29
|
+
## [3.1.0] - 2022-06-08
|
|
30
|
+
|
|
10
31
|
### Fixed
|
|
11
32
|
|
|
12
33
|
- Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926))
|
|
@@ -25,16 +46,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
25
46
|
- Create tailwind.config.cjs file in ESM package when running init ([#8363](https://github.com/tailwindlabs/tailwindcss/pull/8363))
|
|
26
47
|
- Fix `matchVariants` that use at-rules and placeholders ([#8392](https://github.com/tailwindlabs/tailwindcss/pull/8392))
|
|
27
48
|
- Improve types of the `tailwindcss/plugin` ([#8400](https://github.com/tailwindlabs/tailwindcss/pull/8400))
|
|
49
|
+
- Allow returning parallel variants from `addVariant` or `matchVariant` callback functions ([#8455](https://github.com/tailwindlabs/tailwindcss/pull/8455))
|
|
50
|
+
- Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
|
|
51
|
+
- Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
|
|
52
|
+
- Don't inherit `to` value from parent gradients ([#8489](https://github.com/tailwindlabs/tailwindcss/pull/8489))
|
|
53
|
+
- Remove process dependency from log functions ([#8530](https://github.com/tailwindlabs/tailwindcss/pull/8530))
|
|
54
|
+
- Ensure we can use `@import 'tailwindcss/...'` without node_modules ([#8537](https://github.com/tailwindlabs/tailwindcss/pull/8537))
|
|
28
55
|
|
|
29
56
|
### Changed
|
|
30
57
|
|
|
31
|
-
- Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
|
|
32
58
|
- Only apply hover styles when supported (future) ([#8394](https://github.com/tailwindlabs/tailwindcss/pull/8394))
|
|
59
|
+
- Respect default ring color opacity (future) ([#8448](https://github.com/tailwindlabs/tailwindcss/pull/8448), [3f4005e](https://github.com/tailwindlabs/tailwindcss/commit/3f4005e833445f7549219eb5ae89728cbb3a2630))
|
|
33
60
|
|
|
34
61
|
### Added
|
|
35
62
|
|
|
36
|
-
- Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
|
|
37
|
-
- Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
|
|
38
63
|
- Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
|
|
39
64
|
- Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
|
|
40
65
|
- Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
|
|
@@ -42,16 +67,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
42
67
|
- Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102))
|
|
43
68
|
- Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905))
|
|
44
69
|
- Add TypeScript types for the `tailwind.config.js` file ([#7891](https://github.com/tailwindlabs/tailwindcss/pull/7891))
|
|
45
|
-
- Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924))
|
|
70
|
+
- Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924), [#8526](https://github.com/tailwindlabs/tailwindcss/pull/8526))
|
|
46
71
|
- Add `grid-flow-dense` utility ([#8193](https://github.com/tailwindlabs/tailwindcss/pull/8193))
|
|
47
72
|
- Add `mix-blend-plus-lighter` utility ([#8288](https://github.com/tailwindlabs/tailwindcss/pull/8288))
|
|
48
73
|
- Add arbitrary variants ([#8299](https://github.com/tailwindlabs/tailwindcss/pull/8299))
|
|
49
|
-
- Add `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310))
|
|
74
|
+
- Add experimental `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310), [34fd0fb8](https://github.com/tailwindlabs/tailwindcss/commit/34fd0fb82aa574cddc5c7aa3ad7d1af5e3735e5d))
|
|
50
75
|
- Add `prefers-contrast` media query variants ([#8410](https://github.com/tailwindlabs/tailwindcss/pull/8410))
|
|
51
|
-
- Experimental support for variant grouping ([#8405](https://github.com/tailwindlabs/tailwindcss/pull/8405))
|
|
52
76
|
- Add opacity support when referencing colors with `theme` function ([#8416](https://github.com/tailwindlabs/tailwindcss/pull/8416))
|
|
53
77
|
- Add `postcss-import` support to the CLI ([#8437](https://github.com/tailwindlabs/tailwindcss/pull/8437))
|
|
54
|
-
- Add
|
|
78
|
+
- Add `optional` variant ([#8486](https://github.com/tailwindlabs/tailwindcss/pull/8486))
|
|
79
|
+
- Add `<alpha-value>` placeholder support for custom colors ([#8501](https://github.com/tailwindlabs/tailwindcss/pull/8501))
|
|
55
80
|
|
|
56
81
|
## [3.0.24] - 2022-04-12
|
|
57
82
|
|
|
@@ -1944,7 +1969,10 @@ No release notes
|
|
|
1944
1969
|
|
|
1945
1970
|
- Everything!
|
|
1946
1971
|
|
|
1947
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.
|
|
1972
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.2...HEAD
|
|
1973
|
+
[3.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.1...v3.1.2
|
|
1974
|
+
[3.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.0...v3.1.1
|
|
1975
|
+
[3.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.0
|
|
1948
1976
|
[3.0.24]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...v3.0.24
|
|
1949
1977
|
[3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23
|
|
1950
1978
|
[3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22
|
package/lib/cli.js
CHANGED
|
@@ -72,10 +72,8 @@ function drainStdin() {
|
|
|
72
72
|
process.stdin.on("data", (chunk)=>{
|
|
73
73
|
result += chunk;
|
|
74
74
|
});
|
|
75
|
-
process.stdin.on("end", ()=>resolve(result)
|
|
76
|
-
);
|
|
77
|
-
process.stdin.on("error", (err)=>reject(err)
|
|
78
|
-
);
|
|
75
|
+
process.stdin.on("end", ()=>resolve(result));
|
|
76
|
+
process.stdin.on("error", (err)=>reject(err));
|
|
79
77
|
});
|
|
80
78
|
}
|
|
81
79
|
function help({ message , usage , commands: commands1 , options }) {
|
|
@@ -166,10 +164,6 @@ let commands = {
|
|
|
166
164
|
type: Boolean,
|
|
167
165
|
description: `Initialize a \`${configs.postcss}\` file`
|
|
168
166
|
},
|
|
169
|
-
"--types": {
|
|
170
|
-
type: Boolean,
|
|
171
|
-
description: `Add TypeScript types for the \`${configs.tailwind}\` file`
|
|
172
|
-
},
|
|
173
167
|
"-f": "--full",
|
|
174
168
|
"-p": "--postcss"
|
|
175
169
|
}
|
|
@@ -233,16 +227,13 @@ let sharedFlags = {
|
|
|
233
227
|
},
|
|
234
228
|
"-h": "--help"
|
|
235
229
|
};
|
|
236
|
-
if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined
|
|
237
|
-
))) {
|
|
230
|
+
if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) {
|
|
238
231
|
help({
|
|
239
232
|
usage: [
|
|
240
233
|
"tailwindcss [--input input.css] [--output output.css] [--watch] [options...]",
|
|
241
|
-
"tailwindcss init [--full] [--postcss] [
|
|
234
|
+
"tailwindcss init [--full] [--postcss] [options...]",
|
|
242
235
|
],
|
|
243
|
-
commands: Object.keys(commands).filter((command2)=>command2 !== "build"
|
|
244
|
-
).map((command3)=>`${command3} [options]`
|
|
245
|
-
),
|
|
236
|
+
commands: Object.keys(commands).filter((command2)=>command2 !== "build").map((command3)=>`${command3} [options]`),
|
|
246
237
|
options: {
|
|
247
238
|
...commands.build.args,
|
|
248
239
|
...sharedFlags
|
|
@@ -250,8 +241,7 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
|
|
|
250
241
|
});
|
|
251
242
|
process.exit(0);
|
|
252
243
|
}
|
|
253
|
-
let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg
|
|
254
|
-
)(process.argv[2]) || "build";
|
|
244
|
+
let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build";
|
|
255
245
|
if (commands[command] === undefined) {
|
|
256
246
|
if (_fs.default.existsSync(_path.default.resolve(command))) {
|
|
257
247
|
// TODO: Deprecate this in future versions
|
|
@@ -263,9 +253,7 @@ if (commands[command] === undefined) {
|
|
|
263
253
|
usage: [
|
|
264
254
|
"tailwindcss <command> [options]"
|
|
265
255
|
],
|
|
266
|
-
commands: Object.keys(commands).filter((command4)=>command4 !== "build"
|
|
267
|
-
).map((command5)=>`${command5} [options]`
|
|
268
|
-
),
|
|
256
|
+
commands: Object.keys(commands).filter((command4)=>command4 !== "build").map((command5)=>`${command5} [options]`),
|
|
269
257
|
options: sharedFlags
|
|
270
258
|
});
|
|
271
259
|
process.exit(1);
|
|
@@ -284,8 +272,7 @@ let args = (()=>{
|
|
|
284
272
|
}).map(([key, value])=>[
|
|
285
273
|
key,
|
|
286
274
|
typeof value === "object" ? value.type : value
|
|
287
|
-
]
|
|
288
|
-
)), {
|
|
275
|
+
])), {
|
|
289
276
|
permissive: true
|
|
290
277
|
});
|
|
291
278
|
// Manual parsing of flags to allow for special flags like oneOf(Boolean, String)
|
|
@@ -357,10 +344,6 @@ function init() {
|
|
|
357
344
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
358
345
|
} else {
|
|
359
346
|
let stubFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../stubs/defaultConfig.stub.js") : _path.default.resolve(__dirname, "../stubs/simpleConfig.stub.js"), "utf8");
|
|
360
|
-
if (args["--types"]) {
|
|
361
|
-
let typesHeading = "/** @type {import('tailwindcss/types').Config} */";
|
|
362
|
-
stubFile = stubFile.replace(`module.exports = `, `${typesHeading}\nconst config = `) + "\nmodule.exports = config";
|
|
363
|
-
}
|
|
364
347
|
// Change colors import
|
|
365
348
|
stubFile = stubFile.replace("../colors", "tailwindcss/colors");
|
|
366
349
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
|
@@ -406,8 +389,7 @@ async function build() {
|
|
|
406
389
|
console.error(`Specified config file ${args["--config"]} does not exist.`);
|
|
407
390
|
process.exit(9);
|
|
408
391
|
}
|
|
409
|
-
let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null
|
|
410
|
-
)(_path.default.resolve(`./${configs.tailwind}`));
|
|
392
|
+
let configPath = args["--config"] ? args["--config"] : ((defaultPath)=>_fs.default.existsSync(defaultPath) ? defaultPath : null)(_path.default.resolve(`./${configs.tailwind}`));
|
|
411
393
|
async function loadPostCssPlugins() {
|
|
412
394
|
let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
|
|
413
395
|
let config1 = customPostCssPath ? await (async ()=>{
|
|
@@ -446,6 +428,43 @@ async function build() {
|
|
|
446
428
|
config1.options
|
|
447
429
|
];
|
|
448
430
|
}
|
|
431
|
+
function loadBuiltinPostcssPlugins() {
|
|
432
|
+
let postcss = loadPostcss();
|
|
433
|
+
let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
|
|
434
|
+
return [
|
|
435
|
+
[
|
|
436
|
+
(root)=>{
|
|
437
|
+
root.walkAtRules("import", (rule)=>{
|
|
438
|
+
if (rule.params.slice(1).startsWith("tailwindcss/")) {
|
|
439
|
+
rule.after(postcss.comment({
|
|
440
|
+
text: IMPORT_COMMENT + rule.params
|
|
441
|
+
}));
|
|
442
|
+
rule.remove();
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
},
|
|
446
|
+
(()=>{
|
|
447
|
+
try {
|
|
448
|
+
return require("postcss-import");
|
|
449
|
+
} catch {}
|
|
450
|
+
return (0, _indexJs).lazyPostcssImport();
|
|
451
|
+
})(),
|
|
452
|
+
(root)=>{
|
|
453
|
+
root.walkComments((rule)=>{
|
|
454
|
+
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
|
455
|
+
rule.after(postcss.atRule({
|
|
456
|
+
name: "import",
|
|
457
|
+
params: rule.text.replace(IMPORT_COMMENT, "")
|
|
458
|
+
}));
|
|
459
|
+
rule.remove();
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
},
|
|
463
|
+
],
|
|
464
|
+
[],
|
|
465
|
+
{},
|
|
466
|
+
];
|
|
467
|
+
}
|
|
449
468
|
function resolveConfig() {
|
|
450
469
|
let config = configPath ? require(configPath) : {};
|
|
451
470
|
if (args["--purge"]) {
|
|
@@ -478,8 +497,7 @@ async function build() {
|
|
|
478
497
|
// like an object it's probably a raw content object. But this object
|
|
479
498
|
// is not watchable, so let's remove it.
|
|
480
499
|
return typeof file === "string";
|
|
481
|
-
}).map((glob)=>(0, _normalizePath).default(glob)
|
|
482
|
-
);
|
|
500
|
+
}).map((glob)=>(0, _normalizePath).default(glob));
|
|
483
501
|
}
|
|
484
502
|
function extractRawContent(config) {
|
|
485
503
|
return config.content.files.filter((file)=>{
|
|
@@ -522,18 +540,7 @@ async function build() {
|
|
|
522
540
|
};
|
|
523
541
|
};
|
|
524
542
|
tailwindPlugin.postcss = true;
|
|
525
|
-
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() :
|
|
526
|
-
[
|
|
527
|
-
(()=>{
|
|
528
|
-
try {
|
|
529
|
-
return require("postcss-import");
|
|
530
|
-
} catch {}
|
|
531
|
-
return (0, _indexJs).lazyPostcssImport();
|
|
532
|
-
})(),
|
|
533
|
-
],
|
|
534
|
-
[],
|
|
535
|
-
{},
|
|
536
|
-
];
|
|
543
|
+
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : loadBuiltinPostcssPlugins();
|
|
537
544
|
let plugins = [
|
|
538
545
|
...beforePlugins,
|
|
539
546
|
tailwindPlugin,
|
|
@@ -568,13 +575,11 @@ async function build() {
|
|
|
568
575
|
let start = process.hrtime.bigint();
|
|
569
576
|
return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
|
|
570
577
|
recursive: true
|
|
571
|
-
}) : null
|
|
572
|
-
).then(()=>processor.process(css, {
|
|
578
|
+
}) : null).then(()=>processor.process(css, {
|
|
573
579
|
...postcssOptions,
|
|
574
580
|
from: input,
|
|
575
581
|
to: output
|
|
576
|
-
})
|
|
577
|
-
).then((result)=>{
|
|
582
|
+
})).then((result)=>{
|
|
578
583
|
if (!output) {
|
|
579
584
|
return process.stdout.write(result.css);
|
|
580
585
|
}
|
|
@@ -585,7 +590,7 @@ async function build() {
|
|
|
585
590
|
}).then(()=>{
|
|
586
591
|
let end = process.hrtime.bigint();
|
|
587
592
|
console.error();
|
|
588
|
-
console.error("Done in", (end - start) / BigInt(
|
|
593
|
+
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
|
589
594
|
});
|
|
590
595
|
}
|
|
591
596
|
let css1 = await (()=>{
|
|
@@ -614,8 +619,7 @@ async function build() {
|
|
|
614
619
|
delete require.cache[require.resolve(file1)];
|
|
615
620
|
}
|
|
616
621
|
if (configPath) {
|
|
617
|
-
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
|
|
618
|
-
);
|
|
622
|
+
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file);
|
|
619
623
|
for (let dependency of configDependencies){
|
|
620
624
|
contextDependencies.add(dependency);
|
|
621
625
|
}
|
|
@@ -623,10 +627,7 @@ async function build() {
|
|
|
623
627
|
env.DEBUG && console.timeEnd("Module dependencies");
|
|
624
628
|
return resolveConfig();
|
|
625
629
|
}
|
|
626
|
-
let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() :
|
|
627
|
-
[],
|
|
628
|
-
[]
|
|
629
|
-
];
|
|
630
|
+
let [beforePlugins, afterPlugins] = includePostCss ? await loadPostCssPlugins() : loadBuiltinPostcssPlugins();
|
|
630
631
|
let plugins = [
|
|
631
632
|
...beforePlugins,
|
|
632
633
|
"__TAILWIND_PLUGIN_POSITION__",
|
|
@@ -690,12 +691,10 @@ async function build() {
|
|
|
690
691
|
let start = process.hrtime.bigint();
|
|
691
692
|
return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
|
|
692
693
|
recursive: true
|
|
693
|
-
}) : null
|
|
694
|
-
).then(()=>processor.process(css, {
|
|
694
|
+
}) : null).then(()=>processor.process(css, {
|
|
695
695
|
from: input,
|
|
696
696
|
to: output
|
|
697
|
-
})
|
|
698
|
-
).then(async (result)=>{
|
|
697
|
+
})).then(async (result)=>{
|
|
699
698
|
for (let message of result.messages){
|
|
700
699
|
if (message.type === "dependency") {
|
|
701
700
|
contextDependencies.add(message.file);
|
|
@@ -713,7 +712,7 @@ async function build() {
|
|
|
713
712
|
].filter(Boolean));
|
|
714
713
|
}).then(()=>{
|
|
715
714
|
let end = process.hrtime.bigint();
|
|
716
|
-
console.error("Done in", (end - start) / BigInt(
|
|
715
|
+
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
|
717
716
|
}).catch((err)=>{
|
|
718
717
|
if (err.name === "CssSyntaxError") {
|
|
719
718
|
console.error(err.toString());
|
|
@@ -795,9 +794,10 @@ async function build() {
|
|
|
795
794
|
});
|
|
796
795
|
}
|
|
797
796
|
if (shouldWatch) {
|
|
798
|
-
/* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.
|
|
799
|
-
|
|
800
|
-
|
|
797
|
+
/* Abort the watcher if stdin is closed to avoid zombie processes */ if (process.stdin.isTTY) {
|
|
798
|
+
process.stdin.on("end", ()=>process.exit(0));
|
|
799
|
+
process.stdin.resume();
|
|
800
|
+
}
|
|
801
801
|
startWatcher();
|
|
802
802
|
} else {
|
|
803
803
|
buildOnce();
|
package/lib/corePlugins.js
CHANGED
|
@@ -25,26 +25,44 @@ function _interopRequireDefault(obj) {
|
|
|
25
25
|
default: obj
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
function _getRequireWildcardCache() {
|
|
29
|
+
if (typeof WeakMap !== "function") return null;
|
|
30
|
+
var cache = new WeakMap();
|
|
31
|
+
_getRequireWildcardCache = function() {
|
|
32
|
+
return cache;
|
|
33
|
+
};
|
|
34
|
+
return cache;
|
|
35
|
+
}
|
|
28
36
|
function _interopRequireWildcard(obj) {
|
|
29
37
|
if (obj && obj.__esModule) {
|
|
30
38
|
return obj;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
}
|
|
40
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
+
return {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var cache = _getRequireWildcardCache();
|
|
46
|
+
if (cache && cache.has(obj)) {
|
|
47
|
+
return cache.get(obj);
|
|
48
|
+
}
|
|
49
|
+
var newObj = {};
|
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
+
for(var key in obj){
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
43
58
|
}
|
|
44
59
|
}
|
|
45
|
-
newObj.default = obj;
|
|
46
|
-
return newObj;
|
|
47
60
|
}
|
|
61
|
+
newObj.default = obj;
|
|
62
|
+
if (cache) {
|
|
63
|
+
cache.set(obj, newObj);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
48
66
|
}
|
|
49
67
|
let variantPlugins = {
|
|
50
68
|
pseudoElementVariants: ({ addVariant })=>{
|
|
@@ -152,6 +170,7 @@ let variantPlugins = {
|
|
|
152
170
|
"indeterminate",
|
|
153
171
|
"placeholder-shown",
|
|
154
172
|
"autofill",
|
|
173
|
+
"optional",
|
|
155
174
|
"required",
|
|
156
175
|
"valid",
|
|
157
176
|
"invalid",
|
|
@@ -174,8 +193,7 @@ let variantPlugins = {
|
|
|
174
193
|
].map((variant)=>Array.isArray(variant) ? variant : [
|
|
175
194
|
variant,
|
|
176
195
|
`&:${variant}`
|
|
177
|
-
]
|
|
178
|
-
);
|
|
196
|
+
]);
|
|
179
197
|
for (let [variantName, state] of pseudoVariants){
|
|
180
198
|
addVariant(variantName, (ctx)=>{
|
|
181
199
|
let result = typeof state === "function" ? state(ctx) : state;
|
|
@@ -292,10 +310,7 @@ let corePlugins = {
|
|
|
292
310
|
},
|
|
293
311
|
container: (()=>{
|
|
294
312
|
function extractMinWidths(breakpoints = []) {
|
|
295
|
-
return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min
|
|
296
|
-
)
|
|
297
|
-
).filter((v)=>v !== undefined
|
|
298
|
-
);
|
|
313
|
+
return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min)).filter((v)=>v !== undefined);
|
|
299
314
|
}
|
|
300
315
|
function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
|
301
316
|
if (typeof paddings === "undefined") {
|
|
@@ -337,8 +352,7 @@ let corePlugins = {
|
|
|
337
352
|
let minWidths = extractMinWidths(screens);
|
|
338
353
|
let paddings = mapMinWidthsToPadding(minWidths, screens, theme("container.padding"));
|
|
339
354
|
let generatePaddingFor = (minWidth)=>{
|
|
340
|
-
let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth
|
|
341
|
-
);
|
|
355
|
+
let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth);
|
|
342
356
|
if (!paddingConfig) {
|
|
343
357
|
return {};
|
|
344
358
|
}
|
|
@@ -347,16 +361,14 @@ let corePlugins = {
|
|
|
347
361
|
paddingLeft: paddingConfig.padding
|
|
348
362
|
};
|
|
349
363
|
};
|
|
350
|
-
let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)
|
|
351
|
-
))).map((minWidth)=>({
|
|
364
|
+
let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)))).map((minWidth)=>({
|
|
352
365
|
[`@media (min-width: ${minWidth})`]: {
|
|
353
366
|
".container": {
|
|
354
367
|
"max-width": minWidth,
|
|
355
368
|
...generatePaddingFor(minWidth)
|
|
356
369
|
}
|
|
357
370
|
}
|
|
358
|
-
})
|
|
359
|
-
);
|
|
371
|
+
}));
|
|
360
372
|
addComponents([
|
|
361
373
|
{
|
|
362
374
|
".container": Object.assign({
|
|
@@ -1033,8 +1045,7 @@ let corePlugins = {
|
|
|
1033
1045
|
});
|
|
1034
1046
|
},
|
|
1035
1047
|
animation: ({ matchUtilities , theme , config })=>{
|
|
1036
|
-
let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}
|
|
1037
|
-
;
|
|
1048
|
+
let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}`;
|
|
1038
1049
|
var ref;
|
|
1039
1050
|
let keyframes = Object.fromEntries(Object.entries((ref = theme("keyframes")) !== null && ref !== void 0 ? ref : {}).map(([key, value])=>{
|
|
1040
1051
|
return [
|
|
@@ -1048,8 +1059,7 @@ let corePlugins = {
|
|
|
1048
1059
|
animate: (value1)=>{
|
|
1049
1060
|
let animations = (0, _parseAnimationValue).default(value1);
|
|
1050
1061
|
return [
|
|
1051
|
-
...animations.flatMap((animation)=>keyframes[animation.name]
|
|
1052
|
-
),
|
|
1062
|
+
...animations.flatMap((animation)=>keyframes[animation.name]),
|
|
1053
1063
|
{
|
|
1054
1064
|
animation: animations.map(({ name , value })=>{
|
|
1055
1065
|
if (name === undefined || keyframes[name] === undefined) {
|
|
@@ -1749,8 +1759,7 @@ let corePlugins = {
|
|
|
1749
1759
|
};
|
|
1750
1760
|
}
|
|
1751
1761
|
}, {
|
|
1752
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
1753
|
-
)((0, _flattenColorPalette).default(theme("divideColor"))),
|
|
1762
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("divideColor"))),
|
|
1754
1763
|
type: "color"
|
|
1755
1764
|
});
|
|
1756
1765
|
},
|
|
@@ -2152,8 +2161,7 @@ let corePlugins = {
|
|
|
2152
2161
|
});
|
|
2153
2162
|
}
|
|
2154
2163
|
}, {
|
|
2155
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2156
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2164
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2157
2165
|
type: [
|
|
2158
2166
|
"color"
|
|
2159
2167
|
]
|
|
@@ -2192,8 +2200,7 @@ let corePlugins = {
|
|
|
2192
2200
|
});
|
|
2193
2201
|
}
|
|
2194
2202
|
}, {
|
|
2195
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2196
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2203
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2197
2204
|
type: "color"
|
|
2198
2205
|
});
|
|
2199
2206
|
matchUtilities({
|
|
@@ -2246,8 +2253,7 @@ let corePlugins = {
|
|
|
2246
2253
|
});
|
|
2247
2254
|
}
|
|
2248
2255
|
}, {
|
|
2249
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2250
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2256
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2251
2257
|
type: "color"
|
|
2252
2258
|
});
|
|
2253
2259
|
},
|
|
@@ -2317,7 +2323,8 @@ let corePlugins = {
|
|
|
2317
2323
|
let transparentToValue = transparentTo(value);
|
|
2318
2324
|
return {
|
|
2319
2325
|
"--tw-gradient-from": (0, _toColorValue).default(value, "from"),
|
|
2320
|
-
"--tw-gradient-
|
|
2326
|
+
"--tw-gradient-to": transparentToValue,
|
|
2327
|
+
"--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)`
|
|
2321
2328
|
};
|
|
2322
2329
|
}
|
|
2323
2330
|
}, options);
|
|
@@ -2325,7 +2332,8 @@ let corePlugins = {
|
|
|
2325
2332
|
via: (value)=>{
|
|
2326
2333
|
let transparentToValue = transparentTo(value);
|
|
2327
2334
|
return {
|
|
2328
|
-
"--tw-gradient-
|
|
2335
|
+
"--tw-gradient-to": transparentToValue,
|
|
2336
|
+
"--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue).default(value, "via")}, var(--tw-gradient-to)`
|
|
2329
2337
|
};
|
|
2330
2338
|
}
|
|
2331
2339
|
}, options);
|
|
@@ -3204,12 +3212,15 @@ let corePlugins = {
|
|
|
3204
3212
|
},
|
|
3205
3213
|
ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{
|
|
3206
3214
|
let ringColorDefault = (()=>{
|
|
3207
|
-
var ref;
|
|
3215
|
+
var ref, ref1;
|
|
3208
3216
|
if ((0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")) {
|
|
3209
3217
|
return theme("ringColor.DEFAULT");
|
|
3210
3218
|
}
|
|
3211
3219
|
let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5");
|
|
3212
|
-
|
|
3220
|
+
if (!((ref = theme("ringColor")) === null || ref === void 0 ? void 0 : ref.DEFAULT)) {
|
|
3221
|
+
return `rgb(147 197 253 / ${ringOpacityDefault})`;
|
|
3222
|
+
}
|
|
3223
|
+
return (0, _withAlphaVariable).withAlphaValue((ref1 = theme("ringColor")) === null || ref1 === void 0 ? void 0 : ref1.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`);
|
|
3213
3224
|
})();
|
|
3214
3225
|
addDefaults("ring-width", {
|
|
3215
3226
|
"--tw-ring-inset": " ",
|
|
@@ -3260,8 +3271,7 @@ let corePlugins = {
|
|
|
3260
3271
|
});
|
|
3261
3272
|
}
|
|
3262
3273
|
}, {
|
|
3263
|
-
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT"
|
|
3264
|
-
)),
|
|
3274
|
+
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")),
|
|
3265
3275
|
type: "color"
|
|
3266
3276
|
});
|
|
3267
3277
|
},
|
|
@@ -3343,8 +3353,7 @@ let corePlugins = {
|
|
|
3343
3353
|
matchUtilities({
|
|
3344
3354
|
"drop-shadow": (value)=>{
|
|
3345
3355
|
return {
|
|
3346
|
-
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`
|
|
3347
|
-
).join(" ") : `drop-shadow(${value})`,
|
|
3356
|
+
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`,
|
|
3348
3357
|
"@defaults filter": {},
|
|
3349
3358
|
filter: cssFilterValue
|
|
3350
3359
|
};
|
package/lib/featureFlags.js
CHANGED
|
@@ -22,7 +22,7 @@ let featureFlags = {
|
|
|
22
22
|
],
|
|
23
23
|
experimental: [
|
|
24
24
|
"optimizeUniversalDefaults",
|
|
25
|
-
"variantGrouping
|
|
25
|
+
"matchVariant" /* , 'variantGrouping' */
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
28
|
function flagEnabled(config, flag) {
|
|
@@ -43,16 +43,14 @@ function experimentalFlagsEnabled(config) {
|
|
|
43
43
|
return featureFlags.experimental;
|
|
44
44
|
}
|
|
45
45
|
var ref;
|
|
46
|
-
return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]
|
|
47
|
-
);
|
|
46
|
+
return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
|
|
48
47
|
}
|
|
49
48
|
function issueFlagNotices(config) {
|
|
50
49
|
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
52
|
if (experimentalFlagsEnabled(config).length > 0) {
|
|
54
|
-
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)
|
|
55
|
-
).join(", ");
|
|
53
|
+
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", ");
|
|
56
54
|
_log.default.warn("experimental-flags-enabled", [
|
|
57
55
|
`You have enabled experimental features: ${changes}`,
|
|
58
56
|
"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time.",
|
package/lib/index.js
CHANGED
|
@@ -19,8 +19,7 @@ module.exports = function tailwindcss(configOrPath) {
|
|
|
19
19
|
function(root, result) {
|
|
20
20
|
let context = (0, _setupTrackingContext).default(configOrPath);
|
|
21
21
|
if (root.type === "document") {
|
|
22
|
-
let roots = root.nodes.filter((node)=>node.type === "root"
|
|
23
|
-
);
|
|
22
|
+
let roots = root.nodes.filter((node)=>node.type === "root");
|
|
24
23
|
for (const root1 of roots){
|
|
25
24
|
if (root1.type === "root") {
|
|
26
25
|
(0, _processTailwindFeatures).default(context)(root1, result);
|
|
@@ -10,26 +10,44 @@ function _interopRequireDefault(obj) {
|
|
|
10
10
|
default: obj
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
function _getRequireWildcardCache() {
|
|
14
|
+
if (typeof WeakMap !== "function") return null;
|
|
15
|
+
var cache = new WeakMap();
|
|
16
|
+
_getRequireWildcardCache = function() {
|
|
17
|
+
return cache;
|
|
18
|
+
};
|
|
19
|
+
return cache;
|
|
20
|
+
}
|
|
13
21
|
function _interopRequireWildcard(obj) {
|
|
14
22
|
if (obj && obj.__esModule) {
|
|
15
23
|
return obj;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
}
|
|
25
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
26
|
+
return {
|
|
27
|
+
default: obj
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var cache = _getRequireWildcardCache();
|
|
31
|
+
if (cache && cache.has(obj)) {
|
|
32
|
+
return cache.get(obj);
|
|
33
|
+
}
|
|
34
|
+
var newObj = {};
|
|
35
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
36
|
+
for(var key in obj){
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
38
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
39
|
+
if (desc && (desc.get || desc.set)) {
|
|
40
|
+
Object.defineProperty(newObj, key, desc);
|
|
41
|
+
} else {
|
|
42
|
+
newObj[key] = obj[key];
|
|
28
43
|
}
|
|
29
44
|
}
|
|
30
|
-
newObj.default = obj;
|
|
31
|
-
return newObj;
|
|
32
45
|
}
|
|
46
|
+
newObj.default = obj;
|
|
47
|
+
if (cache) {
|
|
48
|
+
cache.set(obj, newObj);
|
|
49
|
+
}
|
|
50
|
+
return newObj;
|
|
33
51
|
}
|
|
34
52
|
/**
|
|
35
53
|
* Calculate the hash of a string.
|