tailwindcss 3.0.15 → 3.0.16

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 CHANGED
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - Nothing yet!
11
11
 
12
+ ## [3.0.16] - 2022-01-24
13
+
14
+ ### Fixed
15
+
16
+ - Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](https://github.com/tailwindlabs/tailwindcss/pull/7080))
17
+
12
18
  ## [3.0.15] - 2022-01-15
13
19
 
14
20
  ### Fixed
@@ -1815,7 +1821,8 @@ No release notes
1815
1821
 
1816
1822
  - Everything!
1817
1823
 
1818
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.15...HEAD
1824
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.16...HEAD
1825
+ [3.0.16]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.15...v3.0.16
1819
1826
  [3.0.15]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.14...v3.0.15
1820
1827
  [3.0.14]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.13...v3.0.14
1821
1828
  [3.0.13]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...v3.0.13
@@ -184,7 +184,8 @@ let variantPlugins = {
184
184
  mode = 'media';
185
185
  _log.default.warn('darkmode-false', [
186
186
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
187
- 'Change `darkMode` to `media` or remove it entirely.',
187
+ 'Change `darkMode` to `media` or remove it entirely.',
188
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
188
189
  ]);
189
190
  }
190
191
  if (mode === 'class') {
@@ -231,7 +231,8 @@ function expandTailwindAtRules(context) {
231
231
  });
232
232
  if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) {
233
233
  _log.default.warn('content-problems', [
234
- 'No utilities were generated there is likely a problem with the `content` key in the tailwind config. For more information see the documentation: https://tailwindcss.com/docs/content-configuration',
234
+ 'No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.',
235
+ 'https://tailwindcss.com/docs/content-configuration',
235
236
  ]);
236
237
  }
237
238
  // ---
@@ -49,7 +49,8 @@ function normalizeTailwindDirectives(root) {
49
49
  ].includes(atRule.name)) {
50
50
  _log.default.warn(`${atRule.name}-at-rule-deprecated`, [
51
51
  `The \`@${atRule.name}\` directive has been deprecated in Tailwind CSS v3.0.`,
52
- `Use \`@layer utilities\` or \`@layer components\` instead.`,
52
+ `Use \`@layer utilities\` or \`@layer components\` instead.`,
53
+ 'https://tailwindcss.com/docs/upgrade-guide#replace-variants-with-layer',
53
54
  ]);
54
55
  }
55
56
  layerDirectives.add(atRule);
@@ -664,7 +664,8 @@ function registerPlugins(plugins, context) {
664
664
  if (value1 instanceof RegExp) {
665
665
  _log.default.warn('root-regex', [
666
666
  'Regular expressions in `safelist` work differently in Tailwind CSS v3.0.',
667
- 'Update your `safelist` configuration to eliminate this warning.'
667
+ 'Update your `safelist` configuration to eliminate this warning.',
668
+ 'https://tailwindcss.com/docs/content-configuration#safelisting-classes',
668
669
  ]);
669
670
  continue;
670
671
  }
@@ -716,7 +717,8 @@ function registerPlugins(plugins, context) {
716
717
  if (count !== 0) continue;
717
718
  _log.default.warn([
718
719
  `The safelist pattern \`${regex}\` doesn't match any Tailwind CSS classes.`,
719
- 'Fix this pattern or remove it from your `safelist` configuration.',
720
+ 'Fix this pattern or remove it from your `safelist` configuration.',
721
+ 'https://tailwindcss.com/docs/content-configuration#safelisting-classes',
720
722
  ]);
721
723
  }
722
724
  }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.default = void 0;
6
+ var _plugin = require("./plugin");
7
+ var _default = Object.assign(function(opts) {
8
+ return {
9
+ postcssPlugin: 'tailwindcss/nesting',
10
+ Once (root, { result }) {
11
+ return (0, _plugin).nesting(opts)(root, result);
12
+ }
13
+ };
14
+ }, {
15
+ postcss: true
16
+ });
17
+ exports.default = _default;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.nesting = nesting;
6
+ var _postcss = _interopRequireDefault(require("postcss"));
7
+ var _postcssNested = _interopRequireDefault(require("postcss-nested"));
8
+ function _interopRequireDefault(obj) {
9
+ return obj && obj.__esModule ? obj : {
10
+ default: obj
11
+ };
12
+ }
13
+ function nesting(opts = _postcssNested.default) {
14
+ return (root, result)=>{
15
+ root.walkAtRules('screen', (rule)=>{
16
+ rule.name = 'media';
17
+ rule.params = `screen(${rule.params})`;
18
+ });
19
+ root.walkAtRules('apply', (rule)=>{
20
+ rule.before(_postcss.default.decl({
21
+ prop: '__apply',
22
+ value: rule.params,
23
+ source: rule.source
24
+ }));
25
+ rule.remove();
26
+ });
27
+ let plugin = (()=>{
28
+ var ref;
29
+ if (typeof opts === 'function' || typeof opts === 'object' && (opts === null || opts === void 0 ? void 0 : (ref = opts.hasOwnProperty) === null || ref === void 0 ? void 0 : ref.call(opts, 'postcssPlugin'))) {
30
+ return opts;
31
+ }
32
+ if (typeof opts === 'string') {
33
+ return require(opts);
34
+ }
35
+ if (Object.keys(opts).length <= 0) {
36
+ return _postcssNested.default;
37
+ }
38
+ throw new Error('tailwindcss/nesting should be loaded with a nesting plugin.');
39
+ })();
40
+ (0, _postcss).default([
41
+ plugin
42
+ ]).process(root, result.opts).sync();
43
+ root.walkDecls('__apply', (decl)=>{
44
+ decl.before(_postcss.default.atRule({
45
+ name: 'apply',
46
+ params: decl.value,
47
+ source: decl.source
48
+ }));
49
+ decl.remove();
50
+ });
51
+ return root;
52
+ };
53
+ }
@@ -123,7 +123,8 @@ function normalizeConfig(config) {
123
123
  if (!valid) {
124
124
  _log.default.warn('purge-deprecation', [
125
125
  'The `purge`/`content` options have changed in Tailwind CSS v3.0.',
126
- 'Update your configuration file to eliminate this warning.'
126
+ 'Update your configuration file to eliminate this warning.',
127
+ 'https://tailwindcss.com/docs/upgrade-guide#configure-content-sources',
127
128
  ]);
128
129
  }
129
130
  // Normalize the `safelist`
@@ -140,7 +141,8 @@ function normalizeConfig(config) {
140
141
  if (typeof config.prefix === 'function') {
141
142
  _log.default.warn('prefix-function', [
142
143
  'As of Tailwind CSS v3.0, `prefix` cannot be a function.',
143
- 'Update `prefix` in your configuration to be a string to eliminate this warning.'
144
+ 'Update `prefix` in your configuration to be a string to eliminate this warning.',
145
+ 'https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function',
144
146
  ]);
145
147
  config.prefix = '';
146
148
  } else {
@@ -221,15 +223,17 @@ function normalizeConfig(config) {
221
223
  for (let file of config.content.files){
222
224
  if (typeof file === 'string' && /{([^,]*?)}/g.test(file)) {
223
225
  _log.default.warn('invalid-glob-braces', [
224
- `The glob pattern ${(0, _log).dim(file)} in your config is invalid.`,
225
- ` Update it to ${(0, _log).dim(file.replace(/{([^,]*?)}/g, '$1'))} to silence this warning.`
226
+ `The glob pattern ${(0, _log).dim(file)} in your Tailwind CSS configuration is invalid.`,
227
+ `Update it to ${(0, _log).dim(file.replace(/{([^,]*?)}/g, '$1'))} to silence this warning.`
226
228
  ]);
227
229
  break;
228
230
  }
229
231
  }
230
232
  if (config.content.files.length === 0) {
231
233
  _log.default.warn('content-problems', [
232
- 'The `content` key is missing or empty. Please populate the content key as Tailwind generates utilities on-demand based on the files that use them. For more information see the documentation: https://tailwindcss.com/docs/content-configuration',
234
+ 'The `content` option in your Tailwind CSS configuration is missing or empty.',
235
+ 'Configure your content sources or your generated CSS will be missing styles.',
236
+ 'https://tailwindcss.com/docs/content-configuration',
233
237
  ]);
234
238
  }
235
239
  return config;
package/nesting/index.js CHANGED
@@ -1,12 +1,2 @@
1
- let nesting = require('./plugin')
2
-
3
- module.exports = (opts) => {
4
- return {
5
- postcssPlugin: 'tailwindcss/nesting',
6
- Once(root, { result }) {
7
- return nesting(opts)(root, result)
8
- },
9
- }
10
- }
11
-
12
- module.exports.postcss = true
1
+ let nesting = require('../lib/postcss-plugins/nesting')
2
+ module.exports = (nesting.__esModule ? nesting : { default: nesting }).default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "3.0.15",
3
+ "version": "3.0.16",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -45,10 +45,10 @@
45
45
  "devDependencies": {
46
46
  "@swc/cli": "^0.1.55",
47
47
  "@swc/core": "^1.2.127",
48
- "@swc/jest": "^0.2.15",
48
+ "@swc/jest": "^0.2.17",
49
49
  "@swc/register": "^0.1.7",
50
50
  "autoprefixer": "^10.4.1",
51
- "cssnano": "^5.0.14",
51
+ "cssnano": "^5.0.15",
52
52
  "esbuild": "^0.14.10",
53
53
  "eslint": "^8.6.0",
54
54
  "eslint-config-prettier": "^8.3.0",
@@ -72,7 +72,7 @@
72
72
  "detective": "^5.2.0",
73
73
  "didyoumean": "^1.2.2",
74
74
  "dlv": "^1.1.3",
75
- "fast-glob": "^3.2.7",
75
+ "fast-glob": "^3.2.11",
76
76
  "glob-parent": "^6.0.2",
77
77
  "is-glob": "^4.0.3",
78
78
  "normalize-path": "^3.0.0",