tailwindcss 0.0.0-insiders.ec911c7 → 0.0.0-insiders.ee35abd

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +74 -1
  2. package/README.md +8 -4
  3. package/lib/cli.js +49 -12
  4. package/lib/corePlugins.js +114 -142
  5. package/lib/css/preflight.css +2 -2
  6. package/lib/featureFlags.js +1 -3
  7. package/lib/index.js +1 -3
  8. package/lib/lib/collapseDuplicateDeclarations.js +52 -1
  9. package/lib/lib/defaultExtractor.js +42 -0
  10. package/lib/lib/expandApplyAtRules.js +87 -55
  11. package/lib/lib/expandTailwindAtRules.js +14 -49
  12. package/lib/lib/generateRules.js +4 -0
  13. package/lib/lib/normalizeTailwindDirectives.js +8 -1
  14. package/lib/lib/resolveDefaultsAtRules.js +4 -4
  15. package/lib/lib/setupContextUtils.js +131 -69
  16. package/lib/lib/setupTrackingContext.js +11 -10
  17. package/lib/lib/sharedState.js +33 -4
  18. package/lib/processTailwindFeatures.js +3 -2
  19. package/lib/util/color.js +23 -8
  20. package/lib/util/pluginUtils.js +1 -1
  21. package/lib/util/resolveConfig.js +9 -1
  22. package/package.json +13 -14
  23. package/peers/index.js +727 -738
  24. package/src/cli.js +57 -12
  25. package/src/corePlugins.js +121 -155
  26. package/src/css/preflight.css +2 -2
  27. package/src/featureFlags.js +1 -5
  28. package/src/index.js +1 -7
  29. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  30. package/src/lib/defaultExtractor.js +48 -0
  31. package/src/lib/expandApplyAtRules.js +90 -61
  32. package/src/lib/expandTailwindAtRules.js +14 -44
  33. package/src/lib/generateRules.js +5 -0
  34. package/src/lib/normalizeTailwindDirectives.js +6 -1
  35. package/src/lib/resolveDefaultsAtRules.js +5 -5
  36. package/src/lib/setupContextUtils.js +108 -19
  37. package/src/lib/setupTrackingContext.js +11 -10
  38. package/src/lib/sharedState.js +40 -4
  39. package/src/processTailwindFeatures.js +4 -2
  40. package/src/util/color.js +20 -7
  41. package/src/util/pluginUtils.js +1 -1
  42. package/src/util/resolveConfig.js +11 -1
  43. package/lib/lib/setupWatchingContext.js +0 -288
  44. package/src/lib/setupWatchingContext.js +0 -311
package/CHANGELOG.md CHANGED
@@ -7,6 +7,72 @@ 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
+
57
+ ### Fixed
58
+
59
+ - Reduce specificity of `abbr` rule in preflight ([#6671](https://github.com/tailwindlabs/tailwindcss/pull/6671))
60
+ - Support HSL with hue units in arbitrary values ([#6726](https://github.com/tailwindlabs/tailwindcss/pull/6726))
61
+ - Add `node16-linux-arm64` target for standalone CLI ([#6693](https://github.com/tailwindlabs/tailwindcss/pull/6693))
62
+
63
+ ## [3.0.7] - 2021-12-17
64
+
65
+ ### Fixed
66
+
67
+ - Don't mutate custom color palette when overriding per-plugin colors ([#6546](https://github.com/tailwindlabs/tailwindcss/pull/6546))
68
+ - Improve circular dependency detection when using `@apply` ([#6588](https://github.com/tailwindlabs/tailwindcss/pull/6588))
69
+ - Only generate variants for non-`user` layers ([#6589](https://github.com/tailwindlabs/tailwindcss/pull/6589))
70
+ - Properly extract classes with arbitrary values in arrays and classes followed by escaped quotes ([#6590](https://github.com/tailwindlabs/tailwindcss/pull/6590))
71
+ - Improve jsx interpolation candidate matching ([#6593](https://github.com/tailwindlabs/tailwindcss/pull/6593))
72
+ - Ensure `@apply` of a rule inside an AtRule works ([#6594](https://github.com/tailwindlabs/tailwindcss/pull/6594))
73
+
74
+ ## [3.0.6] - 2021-12-16
75
+
10
76
  ### Fixed
11
77
 
12
78
  - Support square bracket notation in paths ([#6519](https://github.com/tailwindlabs/tailwindcss/pull/6519))
@@ -1726,7 +1792,14 @@ No release notes
1726
1792
 
1727
1793
  - Everything!
1728
1794
 
1729
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.5...HEAD
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
1801
+ [3.0.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.6...v3.0.7
1802
+ [3.0.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.5...v3.0.6
1730
1803
  [3.0.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.4...v3.0.5
1731
1804
  [3.0.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.3...v3.0.4
1732
1805
  [3.0.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.2...v3.0.3
package/README.md CHANGED
@@ -1,10 +1,14 @@
1
1
  <p>
2
- <a href="https://tailwindcss.com/" target="_blank">
3
- <img alt="Tailwind CSS" width="350" src="https://refactoringui.nyc3.cdn.digitaloceanspaces.com/tailwind-logo-sticker.svg">
4
- </a><br>
5
- A utility-first CSS framework for rapidly building custom user interfaces.
2
+ <a href="https://tailwindcss.com/#gh-light-mode-only" target="_blank">
3
+ <img src="./.github/logo-light.svg" alt="Tailwind CSS" width="350" height="70">
4
+ </a>
5
+ <a href="https://tailwindcss.com/#gh-dark-mode-only" target="_blank">
6
+ <img src="./.github/logo-dark.svg" alt="Tailwind CSS" width="350" height="70">
7
+ </a>
6
8
  </p>
7
9
 
10
+ A utility-first CSS framework for rapidly building custom user interfaces.
11
+
8
12
  <p>
9
13
  <a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/workflow/status/tailwindlabs/tailwindcss/Node.js%20CI" alt="Build Status"></a>
10
14
  <a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
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
- _fs.default.promises.writeFile(output, result.css, ()=>true
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 = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
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
- await Promise.all([
623
- _fs.default.promises.writeFile(output, result.css, ()=>true
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 = input ? _fs.default.readFileSync(_path.default.resolve(input), 'utf8') : '@tailwind base; @tailwind components; @tailwind utilities';
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;