tailwindcss 0.0.0-insiders.ee35abd → 0.0.0-insiders.ee945bb

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 (68) hide show
  1. package/CHANGELOG.md +123 -6
  2. package/LICENSE +1 -2
  3. package/lib/cli.js +34 -24
  4. package/lib/corePlugins.js +124 -149
  5. package/lib/css/preflight.css +1 -1
  6. package/lib/featureFlags.js +3 -4
  7. package/lib/index.js +12 -1
  8. package/lib/lib/cacheInvalidation.js +69 -0
  9. package/lib/lib/collapseAdjacentRules.js +14 -1
  10. package/lib/lib/defaultExtractor.js +6 -4
  11. package/lib/lib/expandApplyAtRules.js +173 -17
  12. package/lib/lib/expandTailwindAtRules.js +43 -17
  13. package/lib/lib/generateRules.js +113 -32
  14. package/lib/lib/normalizeTailwindDirectives.js +2 -1
  15. package/lib/lib/partitionApplyAtRules.js +53 -0
  16. package/lib/lib/resolveDefaultsAtRules.js +6 -2
  17. package/lib/lib/setupContextUtils.js +101 -141
  18. package/lib/lib/setupTrackingContext.js +3 -3
  19. package/lib/lib/sharedState.js +5 -1
  20. package/{nesting → lib/postcss-plugins/nesting}/README.md +0 -0
  21. package/lib/postcss-plugins/nesting/index.js +17 -0
  22. package/lib/postcss-plugins/nesting/plugin.js +85 -0
  23. package/lib/processTailwindFeatures.js +7 -0
  24. package/lib/util/cloneNodes.js +12 -1
  25. package/lib/util/createPlugin.js +1 -2
  26. package/lib/util/createUtilityPlugin.js +4 -8
  27. package/lib/util/flattenColorPalette.js +1 -3
  28. package/lib/util/log.js +7 -7
  29. package/lib/util/normalizeConfig.js +19 -16
  30. package/lib/util/normalizeScreens.js +2 -4
  31. package/lib/util/parseBoxShadowValue.js +44 -4
  32. package/lib/util/pluginUtils.js +5 -12
  33. package/lib/util/prefixSelector.js +4 -5
  34. package/lib/util/resolveConfig.js +31 -18
  35. package/lib/util/resolveConfigPath.js +1 -2
  36. package/lib/util/toColorValue.js +1 -2
  37. package/lib/util/transformThemeValue.js +4 -8
  38. package/nesting/index.js +2 -12
  39. package/package.json +23 -28
  40. package/peers/index.js +3014 -4033
  41. package/src/cli.js +27 -13
  42. package/src/corePlugins.js +54 -10
  43. package/src/css/preflight.css +1 -1
  44. package/src/featureFlags.js +2 -2
  45. package/src/index.js +15 -1
  46. package/src/lib/cacheInvalidation.js +52 -0
  47. package/src/lib/collapseAdjacentRules.js +16 -1
  48. package/src/lib/defaultExtractor.js +6 -4
  49. package/src/lib/expandApplyAtRules.js +184 -11
  50. package/src/lib/expandTailwindAtRules.js +55 -10
  51. package/src/lib/generateRules.js +92 -25
  52. package/src/lib/normalizeTailwindDirectives.js +1 -0
  53. package/src/lib/partitionApplyAtRules.js +52 -0
  54. package/src/lib/resolveDefaultsAtRules.js +6 -2
  55. package/src/lib/setupContextUtils.js +60 -100
  56. package/src/lib/setupTrackingContext.js +3 -3
  57. package/src/lib/sharedState.js +2 -0
  58. package/src/postcss-plugins/nesting/README.md +42 -0
  59. package/src/postcss-plugins/nesting/index.js +13 -0
  60. package/src/postcss-plugins/nesting/plugin.js +80 -0
  61. package/src/processTailwindFeatures.js +8 -0
  62. package/src/util/cloneNodes.js +14 -1
  63. package/src/util/log.js +7 -7
  64. package/src/util/normalizeConfig.js +12 -4
  65. package/src/util/parseBoxShadowValue.js +51 -3
  66. package/src/util/prefixSelector.js +7 -5
  67. package/src/util/resolveConfig.js +30 -0
  68. package/nesting/plugin.js +0 -41
package/CHANGELOG.md CHANGED
@@ -7,7 +7,113 @@ 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
+ - Prevent nesting plugin from breaking other plugins ([#7563](https://github.com/tailwindlabs/tailwindcss/pull/7563))
13
+ - Recursively collapse adjacent rules ([#7565](https://github.com/tailwindlabs/tailwindcss/pull/7565))
14
+ - Preserve source maps for generated CSS ([#7588](https://github.com/tailwindlabs/tailwindcss/pull/7588))
15
+ - Split box shadows on top-level commas only ([#7479](https://github.com/tailwindlabs/tailwindcss/pull/7479))
16
+ - Use local user CSS cache for `@apply` ([#7524](https://github.com/tailwindlabs/tailwindcss/pull/7524))
17
+ - Invalidate context when main CSS changes ([#7626](https://github.com/tailwindlabs/tailwindcss/pull/7626))
18
+ - Only add `!` to selector class matching template candidate when using important modifier with mutli-class selectors ([#7664](https://github.com/tailwindlabs/tailwindcss/pull/7664))
19
+ - Correctly parse and prefix animation names with dots ([#7163](https://github.com/tailwindlabs/tailwindcss/pull/7163))
20
+ - Fix extraction from template literal/function with array ([#7481](https://github.com/tailwindlabs/tailwindcss/pull/7481))
21
+
22
+ ### Changed
23
+
24
+ - Replace `chalk` with `picocolors` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6039))
25
+ - Replace `cosmiconfig` with `lilconfig` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6038))
26
+
27
+ ### Added
28
+
29
+ - Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
30
+ - Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
31
+ - Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
32
+ - Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
33
+ - Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
34
+ - Add `--poll` option to the CLI ([#7725](https://github.com/tailwindlabs/tailwindcss/pull/7725))
35
+
36
+ ## [3.0.23] - 2022-02-16
37
+
38
+ ### Fixed
39
+
40
+ - Remove opacity variables from `:visited` pseudo class ([#7458](https://github.com/tailwindlabs/tailwindcss/pull/7458))
41
+ - Support arbitrary values + calc + theme with quotes ([#7462](https://github.com/tailwindlabs/tailwindcss/pull/7462))
42
+ - Don't duplicate layer output when scanning content with variants + wildcards ([#7478](https://github.com/tailwindlabs/tailwindcss/pull/7478))
43
+ - Implement `getClassOrder` instead of `sortClassList` ([#7459](https://github.com/tailwindlabs/tailwindcss/pull/7459))
44
+
45
+ ## [3.0.22] - 2022-02-11
46
+
47
+ ### Fixed
48
+
49
+ - Temporarily move `postcss` to dependencies ([#7424](https://github.com/tailwindlabs/tailwindcss/pull/7424))
50
+
51
+ ## [3.0.21] - 2022-02-10
52
+
53
+ ### Fixed
54
+
55
+ - Move prettier plugin to dev dependencies ([#7418](https://github.com/tailwindlabs/tailwindcss/pull/7418))
56
+
57
+ ## [3.0.20] - 2022-02-10
58
+
59
+ ### Added
60
+
61
+ - Expose `context.sortClassList(classes)` ([#7412](https://github.com/tailwindlabs/tailwindcss/pull/7412))
62
+
63
+ ## [3.0.19] - 2022-02-07
64
+
65
+ ### Fixed
66
+
67
+ - Fix preflight border color fallback ([#7288](https://github.com/tailwindlabs/tailwindcss/pull/7288))
68
+ - Correctly parse shadow lengths without a leading zero ([#7289](https://github.com/tailwindlabs/tailwindcss/pull/7289))
69
+ - Don't crash when scanning extremely long class candidates ([#7331](https://github.com/tailwindlabs/tailwindcss/pull/7331))
70
+ - Use less hacky fix for URLs detected as custom properties ([#7275](https://github.com/tailwindlabs/tailwindcss/pull/7275))
71
+ - Correctly generate negative utilities when dash is before the prefix ([#7295](https://github.com/tailwindlabs/tailwindcss/pull/7295))
72
+ - Detect prefixed negative utilities in the safelist ([#7295](https://github.com/tailwindlabs/tailwindcss/pull/7295))
73
+
74
+ ## [3.0.18] - 2022-01-28
75
+
76
+ ### Fixed
77
+
78
+ - Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](https://github.com/tailwindlabs/tailwindcss/pull/7232))
79
+ - Quick fix for incorrect arbitrary properties when using URLs ([#7252](https://github.com/tailwindlabs/tailwindcss/pull/7252))
80
+
81
+ ## [3.0.17] - 2022-01-26
82
+
83
+ ### Fixed
84
+
85
+ - Remove false positive warning in CLI when using the `--content` option ([#7220](https://github.com/tailwindlabs/tailwindcss/pull/7220))
86
+
87
+ ## [3.0.16] - 2022-01-24
88
+
89
+ ### Fixed
90
+
91
+ - Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](https://github.com/tailwindlabs/tailwindcss/pull/7080))
92
+ - Improve various warnings ([#7118](https://github.com/tailwindlabs/tailwindcss/pull/7118))
93
+ - Fix grammatical mistake ([cca5a38](https://github.com/tailwindlabs/tailwindcss/commit/cca5a3804e1d3ee0214491921e1aec35bf62a813))
94
+
95
+ ## [3.0.15] - 2022-01-15
96
+
97
+ ### Fixed
98
+
99
+ - Temporarily remove optional chaining in nesting plugin ([#7077](https://github.com/tailwindlabs/tailwindcss/pull/7077))
100
+
101
+ ## [3.0.14] - 2022-01-14
102
+
103
+ ### Added
104
+
105
+ - Show warnings for invalid content config ([#7065](https://github.com/tailwindlabs/tailwindcss/pull/7065))
106
+
107
+ ### Fixed
108
+
109
+ - Only emit utility/component variants when those layers exist ([#7066](https://github.com/tailwindlabs/tailwindcss/pull/7066))
110
+ - Ensure nesting plugins can receive options ([#7016](https://github.com/tailwindlabs/tailwindcss/pull/7016))
111
+
112
+ ## [3.0.13] - 2022-01-11
113
+
114
+ ### Fixed
115
+
116
+ - Fix consecutive builds with at apply producing different CSS ([#6999](https://github.com/tailwindlabs/tailwindcss/pull/6999))
11
117
 
12
118
  ## [3.0.12] - 2022-01-07
13
119
 
@@ -17,10 +123,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
123
  - Ensure we can apply classes that are grouped with non-class selectors ([#6922](https://github.com/tailwindlabs/tailwindcss/pull/6922))
18
124
  - Improve standalone CLI compatibility on Linux by switching to the `linuxstatic` build target ([#6914](https://github.com/tailwindlabs/tailwindcss/pull/6914))
19
125
  - 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))
126
+ - Only emit defaults when using base layer ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926))
127
+ - Emit plugin defaults regardless of usage ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926))
128
+ - Move default border color back to preflight ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926))
129
+ - Change `experimental.optimizeUniversalDefaults` to only work with `@tailwind base` ([#6926](https://github.com/tailwindlabs/tailwindcss/pull/6926))
24
130
 
25
131
  ## [3.0.11] - 2022-01-05
26
132
 
@@ -1792,7 +1898,18 @@ No release notes
1792
1898
 
1793
1899
  - Everything!
1794
1900
 
1795
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...HEAD
1901
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.23...HEAD
1902
+ [3.0.23]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.22...v3.0.23
1903
+ [3.0.22]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.21...v3.0.22
1904
+ [3.0.21]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.20...v3.0.21
1905
+ [3.0.20]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.19...v3.0.20
1906
+ [3.0.19]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.18...v3.0.19
1907
+ [3.0.18]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.17...v3.0.18
1908
+ [3.0.17]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.16...v3.0.17
1909
+ [3.0.16]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.15...v3.0.16
1910
+ [3.0.15]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.14...v3.0.15
1911
+ [3.0.14]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.13...v3.0.14
1912
+ [3.0.13]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...v3.0.13
1796
1913
  [3.0.12]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...v3.0.12
1797
1914
  [3.0.11]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.10...v3.0.11
1798
1915
  [3.0.10]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.9...v3.0.10
package/LICENSE CHANGED
@@ -1,7 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) Adam Wathan <adam.wathan@gmail.com>
4
- Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
3
+ Copyright (c) Tailwind Labs, Inc.
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/cli.js CHANGED
@@ -6,7 +6,7 @@ var _path = _interopRequireDefault(require("path"));
6
6
  var _arg = _interopRequireDefault(require("arg"));
7
7
  var _fs = _interopRequireDefault(require("fs"));
8
8
  var _postcssLoadConfig = _interopRequireDefault(require("postcss-load-config"));
9
- var _cosmiconfig = require("cosmiconfig");
9
+ var _lilconfig = require("lilconfig");
10
10
  var _plugins // Little bit scary, looking at private/internal API
11
11
  = _interopRequireDefault(require("postcss-load-config/src/plugins"));
12
12
  var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
@@ -89,8 +89,7 @@ function help({ message , usage , commands: commands1 , options }) {
89
89
  }
90
90
  // Render options
91
91
  if (options) {
92
- let groupedOptions = {
93
- };
92
+ let groupedOptions = {};
94
93
  for (let [key, value] of Object.entries(options)){
95
94
  if (typeof value === 'object') {
96
95
  groupedOptions[key] = {
@@ -160,6 +159,10 @@ let commands = {
160
159
  type: Boolean,
161
160
  description: 'Watch for changes and rebuild as needed'
162
161
  },
162
+ '--poll': {
163
+ type: Boolean,
164
+ description: 'Use polling instead of filesystem events when watching'
165
+ },
163
166
  '--content': {
164
167
  type: String,
165
168
  description: 'Content paths to use for removing unused classes'
@@ -188,7 +191,8 @@ let commands = {
188
191
  '-i': '--input',
189
192
  '-o': '--output',
190
193
  '-m': '--minify',
191
- '-w': '--watch'
194
+ '-w': '--watch',
195
+ '-p': '--poll'
192
196
  }
193
197
  }
194
198
  };
@@ -349,7 +353,12 @@ async function build() {
349
353
  let input = args['--input'];
350
354
  let output = args['--output'];
351
355
  let shouldWatch = args['--watch'];
356
+ let shouldPoll = args['--poll'];
357
+ let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32';
352
358
  let includePostCss = args['--postcss'];
359
+ // Polling interval in milliseconds
360
+ // Used only when polling or coalescing add/change events on Windows
361
+ let pollInterval = 10;
353
362
  // TODO: Deprecate this in future versions
354
363
  if (!input && args['_'][1]) {
355
364
  console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
@@ -369,14 +378,12 @@ async function build() {
369
378
  let customPostCssPath = typeof args['--postcss'] === 'string' ? args['--postcss'] : undefined;
370
379
  let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
371
380
  let file = _path.default.resolve(customPostCssPath);
372
- // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0.1/src/index.js
373
- let { config ={
374
- } } = await (0, _cosmiconfig).cosmiconfig('postcss').load(file);
381
+ // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
382
+ let { config ={} } = await (0, _lilconfig).lilconfig('postcss').load(file);
375
383
  if (typeof config === 'function') {
376
384
  config = config();
377
385
  } else {
378
- config = Object.assign({
379
- }, config);
386
+ config = Object.assign({}, config);
380
387
  }
381
388
  if (!config.plugins) {
382
389
  config.plugins = [];
@@ -402,9 +409,7 @@ async function build() {
402
409
  ];
403
410
  }
404
411
  function resolveConfig() {
405
- let config = configPath ? require(configPath) : {
406
- };
407
- let resolvedConfig = (0, _resolveConfig).default(config);
412
+ let config = configPath ? require(configPath) : {};
408
413
  if (args['--purge']) {
409
414
  _log.default.warn('purge-flag-deprecated', [
410
415
  'The `--purge` flag has been deprecated.',
@@ -415,9 +420,16 @@ async function build() {
415
420
  }
416
421
  }
417
422
  if (args['--content']) {
418
- resolvedConfig.content.files = args['--content'].split(/(?<!{[^}]+),/);
423
+ let files = args['--content'].split(/(?<!{[^}]+),/);
424
+ let resolvedConfig = (0, _resolveConfig).default(config, {
425
+ content: {
426
+ files
427
+ }
428
+ });
429
+ resolvedConfig.content.files = files;
430
+ return resolvedConfig;
419
431
  }
420
- return resolvedConfig;
432
+ return (0, _resolveConfig).default(config);
421
433
  }
422
434
  function extractFileGlobs(config) {
423
435
  return config.content.files.filter((file)=>{
@@ -482,8 +494,7 @@ async function build() {
482
494
  // Try to load a local `autoprefixer` version first
483
495
  try {
484
496
  return require('autoprefixer');
485
- } catch {
486
- }
497
+ } catch {}
487
498
  return (0, _indexJs).lazyAutoprefixer();
488
499
  })(),
489
500
  args['--minify'] && (()=>{
@@ -498,8 +509,7 @@ async function build() {
498
509
  // Try to load a local `cssnano` version first
499
510
  try {
500
511
  return require('cssnano');
501
- } catch {
502
- }
512
+ } catch {}
503
513
  return (0, _indexJs).lazyCssnano()(options);
504
514
  })(),
505
515
  ].filter(Boolean);
@@ -575,8 +585,7 @@ async function build() {
575
585
  // Try to load a local `autoprefixer` version first
576
586
  try {
577
587
  return require('autoprefixer');
578
- } catch {
579
- }
588
+ } catch {}
580
589
  return (0, _indexJs).lazyAutoprefixer();
581
590
  })(),
582
591
  args['--minify'] && (()=>{
@@ -591,8 +600,7 @@ async function build() {
591
600
  // Try to load a local `cssnano` version first
592
601
  try {
593
602
  return require('cssnano');
594
- } catch {
595
- }
603
+ } catch {}
596
604
  return (0, _indexJs).lazyCssnano()(options);
597
605
  })(),
598
606
  ].filter(Boolean);
@@ -686,10 +694,12 @@ async function build() {
686
694
  ...contextDependencies,
687
695
  ...extractFileGlobs(config1)
688
696
  ], {
697
+ usePolling: shouldPoll,
698
+ interval: shouldPoll ? pollInterval : undefined,
689
699
  ignoreInitial: true,
690
- awaitWriteFinish: process.platform === 'win32' ? {
700
+ awaitWriteFinish: shouldCoalesceWriteEvents ? {
691
701
  stabilityThreshold: 50,
692
- pollInterval: 10
702
+ pollInterval: pollInterval
693
703
  } : false
694
704
  });
695
705
  let chain = Promise.resolve();