tailwindcss 3.0.14 → 3.0.18
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 +32 -1
- package/lib/cli.js +9 -3
- package/lib/corePlugins.js +2 -1
- package/lib/lib/expandTailwindAtRules.js +2 -1
- package/lib/lib/generateRules.js +2 -1
- package/lib/lib/normalizeTailwindDirectives.js +2 -1
- package/lib/lib/setupContextUtils.js +4 -2
- package/{nesting → lib/postcss-plugins/nesting}/README.md +0 -0
- package/lib/postcss-plugins/nesting/index.js +17 -0
- package/lib/postcss-plugins/nesting/plugin.js +53 -0
- package/lib/processTailwindFeatures.js +5 -0
- package/lib/util/normalizeConfig.js +9 -5
- package/nesting/index.js +2 -12
- package/package.json +7 -7
- package/peers/index.js +787 -743
- package/src/cli.js +5 -3
- package/src/corePlugins.js +1 -0
- package/src/lib/expandTailwindAtRules.js +2 -1
- package/src/lib/generateRules.js +2 -1
- package/src/lib/normalizeTailwindDirectives.js +1 -0
- package/src/lib/setupContextUtils.js +2 -1
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/{nesting → src/postcss-plugins/nesting}/plugin.js +4 -4
- package/src/processTailwindFeatures.js +6 -0
- package/src/util/normalizeConfig.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,33 @@ 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.18] - 2022-01-28
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Fix `@apply` order regression (in `addComponents`, `addUtilities`, ...) ([#7232](https://github.com/tailwindlabs/tailwindcss/pull/7232))
|
|
17
|
+
- Quick fix for incorrect arbitrary properties when using URLs ([#7252](https://github.com/tailwindlabs/tailwindcss/pull/7252))
|
|
18
|
+
|
|
19
|
+
## [3.0.17] - 2022-01-26
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Remove false positive warning in CLI when using the `--content` option ([#7220](https://github.com/tailwindlabs/tailwindcss/pull/7220))
|
|
24
|
+
|
|
25
|
+
## [3.0.16] - 2022-01-24
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting) ([#7080](https://github.com/tailwindlabs/tailwindcss/pull/7080))
|
|
30
|
+
- Improve various warnings ([#7118](https://github.com/tailwindlabs/tailwindcss/pull/7118))
|
|
31
|
+
- Fix grammatical mistake ([cca5a38](https://github.com/tailwindlabs/tailwindcss/commit/cca5a3804e1d3ee0214491921e1aec35bf62a813))
|
|
32
|
+
|
|
33
|
+
## [3.0.15] - 2022-01-15
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Temporarily remove optional chaining in nesting plugin ([#7077](https://github.com/tailwindlabs/tailwindcss/pull/7077))
|
|
38
|
+
|
|
12
39
|
## [3.0.14] - 2022-01-14
|
|
13
40
|
|
|
14
41
|
### Added
|
|
@@ -1809,7 +1836,11 @@ No release notes
|
|
|
1809
1836
|
|
|
1810
1837
|
- Everything!
|
|
1811
1838
|
|
|
1812
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.
|
|
1839
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.18...HEAD
|
|
1840
|
+
[3.0.18]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.17...v3.0.18
|
|
1841
|
+
[3.0.17]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.16...v3.0.17
|
|
1842
|
+
[3.0.16]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.15...v3.0.16
|
|
1843
|
+
[3.0.15]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.14...v3.0.15
|
|
1813
1844
|
[3.0.14]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.13...v3.0.14
|
|
1814
1845
|
[3.0.13]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.12...v3.0.13
|
|
1815
1846
|
[3.0.12]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.11...v3.0.12
|
package/lib/cli.js
CHANGED
|
@@ -400,7 +400,6 @@ async function build() {
|
|
|
400
400
|
}
|
|
401
401
|
function resolveConfig() {
|
|
402
402
|
let config = configPath ? require(configPath) : {};
|
|
403
|
-
let resolvedConfig = (0, _resolveConfig).default(config);
|
|
404
403
|
if (args['--purge']) {
|
|
405
404
|
_log.default.warn('purge-flag-deprecated', [
|
|
406
405
|
'The `--purge` flag has been deprecated.',
|
|
@@ -411,9 +410,16 @@ async function build() {
|
|
|
411
410
|
}
|
|
412
411
|
}
|
|
413
412
|
if (args['--content']) {
|
|
414
|
-
|
|
413
|
+
let files = args['--content'].split(/(?<!{[^}]+),/);
|
|
414
|
+
let resolvedConfig = (0, _resolveConfig).default(config, {
|
|
415
|
+
content: {
|
|
416
|
+
files
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
resolvedConfig.content.files = files;
|
|
420
|
+
return resolvedConfig;
|
|
415
421
|
}
|
|
416
|
-
return
|
|
422
|
+
return (0, _resolveConfig).default(config);
|
|
417
423
|
}
|
|
418
424
|
function extractFileGlobs(config) {
|
|
419
425
|
return config.content.files.filter((file)=>{
|
package/lib/corePlugins.js
CHANGED
|
@@ -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
|
|
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
|
// ---
|
package/lib/lib/generateRules.js
CHANGED
|
@@ -265,7 +265,8 @@ function parseRules(rule, cache, options = {}) {
|
|
|
265
265
|
}
|
|
266
266
|
const IS_VALID_PROPERTY_NAME = /^[a-z_-]/;
|
|
267
267
|
function isValidPropName(name) {
|
|
268
|
-
|
|
268
|
+
// TODO: properly fix this!
|
|
269
|
+
return IS_VALID_PROPERTY_NAME.test(name) && !name.startsWith('http');
|
|
269
270
|
}
|
|
270
271
|
function isParsableCssValue(property, value) {
|
|
271
272
|
try {
|
|
@@ -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
|
}
|
|
File without changes
|
|
@@ -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
|
+
}
|
|
@@ -24,6 +24,8 @@ function processTailwindFeatures(setupContext) {
|
|
|
24
24
|
return function(root, result) {
|
|
25
25
|
let { tailwindDirectives , applyDirectives } = (0, _normalizeTailwindDirectives).default(root);
|
|
26
26
|
(0, _detectNesting).default()(root, result);
|
|
27
|
+
// Partition apply rules that are found in the css
|
|
28
|
+
// itself.
|
|
27
29
|
(0, _partitionApplyAtRules).default()(root, result);
|
|
28
30
|
let context = setupContext({
|
|
29
31
|
tailwindDirectives,
|
|
@@ -44,6 +46,9 @@ function processTailwindFeatures(setupContext) {
|
|
|
44
46
|
}
|
|
45
47
|
(0, _featureFlags).issueFlagNotices(context.tailwindConfig);
|
|
46
48
|
(0, _expandTailwindAtRules).default(context)(root, result);
|
|
49
|
+
// Partition apply rules that are generated by
|
|
50
|
+
// addComponents, addUtilities and so on.
|
|
51
|
+
(0, _partitionApplyAtRules).default()(root, result);
|
|
47
52
|
(0, _expandApplyAtRules).default(context)(root, result);
|
|
48
53
|
(0, _evaluateTailwindFunctions).default(context)(root, result);
|
|
49
54
|
(0, _substituteScreenAtRules).default(context)(root, result);
|
|
@@ -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
|
|
225
|
-
`
|
|
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`
|
|
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('
|
|
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.
|
|
3
|
+
"version": "3.0.18",
|
|
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.
|
|
48
|
+
"@swc/jest": "^0.2.17",
|
|
49
49
|
"@swc/register": "^0.1.7",
|
|
50
|
-
"autoprefixer": "^10.4.
|
|
51
|
-
"cssnano": "^5.0.
|
|
50
|
+
"autoprefixer": "^10.4.2",
|
|
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",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"arg": "^5.0.1",
|
|
68
68
|
"chalk": "^4.1.2",
|
|
69
|
-
"chokidar": "^3.5.
|
|
69
|
+
"chokidar": "^3.5.3",
|
|
70
70
|
"color-name": "^1.1.4",
|
|
71
71
|
"cosmiconfig": "^7.0.1",
|
|
72
72
|
"detective": "^5.2.0",
|
|
73
73
|
"didyoumean": "^1.2.2",
|
|
74
74
|
"dlv": "^1.1.3",
|
|
75
|
-
"fast-glob": "^3.2.
|
|
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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"postcss-js": "^4.0.0",
|
|
81
81
|
"postcss-load-config": "^3.1.0",
|
|
82
82
|
"postcss-nested": "5.0.6",
|
|
83
|
-
"postcss-selector-parser": "^6.0.
|
|
83
|
+
"postcss-selector-parser": "^6.0.9",
|
|
84
84
|
"postcss-value-parser": "^4.2.0",
|
|
85
85
|
"quick-lru": "^5.1.1",
|
|
86
86
|
"resolve": "^1.21.0"
|