tailwindcss 0.0.0-insiders.99baa6e → 0.0.0-insiders.9c72add

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 (60) hide show
  1. package/CHANGELOG.md +115 -2
  2. package/README.md +8 -4
  3. package/colors.js +2 -1
  4. package/defaultConfig.js +2 -1
  5. package/defaultTheme.js +2 -1
  6. package/lib/cli.js +49 -12
  7. package/lib/corePlugins.js +99 -117
  8. package/lib/css/preflight.css +3 -3
  9. package/lib/featureFlags.js +3 -1
  10. package/lib/index.js +1 -3
  11. package/lib/lib/collapseDuplicateDeclarations.js +52 -1
  12. package/lib/lib/defaultExtractor.js +42 -0
  13. package/lib/lib/evaluateTailwindFunctions.js +1 -1
  14. package/lib/lib/expandApplyAtRules.js +92 -3
  15. package/lib/lib/expandTailwindAtRules.js +43 -32
  16. package/lib/lib/generateRules.js +23 -2
  17. package/lib/lib/normalizeTailwindDirectives.js +8 -1
  18. package/lib/lib/resolveDefaultsAtRules.js +23 -9
  19. package/lib/lib/setupContextUtils.js +75 -30
  20. package/lib/lib/setupTrackingContext.js +11 -10
  21. package/lib/lib/sharedState.js +33 -4
  22. package/lib/processTailwindFeatures.js +2 -1
  23. package/lib/util/color.js +23 -8
  24. package/lib/util/defaults.js +6 -0
  25. package/lib/util/log.js +4 -0
  26. package/lib/util/normalizeConfig.js +34 -5
  27. package/lib/util/pluginUtils.js +1 -1
  28. package/lib/util/resolveConfig.js +9 -1
  29. package/lib/util/toPath.js +6 -1
  30. package/package.json +16 -16
  31. package/peers/index.js +727 -739
  32. package/plugin.js +2 -1
  33. package/resolveConfig.js +2 -1
  34. package/src/cli.js +57 -12
  35. package/src/corePlugins.js +100 -114
  36. package/src/css/preflight.css +3 -3
  37. package/src/featureFlags.js +5 -1
  38. package/src/index.js +1 -7
  39. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  40. package/src/lib/defaultExtractor.js +48 -0
  41. package/src/lib/evaluateTailwindFunctions.js +1 -1
  42. package/src/lib/expandApplyAtRules.js +101 -3
  43. package/src/lib/expandTailwindAtRules.js +43 -30
  44. package/src/lib/generateRules.js +29 -2
  45. package/src/lib/normalizeTailwindDirectives.js +6 -1
  46. package/src/lib/resolveDefaultsAtRules.js +28 -7
  47. package/src/lib/setupContextUtils.js +73 -17
  48. package/src/lib/setupTrackingContext.js +11 -10
  49. package/src/lib/sharedState.js +40 -4
  50. package/src/processTailwindFeatures.js +2 -1
  51. package/src/util/color.js +20 -7
  52. package/src/util/defaults.js +6 -0
  53. package/src/util/log.js +4 -0
  54. package/src/util/normalizeConfig.js +14 -1
  55. package/src/util/pluginUtils.js +1 -1
  56. package/src/util/resolveConfig.js +11 -1
  57. package/src/util/toPath.js +23 -1
  58. package/stubs/defaultConfig.stub.js +2 -2
  59. package/lib/lib/setupWatchingContext.js +0 -288
  60. package/src/lib/setupWatchingContext.js +0 -311
package/CHANGELOG.md CHANGED
@@ -7,7 +7,109 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- - Nothing yet!
10
+ ### Fixed
11
+
12
+ - Allow use of falsy values in theme config ([#6917](https://github.com/tailwindlabs/tailwindcss/pull/6917))
13
+ - Ensure we can apply classes that are grouped with non-class selectors ([#6922](https://github.com/tailwindlabs/tailwindcss/pull/6922))
14
+ - Improve standalone CLI compatibility on Linux by switching to the `linuxstatic` build target ([#6914](https://github.com/tailwindlabs/tailwindcss/pull/6914))
15
+
16
+ ## [3.0.11] - 2022-01-05
17
+
18
+ ### Fixed
19
+
20
+ - Preserve casing of CSS variables added by plugins ([#6888](https://github.com/tailwindlabs/tailwindcss/pull/6888))
21
+ - Ignore content paths that are passed in but don't actually exist ([#6901](https://github.com/tailwindlabs/tailwindcss/pull/6901))
22
+ - Revert change that applies Tailwind's defaults in isolated environments like CSS modules ([9fdc391](https://github.com/tailwindlabs/tailwindcss/commit/9fdc391d4ff93e7e350f5ce439060176b1f0162f))
23
+
24
+ ## [3.0.10] - 2022-01-04
25
+
26
+ ### Fixed
27
+
28
+ - Fix `@apply` in files without `@tailwind` directives ([#6580](https://github.com/tailwindlabs/tailwindcss/pull/6580), [#6875](https://github.com/tailwindlabs/tailwindcss/pull/6875))
29
+ - CLI: avoid unnecessary writes to output files ([#6550](https://github.com/tailwindlabs/tailwindcss/pull/6550))
30
+
31
+ ### Added
32
+
33
+ - Allow piping data into the CLI ([#6876](https://github.com/tailwindlabs/tailwindcss/pull/6876))
34
+
35
+ ## [3.0.9] - 2022-01-03
36
+
37
+ ### Fixed
38
+
39
+ - Improve `DEBUG` flag ([#6797](https://github.com/tailwindlabs/tailwindcss/pull/6797), [#6804](https://github.com/tailwindlabs/tailwindcss/pull/6804))
40
+ - Ensure we can use `<` and `>` characters in modifiers ([#6851](https://github.com/tailwindlabs/tailwindcss/pull/6851))
41
+ - Validate `theme()` works in arbitrary values ([#6852](https://github.com/tailwindlabs/tailwindcss/pull/6852))
42
+ - Properly detect `theme()` value usage in arbitrary properties ([#6854](https://github.com/tailwindlabs/tailwindcss/pull/6854))
43
+ - Improve collapsing of duplicate declarations ([#6856](https://github.com/tailwindlabs/tailwindcss/pull/6856))
44
+ - Remove support for `TAILWIND_MODE=watch` ([#6858](https://github.com/tailwindlabs/tailwindcss/pull/6858))
45
+
46
+ ## [3.0.8] - 2021-12-28
47
+
48
+ ### Fixed
49
+
50
+ - Reduce specificity of `abbr` rule in preflight ([#6671](https://github.com/tailwindlabs/tailwindcss/pull/6671))
51
+ - Support HSL with hue units in arbitrary values ([#6726](https://github.com/tailwindlabs/tailwindcss/pull/6726))
52
+ - Add `node16-linux-arm64` target for standalone CLI ([#6693](https://github.com/tailwindlabs/tailwindcss/pull/6693))
53
+
54
+ ## [3.0.7] - 2021-12-17
55
+
56
+ ### Fixed
57
+
58
+ - Don't mutate custom color palette when overriding per-plugin colors ([#6546](https://github.com/tailwindlabs/tailwindcss/pull/6546))
59
+ - Improve circular dependency detection when using `@apply` ([#6588](https://github.com/tailwindlabs/tailwindcss/pull/6588))
60
+ - Only generate variants for non-`user` layers ([#6589](https://github.com/tailwindlabs/tailwindcss/pull/6589))
61
+ - Properly extract classes with arbitrary values in arrays and classes followed by escaped quotes ([#6590](https://github.com/tailwindlabs/tailwindcss/pull/6590))
62
+ - Improve jsx interpolation candidate matching ([#6593](https://github.com/tailwindlabs/tailwindcss/pull/6593))
63
+ - Ensure `@apply` of a rule inside an AtRule works ([#6594](https://github.com/tailwindlabs/tailwindcss/pull/6594))
64
+
65
+ ## [3.0.6] - 2021-12-16
66
+
67
+ ### Fixed
68
+
69
+ - Support square bracket notation in paths ([#6519](https://github.com/tailwindlabs/tailwindcss/pull/6519))
70
+ - Ensure all plugins are executed for a given candidate ([#6540](https://github.com/tailwindlabs/tailwindcss/pull/6540))
71
+
72
+ ## [3.0.5] - 2021-12-15
73
+
74
+ ### Fixed
75
+
76
+ - Revert: add `li` to list-style reset ([9777562d](https://github.com/tailwindlabs/tailwindcss/commit/9777562da37ee631bbf77374c0d14825f09ef9af))
77
+
78
+ ## [3.0.4] - 2021-12-15
79
+
80
+ ### Fixed
81
+
82
+ - Insert always-on defaults layer in correct spot ([#6526](https://github.com/tailwindlabs/tailwindcss/pull/6526))
83
+
84
+ ## [3.0.3] - 2021-12-15
85
+
86
+ ### Added
87
+
88
+ - Warn about invalid globs in `content` ([#6449](https://github.com/tailwindlabs/tailwindcss/pull/6449))
89
+ - Add standalone tailwindcss CLI ([#6506](https://github.com/tailwindlabs/tailwindcss/pull/6506))
90
+ - Add `li` to list-style reset ([00f60e6](https://github.com/tailwindlabs/tailwindcss/commit/00f60e61013c6e4e3419e4b699371a13eb30b75d))
91
+
92
+ ### Fixed
93
+
94
+ - Don't output unparsable values ([#6469](https://github.com/tailwindlabs/tailwindcss/pull/6469))
95
+ - Fix text decoration utilities from overriding the new text decoration color/style/thickness utilities when used with a modifier ([#6378](https://github.com/tailwindlabs/tailwindcss/pull/6378))
96
+ - Move defaults to their own always-on layer ([#6500](https://github.com/tailwindlabs/tailwindcss/pull/6500))
97
+ - Support negative values in safelist patterns ([#6480](https://github.com/tailwindlabs/tailwindcss/pull/6480))
98
+
99
+ ## [3.0.2] - 2021-12-13
100
+
101
+ ### Fixed
102
+
103
+ - Temporarily disable optimize universal defaults, fixes issue with transforms/filters/rings not being `@apply`-able in CSS modules/Svelte components/Vue components ([#6461](https://github.com/tailwindlabs/tailwindcss/pull/6461))
104
+
105
+ ## [3.0.1] - 2021-12-10
106
+
107
+ ### Fixed
108
+
109
+ - Ensure complex variants with multiple classes work ([#6311](https://github.com/tailwindlabs/tailwindcss/pull/6311))
110
+ - Re-add `default` interop to public available functions ([#6348](https://github.com/tailwindlabs/tailwindcss/pull/6348))
111
+ - Detect circular dependencies when using `@apply` ([#6365](https://github.com/tailwindlabs/tailwindcss/pull/6365))
112
+ - Fix defaults optimization when vendor prefixes are involved ([#6369](https://github.com/tailwindlabs/tailwindcss/pull/6369))
11
113
 
12
114
  ## [3.0.0] - 2021-12-09
13
115
 
@@ -1681,7 +1783,18 @@ No release notes
1681
1783
 
1682
1784
  - Everything!
1683
1785
 
1684
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0...HEAD
1786
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...HEAD
1787
+ [3.0.11]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.10...v3.0.11
1788
+ [3.0.10]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.9...v3.0.10
1789
+ [3.0.9]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.8...v3.0.9
1790
+ [3.0.8]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.7...v3.0.8
1791
+ [3.0.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.6...v3.0.7
1792
+ [3.0.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.5...v3.0.6
1793
+ [3.0.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.4...v3.0.5
1794
+ [3.0.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.3...v3.0.4
1795
+ [3.0.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.2...v3.0.3
1796
+ [3.0.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.1...v3.0.2
1797
+ [3.0.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0...v3.0.1
1685
1798
  [3.0.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.2...v3.0.0
1686
1799
  [3.0.0-alpha.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.1...v3.0.0-alpha.2
1687
1800
  [3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.19...v3.0.0-alpha.1
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/colors.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/public/colors').default
1
+ let colors = require('./lib/public/colors')
2
+ module.exports = (colors.__esModule ? colors : { default: colors }).default
package/defaultConfig.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/public/default-config').default
1
+ let defaultConfig = require('./lib/public/default-config')
2
+ module.exports = (defaultConfig.__esModule ? defaultConfig : { default: defaultConfig }).default
package/defaultTheme.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/public/default-theme').default
1
+ let defaultTheme = require('./lib/public/default-theme')
2
+ module.exports = (defaultTheme.__esModule ? defaultTheme : { default: defaultTheme }).default
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;
@@ -914,26 +914,24 @@ let corePlugins = {
914
914
  ], {
915
915
  supportsNegativeValues: true
916
916
  }),
917
- transform: ({ addBase , addUtilities })=>{
918
- addBase({
919
- '@defaults transform': {
920
- '--tw-translate-x': '0',
921
- '--tw-translate-y': '0',
922
- '--tw-rotate': '0',
923
- '--tw-skew-x': '0',
924
- '--tw-skew-y': '0',
925
- '--tw-scale-x': '1',
926
- '--tw-scale-y': '1',
927
- '--tw-transform': [
928
- 'translateX(var(--tw-translate-x))',
929
- 'translateY(var(--tw-translate-y))',
930
- 'rotate(var(--tw-rotate))',
931
- 'skewX(var(--tw-skew-x))',
932
- 'skewY(var(--tw-skew-y))',
933
- 'scaleX(var(--tw-scale-x))',
934
- 'scaleY(var(--tw-scale-y))',
935
- ].join(' ')
936
- }
917
+ transform: ({ addDefaults , addUtilities })=>{
918
+ addDefaults('transform', {
919
+ '--tw-translate-x': '0',
920
+ '--tw-translate-y': '0',
921
+ '--tw-rotate': '0',
922
+ '--tw-skew-x': '0',
923
+ '--tw-skew-y': '0',
924
+ '--tw-scale-x': '1',
925
+ '--tw-scale-y': '1',
926
+ '--tw-transform': [
927
+ 'translateX(var(--tw-translate-x))',
928
+ 'translateY(var(--tw-translate-y))',
929
+ 'rotate(var(--tw-rotate))',
930
+ 'skewX(var(--tw-skew-x))',
931
+ 'skewY(var(--tw-skew-y))',
932
+ 'scaleX(var(--tw-scale-x))',
933
+ 'scaleY(var(--tw-scale-y))',
934
+ ].join(' ')
937
935
  });
938
936
  addUtilities({
939
937
  '.transform': {
@@ -1001,14 +999,12 @@ let corePlugins = {
1001
999
  });
1002
1000
  },
1003
1001
  cursor: (0, _createUtilityPlugin).default('cursor'),
1004
- touchAction: ({ addBase , addUtilities })=>{
1005
- addBase({
1006
- '@defaults touch-action': {
1007
- '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
1008
- '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
1009
- '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
1010
- '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
1011
- }
1002
+ touchAction: ({ addDefaults , addUtilities })=>{
1003
+ addDefaults('touch-action', {
1004
+ '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
1005
+ '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
1006
+ '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
1007
+ '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
1012
1008
  });
1013
1009
  addUtilities({
1014
1010
  '.touch-auto': {
@@ -1096,11 +1092,9 @@ let corePlugins = {
1096
1092
  }
1097
1093
  });
1098
1094
  },
1099
- scrollSnapType: ({ addUtilities , addBase })=>{
1100
- addBase({
1101
- '@defaults scroll-snap-type': {
1102
- '--tw-scroll-snap-strictness': 'proximity'
1103
- }
1095
+ scrollSnapType: ({ addDefaults , addUtilities })=>{
1096
+ addDefaults('scroll-snap-type', {
1097
+ '--tw-scroll-snap-strictness': 'proximity'
1104
1098
  });
1105
1099
  addUtilities({
1106
1100
  '.snap-none': {
@@ -2095,22 +2089,18 @@ let corePlugins = {
2095
2089
  }
2096
2090
  });
2097
2091
  },
2098
- borderColor: ({ addBase , matchUtilities , theme , corePlugins: corePlugins2 })=>{
2092
+ borderColor: ({ addDefaults , matchUtilities , theme , corePlugins: corePlugins2 })=>{
2099
2093
  if (!corePlugins2('borderOpacity')) {
2100
2094
  let value = theme('borderColor.DEFAULT', 'currentColor');
2101
- addBase({
2102
- '@defaults border-width': {
2103
- 'border-color': (0, _toColorValue).default(value)
2104
- }
2095
+ addDefaults('border-width', {
2096
+ 'border-color': (0, _toColorValue).default(value)
2105
2097
  });
2106
2098
  } else {
2107
- addBase({
2108
- '@defaults border-width': (0, _withAlphaVariable).default({
2109
- color: theme('borderColor.DEFAULT', 'currentColor'),
2110
- property: 'border-color',
2111
- variable: '--tw-border-opacity'
2112
- })
2113
- });
2099
+ addDefaults('border-width', (0, _withAlphaVariable).default({
2100
+ color: theme('borderColor.DEFAULT', 'currentColor'),
2101
+ property: 'border-color',
2102
+ variable: '--tw-border-opacity'
2103
+ }));
2114
2104
  }
2115
2105
  matchUtilities({
2116
2106
  border: (value)=>{
@@ -2792,16 +2782,16 @@ let corePlugins = {
2792
2782
  textDecoration: ({ addUtilities })=>{
2793
2783
  addUtilities({
2794
2784
  '.underline': {
2795
- 'text-decoration': 'underline'
2785
+ 'text-decoration-line': 'underline'
2796
2786
  },
2797
2787
  '.overline': {
2798
- 'text-decoration': 'overline'
2788
+ 'text-decoration-line': 'overline'
2799
2789
  },
2800
2790
  '.line-through': {
2801
- 'text-decoration': 'line-through'
2791
+ 'text-decoration-line': 'line-through'
2802
2792
  },
2803
2793
  '.no-underline': {
2804
- 'text-decoration': 'none'
2794
+ 'text-decoration-line': 'none'
2805
2795
  }
2806
2796
  });
2807
2797
  },
@@ -3064,14 +3054,12 @@ let corePlugins = {
3064
3054
  `var(--tw-ring-shadow, 0 0 #0000)`,
3065
3055
  `var(--tw-shadow)`,
3066
3056
  ].join(', ');
3067
- return function({ matchUtilities , addBase , theme }) {
3068
- addBase({
3069
- '@defaults box-shadow': {
3070
- '--tw-ring-offset-shadow': '0 0 #0000',
3071
- '--tw-ring-shadow': '0 0 #0000',
3072
- '--tw-shadow': '0 0 #0000',
3073
- '--tw-shadow-colored': '0 0 #0000'
3074
- }
3057
+ return function({ matchUtilities , addDefaults , theme }) {
3058
+ addDefaults(' box-shadow', {
3059
+ '--tw-ring-offset-shadow': '0 0 #0000',
3060
+ '--tw-ring-shadow': '0 0 #0000',
3061
+ '--tw-shadow': '0 0 #0000',
3062
+ '--tw-shadow-colored': '0 0 #0000'
3075
3063
  });
3076
3064
  matchUtilities({
3077
3065
  shadow: (value)=>{
@@ -3180,20 +3168,18 @@ let corePlugins = {
3180
3168
  ]
3181
3169
  });
3182
3170
  },
3183
- ringWidth: ({ matchUtilities , addBase , addUtilities , theme })=>{
3171
+ ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme })=>{
3184
3172
  let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5');
3185
3173
  let ringColorDefault = (0, _withAlphaVariable).withAlphaValue(theme('ringColor.DEFAULT'), ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`);
3186
- addBase({
3187
- '@defaults ring-width': {
3188
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
3189
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
3190
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
3191
- '--tw-ring-color': ringColorDefault,
3192
- '--tw-ring-offset-shadow': '0 0 #0000',
3193
- '--tw-ring-shadow': '0 0 #0000',
3194
- '--tw-shadow': '0 0 #0000',
3195
- '--tw-shadow-colored': '0 0 #0000'
3196
- }
3174
+ addDefaults('ring-width', {
3175
+ '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
3176
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
3177
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
3178
+ '--tw-ring-color': ringColorDefault,
3179
+ '--tw-ring-offset-shadow': '0 0 #0000',
3180
+ '--tw-ring-shadow': '0 0 #0000',
3181
+ '--tw-shadow': '0 0 #0000',
3182
+ '--tw-shadow-colored': '0 0 #0000'
3197
3183
  });
3198
3184
  matchUtilities({
3199
3185
  ring: (value)=>{
@@ -3396,30 +3382,28 @@ let corePlugins = {
3396
3382
  values: theme('sepia')
3397
3383
  });
3398
3384
  },
3399
- filter: ({ addBase , addUtilities })=>{
3400
- addBase({
3401
- '@defaults filter': {
3402
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
3403
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
3404
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
3405
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
3406
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
3407
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
3408
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
3409
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
3410
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
3411
- '--tw-filter': [
3412
- 'var(--tw-blur)',
3413
- 'var(--tw-brightness)',
3414
- 'var(--tw-contrast)',
3415
- 'var(--tw-grayscale)',
3416
- 'var(--tw-hue-rotate)',
3417
- 'var(--tw-invert)',
3418
- 'var(--tw-saturate)',
3419
- 'var(--tw-sepia)',
3420
- 'var(--tw-drop-shadow)',
3421
- ].join(' ')
3422
- }
3385
+ filter: ({ addDefaults , addUtilities })=>{
3386
+ addDefaults('filter', {
3387
+ '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
3388
+ '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
3389
+ '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
3390
+ '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
3391
+ '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
3392
+ '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
3393
+ '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
3394
+ '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
3395
+ '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
3396
+ '--tw-filter': [
3397
+ 'var(--tw-blur)',
3398
+ 'var(--tw-brightness)',
3399
+ 'var(--tw-contrast)',
3400
+ 'var(--tw-grayscale)',
3401
+ 'var(--tw-hue-rotate)',
3402
+ 'var(--tw-invert)',
3403
+ 'var(--tw-saturate)',
3404
+ 'var(--tw-sepia)',
3405
+ 'var(--tw-drop-shadow)',
3406
+ ].join(' ')
3423
3407
  });
3424
3408
  addUtilities({
3425
3409
  '.filter': {
@@ -3559,30 +3543,28 @@ let corePlugins = {
3559
3543
  values: theme('backdropSepia')
3560
3544
  });
3561
3545
  },
3562
- backdropFilter: ({ addBase , addUtilities })=>{
3563
- addBase({
3564
- '@defaults backdrop-filter': {
3565
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
3566
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
3567
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
3568
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
3569
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
3570
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
3571
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
3572
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
3573
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
3574
- '--tw-backdrop-filter': [
3575
- 'var(--tw-backdrop-blur)',
3576
- 'var(--tw-backdrop-brightness)',
3577
- 'var(--tw-backdrop-contrast)',
3578
- 'var(--tw-backdrop-grayscale)',
3579
- 'var(--tw-backdrop-hue-rotate)',
3580
- 'var(--tw-backdrop-invert)',
3581
- 'var(--tw-backdrop-opacity)',
3582
- 'var(--tw-backdrop-saturate)',
3583
- 'var(--tw-backdrop-sepia)',
3584
- ].join(' ')
3585
- }
3546
+ backdropFilter: ({ addDefaults , addUtilities })=>{
3547
+ addDefaults('backdrop-filter', {
3548
+ '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
3549
+ '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
3550
+ '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
3551
+ '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
3552
+ '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
3553
+ '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
3554
+ '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
3555
+ '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
3556
+ '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
3557
+ '--tw-backdrop-filter': [
3558
+ 'var(--tw-backdrop-blur)',
3559
+ 'var(--tw-backdrop-brightness)',
3560
+ 'var(--tw-backdrop-contrast)',
3561
+ 'var(--tw-backdrop-grayscale)',
3562
+ 'var(--tw-backdrop-hue-rotate)',
3563
+ 'var(--tw-backdrop-invert)',
3564
+ 'var(--tw-backdrop-opacity)',
3565
+ 'var(--tw-backdrop-saturate)',
3566
+ 'var(--tw-backdrop-sepia)',
3567
+ ].join(' ')
3586
3568
  });
3587
3569
  addUtilities({
3588
3570
  '.backdrop-filter': {
@@ -58,7 +58,7 @@ hr {
58
58
  Add the correct text decoration in Chrome, Edge, and Safari.
59
59
  */
60
60
 
61
- abbr[title] {
61
+ abbr:where([title]) {
62
62
  text-decoration: underline dotted;
63
63
  }
64
64
 
@@ -144,7 +144,7 @@ sup {
144
144
  table {
145
145
  text-indent: 0; /* 1 */
146
146
  border-color: inherit; /* 2 */
147
- border-collapse: collapse; /* 3 */
147
+ border-collapse: collapse; /* 3 */
148
148
  }
149
149
 
150
150
  /*
@@ -310,7 +310,7 @@ textarea {
310
310
 
311
311
  input::placeholder,
312
312
  textarea::placeholder {
313
- opacity: 1; /* 1 */
313
+ opacity: 1; /* 1 */
314
314
  color: theme('colors.gray.400', #9ca3af); /* 2 */
315
315
  }
316
316
 
@@ -13,7 +13,9 @@ function _interopRequireDefault(obj) {
13
13
  };
14
14
  }
15
15
  let defaults = {
16
- optimizeUniversalDefaults: true
16
+ // TODO: Drop this once we can safely rely on optimizeUniversalDefaults being
17
+ // the default.
18
+ optimizeUniversalDefaults: process.env.NODE_ENV === 'test' ? true : false
17
19
  };
18
20
  let featureFlags = {
19
21
  future: [],
package/lib/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  var _setupTrackingContext = _interopRequireDefault(require("./lib/setupTrackingContext"));
3
- var _setupWatchingContext = _interopRequireDefault(require("./lib/setupWatchingContext"));
4
3
  var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
5
4
  var _sharedState = require("./lib/sharedState");
6
5
  function _interopRequireDefault(obj) {
@@ -18,8 +17,7 @@ module.exports = function tailwindcss(configOrPath) {
18
17
  return root;
19
18
  },
20
19
  function(root, result) {
21
- let setupContext = _sharedState.env.TAILWIND_MODE === 'watch' ? (0, _setupWatchingContext).default(configOrPath) : (0, _setupTrackingContext).default(configOrPath);
22
- (0, _processTailwindFeatures).default(setupContext)(root, result);
20
+ (0, _processTailwindFeatures).default((0, _setupTrackingContext).default(configOrPath))(root, result);
23
21
  },
24
22
  _sharedState.env.DEBUG && function(root) {
25
23
  console.timeEnd('JIT TOTAL');