tailwindcss 3.0.8 → 3.0.12
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 +53 -1
- package/lib/cli.js +49 -12
- package/lib/corePlugins.js +114 -142
- package/lib/css/preflight.css +1 -1
- package/lib/featureFlags.js +1 -3
- package/lib/index.js +1 -3
- package/lib/lib/collapseDuplicateDeclarations.js +52 -1
- package/lib/lib/defaultExtractor.js +2 -0
- package/lib/lib/expandApplyAtRules.js +0 -40
- package/lib/lib/expandTailwindAtRules.js +12 -25
- package/lib/lib/normalizeTailwindDirectives.js +8 -1
- package/lib/lib/resolveDefaultsAtRules.js +4 -4
- package/lib/lib/setupContextUtils.js +131 -69
- package/lib/lib/setupTrackingContext.js +11 -10
- package/lib/lib/sharedState.js +33 -4
- package/lib/processTailwindFeatures.js +3 -2
- package/lib/util/pluginUtils.js +1 -1
- package/package.json +7 -8
- package/peers/index.js +606 -606
- package/src/cli.js +57 -12
- package/src/corePlugins.js +121 -155
- package/src/css/preflight.css +1 -1
- package/src/featureFlags.js +1 -5
- package/src/index.js +1 -7
- package/src/lib/collapseDuplicateDeclarations.js +66 -1
- package/src/lib/defaultExtractor.js +2 -0
- package/src/lib/expandApplyAtRules.js +0 -42
- package/src/lib/expandTailwindAtRules.js +12 -21
- package/src/lib/normalizeTailwindDirectives.js +6 -1
- package/src/lib/resolveDefaultsAtRules.js +5 -5
- package/src/lib/setupContextUtils.js +108 -19
- package/src/lib/setupTrackingContext.js +11 -10
- package/src/lib/sharedState.js +40 -4
- package/src/processTailwindFeatures.js +4 -2
- package/src/util/pluginUtils.js +1 -1
- package/lib/lib/setupWatchingContext.js +0 -288
- package/src/lib/setupWatchingContext.js +0 -311
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,53 @@ 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.0.12] - 2022-01-07
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Allow use of falsy values in theme config ([#6917](https://github.com/tailwindlabs/tailwindcss/pull/6917))
|
|
17
|
+
- Ensure we can apply classes that are grouped with non-class selectors ([#6922](https://github.com/tailwindlabs/tailwindcss/pull/6922))
|
|
18
|
+
- Improve standalone CLI compatibility on Linux by switching to the `linuxstatic` build target ([#6914](https://github.com/tailwindlabs/tailwindcss/pull/6914))
|
|
19
|
+
- Ensure `@apply` works consistently with or without `@layer` ([#6938](https://github.com/tailwindlabs/tailwindcss/pull/6938))
|
|
20
|
+
- Only emit defaults when using base layer ([#6906](https://github.com/tailwindlabs/tailwindcss/pull/6906))
|
|
21
|
+
- Emit plugin defaults regardless of usage ([#6906](https://github.com/tailwindlabs/tailwindcss/pull/6906))
|
|
22
|
+
- Move default border color back to preflight ([#6906](https://github.com/tailwindlabs/tailwindcss/pull/6906))
|
|
23
|
+
- Change `experimental.optimizeUniversalDefaults` to only work with `@tailwind base` ([#6906](https://github.com/tailwindlabs/tailwindcss/pull/6906))
|
|
24
|
+
|
|
25
|
+
## [3.0.11] - 2022-01-05
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Preserve casing of CSS variables added by plugins ([#6888](https://github.com/tailwindlabs/tailwindcss/pull/6888))
|
|
30
|
+
- Ignore content paths that are passed in but don't actually exist ([#6901](https://github.com/tailwindlabs/tailwindcss/pull/6901))
|
|
31
|
+
- Revert change that applies Tailwind's defaults in isolated environments like CSS modules ([9fdc391](https://github.com/tailwindlabs/tailwindcss/commit/9fdc391d4ff93e7e350f5ce439060176b1f0162f))
|
|
32
|
+
|
|
33
|
+
## [3.0.10] - 2022-01-04
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Fix `@apply` in files without `@tailwind` directives ([#6580](https://github.com/tailwindlabs/tailwindcss/pull/6580), [#6875](https://github.com/tailwindlabs/tailwindcss/pull/6875))
|
|
38
|
+
- CLI: avoid unnecessary writes to output files ([#6550](https://github.com/tailwindlabs/tailwindcss/pull/6550))
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Allow piping data into the CLI ([#6876](https://github.com/tailwindlabs/tailwindcss/pull/6876))
|
|
43
|
+
|
|
44
|
+
## [3.0.9] - 2022-01-03
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Improve `DEBUG` flag ([#6797](https://github.com/tailwindlabs/tailwindcss/pull/6797), [#6804](https://github.com/tailwindlabs/tailwindcss/pull/6804))
|
|
49
|
+
- Ensure we can use `<` and `>` characters in modifiers ([#6851](https://github.com/tailwindlabs/tailwindcss/pull/6851))
|
|
50
|
+
- Validate `theme()` works in arbitrary values ([#6852](https://github.com/tailwindlabs/tailwindcss/pull/6852))
|
|
51
|
+
- Properly detect `theme()` value usage in arbitrary properties ([#6854](https://github.com/tailwindlabs/tailwindcss/pull/6854))
|
|
52
|
+
- Improve collapsing of duplicate declarations ([#6856](https://github.com/tailwindlabs/tailwindcss/pull/6856))
|
|
53
|
+
- Remove support for `TAILWIND_MODE=watch` ([#6858](https://github.com/tailwindlabs/tailwindcss/pull/6858))
|
|
54
|
+
|
|
55
|
+
## [3.0.8] - 2021-12-28
|
|
56
|
+
|
|
10
57
|
### Fixed
|
|
11
58
|
|
|
12
59
|
- Reduce specificity of `abbr` rule in preflight ([#6671](https://github.com/tailwindlabs/tailwindcss/pull/6671))
|
|
@@ -1745,7 +1792,12 @@ No release notes
|
|
|
1745
1792
|
|
|
1746
1793
|
- Everything!
|
|
1747
1794
|
|
|
1748
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.
|
|
1795
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...HEAD
|
|
1796
|
+
[3.0.12]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...v3.0.12
|
|
1797
|
+
[3.0.11]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.10...v3.0.11
|
|
1798
|
+
[3.0.10]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.9...v3.0.10
|
|
1799
|
+
[3.0.9]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.8...v3.0.9
|
|
1800
|
+
[3.0.8]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.7...v3.0.8
|
|
1749
1801
|
[3.0.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.6...v3.0.7
|
|
1750
1802
|
[3.0.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.5...v3.0.6
|
|
1751
1803
|
[3.0.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.4...v3.0.5
|
package/lib/cli.js
CHANGED
|
@@ -40,6 +40,25 @@ function formatNodes(root) {
|
|
|
40
40
|
root.first.raws.before = '';
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
async function outputFile(file, contents) {
|
|
44
|
+
if (_fs.default.existsSync(file) && await _fs.default.promises.readFile(file, 'utf8') === contents) {
|
|
45
|
+
return; // Skip writing the file
|
|
46
|
+
}
|
|
47
|
+
// Write the file
|
|
48
|
+
await _fs.default.promises.writeFile(file, contents, 'utf8');
|
|
49
|
+
}
|
|
50
|
+
function drainStdin() {
|
|
51
|
+
return new Promise((resolve, reject)=>{
|
|
52
|
+
let result = '';
|
|
53
|
+
process.stdin.on('data', (chunk)=>{
|
|
54
|
+
result += chunk;
|
|
55
|
+
});
|
|
56
|
+
process.stdin.on('end', ()=>resolve(result)
|
|
57
|
+
);
|
|
58
|
+
process.stdin.on('error', (err)=>reject(err)
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
43
62
|
function help({ message , usage , commands: commands1 , options }) {
|
|
44
63
|
let indent = 2;
|
|
45
64
|
// Render header
|
|
@@ -336,7 +355,7 @@ async function build() {
|
|
|
336
355
|
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
|
|
337
356
|
input = args['--input'] = args['_'][1];
|
|
338
357
|
}
|
|
339
|
-
if (input && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
358
|
+
if (input && input !== '-' && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
340
359
|
console.error(`Specified input file ${args['--input']} does not exist.`);
|
|
341
360
|
process.exit(9);
|
|
342
361
|
}
|
|
@@ -499,10 +518,8 @@ async function build() {
|
|
|
499
518
|
return process.stdout.write(result.css);
|
|
500
519
|
}
|
|
501
520
|
return Promise.all([
|
|
502
|
-
|
|
503
|
-
),
|
|
504
|
-
result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
|
|
505
|
-
),
|
|
521
|
+
outputFile(output, result.css),
|
|
522
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
506
523
|
].filter(Boolean));
|
|
507
524
|
}).then(()=>{
|
|
508
525
|
let end = process.hrtime.bigint();
|
|
@@ -510,7 +527,18 @@ async function build() {
|
|
|
510
527
|
console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
|
|
511
528
|
});
|
|
512
529
|
}
|
|
513
|
-
let css1 =
|
|
530
|
+
let css1 = await (()=>{
|
|
531
|
+
// Piping in data, let's drain the stdin
|
|
532
|
+
if (input === '-') {
|
|
533
|
+
return drainStdin();
|
|
534
|
+
}
|
|
535
|
+
// Input file has been provided
|
|
536
|
+
if (input) {
|
|
537
|
+
return _fs.default.readFileSync(_path.default.resolve(input), 'utf8');
|
|
538
|
+
}
|
|
539
|
+
// No input file provided, fallback to default atrules
|
|
540
|
+
return '@tailwind base; @tailwind components; @tailwind utilities';
|
|
541
|
+
})();
|
|
514
542
|
return processCSS(css1);
|
|
515
543
|
}
|
|
516
544
|
let context = null;
|
|
@@ -619,11 +647,9 @@ async function build() {
|
|
|
619
647
|
if (!output) {
|
|
620
648
|
return process.stdout.write(result.css);
|
|
621
649
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
),
|
|
625
|
-
result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
|
|
626
|
-
),
|
|
650
|
+
return Promise.all([
|
|
651
|
+
outputFile(output, result.css),
|
|
652
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
627
653
|
].filter(Boolean));
|
|
628
654
|
}).then(()=>{
|
|
629
655
|
let end = process.hrtime.bigint();
|
|
@@ -636,7 +662,18 @@ async function build() {
|
|
|
636
662
|
}
|
|
637
663
|
});
|
|
638
664
|
}
|
|
639
|
-
let css2 =
|
|
665
|
+
let css2 = await (()=>{
|
|
666
|
+
// Piping in data, let's drain the stdin
|
|
667
|
+
if (input === '-') {
|
|
668
|
+
return drainStdin();
|
|
669
|
+
}
|
|
670
|
+
// Input file has been provided
|
|
671
|
+
if (input) {
|
|
672
|
+
return _fs.default.readFileSync(_path.default.resolve(input), 'utf8');
|
|
673
|
+
}
|
|
674
|
+
// No input file provided, fallback to default atrules
|
|
675
|
+
return '@tailwind base; @tailwind components; @tailwind utilities';
|
|
676
|
+
})();
|
|
640
677
|
let result1 = await processCSS(css2);
|
|
641
678
|
env.DEBUG && console.timeEnd('Finished in');
|
|
642
679
|
return result1;
|