tailwindcss 0.0.0-insiders.c3cf064 → 0.0.0-insiders.c44dd7b
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 +23 -7
- package/lib/cli-peer-dependencies.js +4 -0
- package/lib/cli.js +52 -46
- package/lib/corePlugins.js +73 -56
- package/lib/featureFlags.js +5 -6
- 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 +36 -20
- package/lib/lib/evaluateTailwindFunctions.js +22 -13
- 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 +70 -54
- 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 +10 -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 +57 -56
- package/lib/util/splitAtTopLevelOnly.js +32 -14
- package/lib/util/transformThemeValue.js +4 -2
- package/lib/util/withAlphaVariable.js +5 -5
- package/package.json +10 -8
- package/peers/index.js +2344 -505
- package/src/cli-peer-dependencies.js +4 -0
- package/src/cli.js +42 -16
- package/src/corePlugins.js +30 -12
- package/src/featureFlags.js +2 -2
- package/src/lib/defaultExtractor.js +2 -2
- package/src/lib/evaluateTailwindFunctions.js +20 -4
- package/src/lib/generateRules.js +21 -1
- package/src/lib/resolveDefaultsAtRules.js +53 -36
- package/src/lib/setupContextUtils.js +24 -7
- package/src/util/getAllConfigs.js +7 -0
- package/src/util/log.js +1 -1
- package/src/util/pluginUtils.js +13 -1
- package/src/util/resolveConfig.js +66 -52
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +4 -2
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +2 -1
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +19 -19
- package/types/index.d.ts +7 -1
- package/types.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Fixed
|
|
11
11
|
|
|
12
|
+
- Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558))
|
|
13
|
+
- Split `::backdrop`` into separate defaults group ([#8567](https://github.com/tailwindlabs/tailwindcss/pull/8567))
|
|
14
|
+
- Fix postcss plugin type ([#8564](https://github.com/tailwindlabs/tailwindcss/pull/8564))
|
|
15
|
+
|
|
16
|
+
## [3.1.0] - 2022-06-08
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
12
20
|
- Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926))
|
|
13
21
|
- Don’t split vars with numbers in them inside arbitrary values ([#8091](https://github.com/tailwindlabs/tailwindcss/pull/8091))
|
|
14
22
|
- Require matching prefix when detecting negatives ([#8121](https://github.com/tailwindlabs/tailwindcss/pull/8121))
|
|
@@ -25,16 +33,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
25
33
|
- Create tailwind.config.cjs file in ESM package when running init ([#8363](https://github.com/tailwindlabs/tailwindcss/pull/8363))
|
|
26
34
|
- Fix `matchVariants` that use at-rules and placeholders ([#8392](https://github.com/tailwindlabs/tailwindcss/pull/8392))
|
|
27
35
|
- Improve types of the `tailwindcss/plugin` ([#8400](https://github.com/tailwindlabs/tailwindcss/pull/8400))
|
|
36
|
+
- Allow returning parallel variants from `addVariant` or `matchVariant` callback functions ([#8455](https://github.com/tailwindlabs/tailwindcss/pull/8455))
|
|
37
|
+
- Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
|
|
38
|
+
- Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
|
|
39
|
+
- Don't inherit `to` value from parent gradients ([#8489](https://github.com/tailwindlabs/tailwindcss/pull/8489))
|
|
40
|
+
- Remove process dependency from log functions ([#8530](https://github.com/tailwindlabs/tailwindcss/pull/8530))
|
|
41
|
+
- Ensure we can use `@import 'tailwindcss/...'` without node_modules ([#8537](https://github.com/tailwindlabs/tailwindcss/pull/8537))
|
|
28
42
|
|
|
29
43
|
### Changed
|
|
30
44
|
|
|
31
|
-
- Try using local `postcss` installation first in the CLI ([#8270](https://github.com/tailwindlabs/tailwindcss/pull/8270))
|
|
32
45
|
- Only apply hover styles when supported (future) ([#8394](https://github.com/tailwindlabs/tailwindcss/pull/8394))
|
|
46
|
+
- Respect default ring color opacity (future) ([#8448](https://github.com/tailwindlabs/tailwindcss/pull/8448), [3f4005e](https://github.com/tailwindlabs/tailwindcss/commit/3f4005e833445f7549219eb5ae89728cbb3a2630))
|
|
33
47
|
|
|
34
48
|
### Added
|
|
35
49
|
|
|
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
50
|
- Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
|
|
39
51
|
- Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
|
|
40
52
|
- Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
|
|
@@ -42,13 +54,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
42
54
|
- Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102))
|
|
43
55
|
- Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905))
|
|
44
56
|
- 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))
|
|
57
|
+
- Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924), [#8526](https://github.com/tailwindlabs/tailwindcss/pull/8526))
|
|
46
58
|
- Add `grid-flow-dense` utility ([#8193](https://github.com/tailwindlabs/tailwindcss/pull/8193))
|
|
47
59
|
- Add `mix-blend-plus-lighter` utility ([#8288](https://github.com/tailwindlabs/tailwindcss/pull/8288))
|
|
48
60
|
- Add arbitrary variants ([#8299](https://github.com/tailwindlabs/tailwindcss/pull/8299))
|
|
49
|
-
- Add `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310))
|
|
61
|
+
- Add experimental `matchVariant` API ([#8310](https://github.com/tailwindlabs/tailwindcss/pull/8310), [34fd0fb8](https://github.com/tailwindlabs/tailwindcss/commit/34fd0fb82aa574cddc5c7aa3ad7d1af5e3735e5d))
|
|
50
62
|
- Add `prefers-contrast` media query variants ([#8410](https://github.com/tailwindlabs/tailwindcss/pull/8410))
|
|
51
|
-
-
|
|
63
|
+
- Add opacity support when referencing colors with `theme` function ([#8416](https://github.com/tailwindlabs/tailwindcss/pull/8416))
|
|
64
|
+
- Add `postcss-import` support to the CLI ([#8437](https://github.com/tailwindlabs/tailwindcss/pull/8437))
|
|
65
|
+
- Add `optional` variant ([#8486](https://github.com/tailwindlabs/tailwindcss/pull/8486))
|
|
66
|
+
- Add `<alpha-value>` placeholder support for custom colors ([#8501](https://github.com/tailwindlabs/tailwindcss/pull/8501))
|
|
52
67
|
|
|
53
68
|
## [3.0.24] - 2022-04-12
|
|
54
69
|
|
|
@@ -1941,7 +1956,8 @@ No release notes
|
|
|
1941
1956
|
|
|
1942
1957
|
- Everything!
|
|
1943
1958
|
|
|
1944
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0
|
|
1959
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.1.0...HEAD
|
|
1960
|
+
[3.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.0
|
|
1945
1961
|
[3.0.24]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...v3.0.24
|
|
1946
1962
|
[3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23
|
|
1947
1963
|
[3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22
|
|
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
exports.lazyPostcss = lazyPostcss;
|
|
6
|
+
exports.lazyPostcssImport = lazyPostcssImport;
|
|
6
7
|
exports.lazyAutoprefixer = lazyAutoprefixer;
|
|
7
8
|
exports.lazyCssnano = lazyCssnano;
|
|
8
9
|
function lazyPostcss() {
|
|
9
10
|
return require("postcss");
|
|
10
11
|
}
|
|
12
|
+
function lazyPostcssImport() {
|
|
13
|
+
return require("postcss-import");
|
|
14
|
+
}
|
|
11
15
|
function lazyAutoprefixer() {
|
|
12
16
|
return require("autoprefixer");
|
|
13
17
|
}
|
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 ()=>{
|
|
@@ -478,8 +460,7 @@ async function build() {
|
|
|
478
460
|
// like an object it's probably a raw content object. But this object
|
|
479
461
|
// is not watchable, so let's remove it.
|
|
480
462
|
return typeof file === "string";
|
|
481
|
-
}).map((glob)=>(0, _normalizePath).default(glob)
|
|
482
|
-
);
|
|
463
|
+
}).map((glob)=>(0, _normalizePath).default(glob));
|
|
483
464
|
}
|
|
484
465
|
function extractRawContent(config) {
|
|
485
466
|
return config.content.files.filter((file)=>{
|
|
@@ -522,10 +503,39 @@ async function build() {
|
|
|
522
503
|
};
|
|
523
504
|
};
|
|
524
505
|
tailwindPlugin.postcss = true;
|
|
506
|
+
let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
|
|
525
507
|
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins() : [
|
|
508
|
+
[
|
|
509
|
+
(root)=>{
|
|
510
|
+
root.walkAtRules("import", (rule)=>{
|
|
511
|
+
if (rule.params.slice(1).startsWith("tailwindcss/")) {
|
|
512
|
+
rule.after(postcss.comment({
|
|
513
|
+
text: IMPORT_COMMENT + rule.params
|
|
514
|
+
}));
|
|
515
|
+
rule.remove();
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
},
|
|
519
|
+
(()=>{
|
|
520
|
+
try {
|
|
521
|
+
return require("postcss-import");
|
|
522
|
+
} catch {}
|
|
523
|
+
return (0, _indexJs).lazyPostcssImport();
|
|
524
|
+
})(),
|
|
525
|
+
(root)=>{
|
|
526
|
+
root.walkComments((rule)=>{
|
|
527
|
+
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
|
528
|
+
rule.after(postcss.atRule({
|
|
529
|
+
name: "import",
|
|
530
|
+
params: rule.text.replace(IMPORT_COMMENT, "")
|
|
531
|
+
}));
|
|
532
|
+
rule.remove();
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
},
|
|
536
|
+
],
|
|
526
537
|
[],
|
|
527
|
-
|
|
528
|
-
{}
|
|
538
|
+
{},
|
|
529
539
|
];
|
|
530
540
|
let plugins = [
|
|
531
541
|
...beforePlugins,
|
|
@@ -561,13 +571,11 @@ async function build() {
|
|
|
561
571
|
let start = process.hrtime.bigint();
|
|
562
572
|
return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
|
|
563
573
|
recursive: true
|
|
564
|
-
}) : null
|
|
565
|
-
).then(()=>processor.process(css, {
|
|
574
|
+
}) : null).then(()=>processor.process(css, {
|
|
566
575
|
...postcssOptions,
|
|
567
576
|
from: input,
|
|
568
577
|
to: output
|
|
569
|
-
})
|
|
570
|
-
).then((result)=>{
|
|
578
|
+
})).then((result)=>{
|
|
571
579
|
if (!output) {
|
|
572
580
|
return process.stdout.write(result.css);
|
|
573
581
|
}
|
|
@@ -578,7 +586,7 @@ async function build() {
|
|
|
578
586
|
}).then(()=>{
|
|
579
587
|
let end = process.hrtime.bigint();
|
|
580
588
|
console.error();
|
|
581
|
-
console.error("Done in", (end - start) / BigInt(
|
|
589
|
+
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
|
582
590
|
});
|
|
583
591
|
}
|
|
584
592
|
let css1 = await (()=>{
|
|
@@ -607,8 +615,7 @@ async function build() {
|
|
|
607
615
|
delete require.cache[require.resolve(file1)];
|
|
608
616
|
}
|
|
609
617
|
if (configPath) {
|
|
610
|
-
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
|
|
611
|
-
);
|
|
618
|
+
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file);
|
|
612
619
|
for (let dependency of configDependencies){
|
|
613
620
|
contextDependencies.add(dependency);
|
|
614
621
|
}
|
|
@@ -683,12 +690,10 @@ async function build() {
|
|
|
683
690
|
let start = process.hrtime.bigint();
|
|
684
691
|
return Promise.resolve().then(()=>output ? _fs.default.promises.mkdir(_path.default.dirname(output), {
|
|
685
692
|
recursive: true
|
|
686
|
-
}) : null
|
|
687
|
-
).then(()=>processor.process(css, {
|
|
693
|
+
}) : null).then(()=>processor.process(css, {
|
|
688
694
|
from: input,
|
|
689
695
|
to: output
|
|
690
|
-
})
|
|
691
|
-
).then(async (result)=>{
|
|
696
|
+
})).then(async (result)=>{
|
|
692
697
|
for (let message of result.messages){
|
|
693
698
|
if (message.type === "dependency") {
|
|
694
699
|
contextDependencies.add(message.file);
|
|
@@ -706,7 +711,7 @@ async function build() {
|
|
|
706
711
|
].filter(Boolean));
|
|
707
712
|
}).then(()=>{
|
|
708
713
|
let end = process.hrtime.bigint();
|
|
709
|
-
console.error("Done in", (end - start) / BigInt(
|
|
714
|
+
console.error("Done in", (end - start) / BigInt(1e6) + "ms.");
|
|
710
715
|
}).catch((err)=>{
|
|
711
716
|
if (err.name === "CssSyntaxError") {
|
|
712
717
|
console.error(err.toString());
|
|
@@ -788,9 +793,10 @@ async function build() {
|
|
|
788
793
|
});
|
|
789
794
|
}
|
|
790
795
|
if (shouldWatch) {
|
|
791
|
-
/* Abort the watcher if stdin is closed to avoid zombie processes */ process.stdin.
|
|
792
|
-
|
|
793
|
-
|
|
796
|
+
/* Abort the watcher if stdin is closed to avoid zombie processes */ if (process.stdin.isTTY) {
|
|
797
|
+
process.stdin.on("end", ()=>process.exit(0));
|
|
798
|
+
process.stdin.resume();
|
|
799
|
+
}
|
|
794
800
|
startWatcher();
|
|
795
801
|
} else {
|
|
796
802
|
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);
|
|
@@ -3202,10 +3210,18 @@ let corePlugins = {
|
|
|
3202
3210
|
]
|
|
3203
3211
|
});
|
|
3204
3212
|
},
|
|
3205
|
-
ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme })=>{
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3213
|
+
ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{
|
|
3214
|
+
let ringColorDefault = (()=>{
|
|
3215
|
+
var ref, ref1;
|
|
3216
|
+
if ((0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")) {
|
|
3217
|
+
return theme("ringColor.DEFAULT");
|
|
3218
|
+
}
|
|
3219
|
+
let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5");
|
|
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})`);
|
|
3224
|
+
})();
|
|
3209
3225
|
addDefaults("ring-width", {
|
|
3210
3226
|
"--tw-ring-inset": " ",
|
|
3211
3227
|
"--tw-ring-offset-width": theme("ringOffsetWidth.DEFAULT", "0px"),
|
|
@@ -3255,21 +3271,23 @@ let corePlugins = {
|
|
|
3255
3271
|
});
|
|
3256
3272
|
}
|
|
3257
3273
|
}, {
|
|
3258
|
-
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT"
|
|
3259
|
-
)),
|
|
3274
|
+
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")),
|
|
3260
3275
|
type: "color"
|
|
3261
3276
|
});
|
|
3262
3277
|
},
|
|
3263
|
-
ringOpacity: (
|
|
3264
|
-
|
|
3265
|
-
|
|
3278
|
+
ringOpacity: (helpers)=>{
|
|
3279
|
+
let { config } = helpers;
|
|
3280
|
+
return (0, _createUtilityPlugin).default("ringOpacity", [
|
|
3266
3281
|
[
|
|
3267
|
-
"
|
|
3282
|
+
"ring-opacity",
|
|
3283
|
+
[
|
|
3284
|
+
"--tw-ring-opacity"
|
|
3285
|
+
]
|
|
3268
3286
|
]
|
|
3269
|
-
]
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
}
|
|
3287
|
+
], {
|
|
3288
|
+
filterDefault: !(0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")
|
|
3289
|
+
})(helpers);
|
|
3290
|
+
},
|
|
3273
3291
|
ringOffsetWidth: (0, _createUtilityPlugin).default("ringOffsetWidth", [
|
|
3274
3292
|
[
|
|
3275
3293
|
"ring-offset",
|
|
@@ -3335,8 +3353,7 @@ let corePlugins = {
|
|
|
3335
3353
|
matchUtilities({
|
|
3336
3354
|
"drop-shadow": (value)=>{
|
|
3337
3355
|
return {
|
|
3338
|
-
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`
|
|
3339
|
-
).join(" ") : `drop-shadow(${value})`,
|
|
3356
|
+
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`,
|
|
3340
3357
|
"@defaults filter": {},
|
|
3341
3358
|
filter: cssFilterValue
|
|
3342
3359
|
};
|
package/lib/featureFlags.js
CHANGED
|
@@ -17,11 +17,12 @@ let defaults = {
|
|
|
17
17
|
};
|
|
18
18
|
let featureFlags = {
|
|
19
19
|
future: [
|
|
20
|
-
"hoverOnlyWhenSupported"
|
|
20
|
+
"hoverOnlyWhenSupported",
|
|
21
|
+
"respectDefaultRingColorOpacity"
|
|
21
22
|
],
|
|
22
23
|
experimental: [
|
|
23
24
|
"optimizeUniversalDefaults",
|
|
24
|
-
"variantGrouping
|
|
25
|
+
"matchVariant" /* , 'variantGrouping' */
|
|
25
26
|
]
|
|
26
27
|
};
|
|
27
28
|
function flagEnabled(config, flag) {
|
|
@@ -42,16 +43,14 @@ function experimentalFlagsEnabled(config) {
|
|
|
42
43
|
return featureFlags.experimental;
|
|
43
44
|
}
|
|
44
45
|
var ref;
|
|
45
|
-
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]
|
|
46
|
-
);
|
|
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
47
|
}
|
|
48
48
|
function issueFlagNotices(config) {
|
|
49
49
|
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
if (experimentalFlagsEnabled(config).length > 0) {
|
|
53
|
-
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)
|
|
54
|
-
).join(", ");
|
|
53
|
+
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", ");
|
|
55
54
|
_log.default.warn("experimental-flags-enabled", [
|
|
56
55
|
`You have enabled experimental features: ${changes}`,
|
|
57
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);
|