tailwindcss 3.0.24 → 3.1.2
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 +75 -3
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +3 -0
- package/lib/cli-peer-dependencies.js +8 -3
- package/lib/cli.js +125 -83
- package/lib/corePluginList.js +1 -0
- package/lib/corePlugins.js +146 -117
- package/lib/css/preflight.css +1 -8
- package/lib/featureFlags.js +8 -6
- package/lib/index.js +10 -13
- package/lib/lib/cacheInvalidation.js +32 -14
- package/lib/lib/collapseAdjacentRules.js +5 -3
- package/lib/lib/defaultExtractor.js +191 -32
- package/lib/lib/evaluateTailwindFunctions.js +22 -13
- package/lib/lib/expandApplyAtRules.js +232 -195
- package/lib/lib/expandTailwindAtRules.js +40 -26
- package/lib/lib/generateRules.js +106 -42
- package/lib/lib/regex.js +52 -0
- package/lib/lib/resolveDefaultsAtRules.js +56 -45
- package/lib/lib/setupContextUtils.js +131 -79
- package/lib/lib/setupTrackingContext.js +7 -9
- package/lib/lib/sharedState.js +1 -2
- package/lib/lib/substituteScreenAtRules.js +1 -2
- package/lib/postcss-plugins/nesting/plugin.js +1 -2
- package/lib/util/buildMediaQuery.js +1 -2
- package/lib/util/cloneDeep.js +2 -4
- package/lib/util/color.js +26 -36
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +1 -2
- package/lib/util/dataTypes.js +14 -12
- package/lib/util/flattenColorPalette.js +2 -5
- package/lib/util/formatVariantSelector.js +64 -57
- package/lib/util/getAllConfigs.js +10 -5
- package/lib/util/isValidArbitraryValue.js +1 -2
- package/lib/util/log.js +2 -3
- package/lib/util/negateValue.js +1 -2
- package/lib/util/normalizeConfig.js +33 -23
- package/lib/util/normalizeScreens.js +1 -2
- package/lib/util/parseAnimationValue.js +1 -2
- package/lib/util/parseBoxShadowValue.js +2 -43
- package/lib/util/pluginUtils.js +11 -3
- package/lib/util/resolveConfig.js +57 -34
- package/lib/util/splitAtTopLevelOnly.js +90 -0
- package/lib/util/transformThemeValue.js +4 -2
- package/lib/util/validateConfig.js +21 -0
- package/lib/util/withAlphaVariable.js +5 -5
- package/package.json +21 -16
- package/peers/index.js +3264 -1330
- package/plugin.d.ts +11 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +104 -34
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +57 -40
- package/src/css/preflight.css +1 -8
- package/src/featureFlags.js +2 -2
- package/src/index.js +0 -2
- package/src/lib/collapseAdjacentRules.js +5 -1
- package/src/lib/defaultExtractor.js +177 -35
- package/src/lib/evaluateTailwindFunctions.js +20 -4
- package/src/lib/expandApplyAtRules.js +247 -188
- package/src/lib/expandTailwindAtRules.js +4 -4
- package/src/lib/generateRules.js +69 -5
- package/src/lib/regex.js +74 -0
- package/src/lib/resolveDefaultsAtRules.js +53 -36
- package/src/lib/setupContextUtils.js +103 -39
- package/src/lib/setupTrackingContext.js +4 -0
- package/src/util/color.js +20 -18
- package/src/util/dataTypes.js +11 -5
- package/src/util/formatVariantSelector.js +79 -62
- package/src/util/getAllConfigs.js +7 -0
- package/src/util/log.js +1 -1
- package/src/util/normalizeConfig.js +0 -8
- package/src/util/parseBoxShadowValue.js +3 -50
- package/src/util/pluginUtils.js +13 -1
- package/src/util/resolveConfig.js +66 -54
- package/src/util/splitAtTopLevelOnly.js +71 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +4 -2
- package/src/util/validateConfig.js +13 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +2 -3
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +325 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +276 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/index.d.ts +7 -0
|
@@ -47,8 +47,10 @@ function transformThemeValue(themeSection) {
|
|
|
47
47
|
return value;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
return (value)=>{
|
|
51
|
-
if (typeof value === "function")
|
|
50
|
+
return (value, opts = {})=>{
|
|
51
|
+
if (typeof value === "function") {
|
|
52
|
+
value = value(opts);
|
|
53
|
+
}
|
|
52
54
|
return value;
|
|
53
55
|
};
|
|
54
56
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.validateConfig = validateConfig;
|
|
6
|
+
var _log = _interopRequireDefault(require("./log"));
|
|
7
|
+
function _interopRequireDefault(obj) {
|
|
8
|
+
return obj && obj.__esModule ? obj : {
|
|
9
|
+
default: obj
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function validateConfig(config) {
|
|
13
|
+
if (config.content.files.length === 0) {
|
|
14
|
+
_log.default.warn("content-problems", [
|
|
15
|
+
"The `content` option in your Tailwind CSS configuration is missing or empty.",
|
|
16
|
+
"Configure your content sources or your generated CSS will be missing styles.",
|
|
17
|
+
"https://tailwindcss.com/docs/content-configuration",
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
return config;
|
|
21
|
+
}
|
|
@@ -26,16 +26,14 @@ function withAlphaVariable({ color , property , variable }) {
|
|
|
26
26
|
return Object.fromEntries(properties.map((p)=>[
|
|
27
27
|
p,
|
|
28
28
|
color
|
|
29
|
-
]
|
|
30
|
-
));
|
|
29
|
+
]));
|
|
31
30
|
}
|
|
32
31
|
if (parsed.alpha !== undefined) {
|
|
33
32
|
// Has an alpha value, return color as-is
|
|
34
33
|
return Object.fromEntries(properties.map((p)=>[
|
|
35
34
|
p,
|
|
36
35
|
color
|
|
37
|
-
]
|
|
38
|
-
));
|
|
36
|
+
]));
|
|
39
37
|
}
|
|
40
38
|
return {
|
|
41
39
|
[variable]: "1",
|
|
@@ -56,7 +54,9 @@ function withAlphaValue(color, alphaValue, defaultValue) {
|
|
|
56
54
|
opacityValue: alphaValue
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
|
-
let parsed = (0, _color).parseColor(color
|
|
57
|
+
let parsed = (0, _color).parseColor(color, {
|
|
58
|
+
loose: true
|
|
59
|
+
});
|
|
60
60
|
if (parsed === null) {
|
|
61
61
|
return defaultValue;
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
7
8
|
"repository": "https://github.com/tailwindlabs/tailwindcss.git",
|
|
8
9
|
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
|
|
9
10
|
"homepage": "https://tailwindcss.com",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"posttest": "npm run style",
|
|
26
27
|
"generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
|
|
27
28
|
"generate:types": "node -r @swc/register scripts/generate-types.js",
|
|
28
|
-
"generate": "npm run generate:plugin-list"
|
|
29
|
+
"generate": "npm run generate:plugin-list && npm run generate:types"
|
|
29
30
|
},
|
|
30
31
|
"files": [
|
|
31
32
|
"src/*",
|
|
@@ -35,24 +36,26 @@
|
|
|
35
36
|
"scripts/*.js",
|
|
36
37
|
"stubs/*.stub.js",
|
|
37
38
|
"nesting/*",
|
|
39
|
+
"types/**/*",
|
|
40
|
+
"*.d.ts",
|
|
38
41
|
"*.css",
|
|
39
42
|
"*.js"
|
|
40
43
|
],
|
|
41
44
|
"devDependencies": {
|
|
42
|
-
"@swc/cli": "^0.1.
|
|
43
|
-
"@swc/core": "^1.2.
|
|
44
|
-
"@swc/jest": "^0.2.
|
|
45
|
+
"@swc/cli": "^0.1.57",
|
|
46
|
+
"@swc/core": "^1.2.196",
|
|
47
|
+
"@swc/jest": "^0.2.21",
|
|
45
48
|
"@swc/register": "^0.1.10",
|
|
46
|
-
"autoprefixer": "^10.4.
|
|
47
|
-
"cssnano": "^5.1.
|
|
48
|
-
"esbuild": "^0.14.
|
|
49
|
-
"eslint": "^8.
|
|
49
|
+
"autoprefixer": "^10.4.7",
|
|
50
|
+
"cssnano": "^5.1.9",
|
|
51
|
+
"esbuild": "^0.14.39",
|
|
52
|
+
"eslint": "^8.16.0",
|
|
50
53
|
"eslint-config-prettier": "^8.5.0",
|
|
51
54
|
"eslint-plugin-prettier": "^4.0.0",
|
|
52
|
-
"jest": "^
|
|
53
|
-
"jest-diff": "^
|
|
54
|
-
"prettier": "^2.6.
|
|
55
|
-
"prettier-plugin-tailwindcss": "^0.1.
|
|
55
|
+
"jest": "^28.1.0",
|
|
56
|
+
"jest-diff": "^28.1.0",
|
|
57
|
+
"prettier": "^2.6.2",
|
|
58
|
+
"prettier-plugin-tailwindcss": "^0.1.11",
|
|
56
59
|
"rimraf": "^3.0.0",
|
|
57
60
|
"source-map-js": "^1.0.2"
|
|
58
61
|
},
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
"arg": "^5.0.1",
|
|
64
67
|
"chokidar": "^3.5.3",
|
|
65
68
|
"color-name": "^1.1.4",
|
|
66
|
-
"detective": "^5.2.
|
|
69
|
+
"detective": "^5.2.1",
|
|
67
70
|
"didyoumean": "^1.2.2",
|
|
68
71
|
"dlv": "^1.1.3",
|
|
69
72
|
"fast-glob": "^3.2.11",
|
|
@@ -73,7 +76,8 @@
|
|
|
73
76
|
"normalize-path": "^3.0.0",
|
|
74
77
|
"object-hash": "^3.0.0",
|
|
75
78
|
"picocolors": "^1.0.0",
|
|
76
|
-
"postcss": "^8.4.
|
|
79
|
+
"postcss": "^8.4.14",
|
|
80
|
+
"postcss-import": "^14.1.0",
|
|
77
81
|
"postcss-js": "^4.0.0",
|
|
78
82
|
"postcss-load-config": "^3.1.4",
|
|
79
83
|
"postcss-nested": "5.0.6",
|
|
@@ -96,7 +100,8 @@
|
|
|
96
100
|
"testPathIgnorePatterns": [
|
|
97
101
|
"/node_modules/",
|
|
98
102
|
"/integrations/",
|
|
99
|
-
"/standalone-cli/"
|
|
103
|
+
"/standalone-cli/",
|
|
104
|
+
"\\.test\\.skip\\.js$"
|
|
100
105
|
],
|
|
101
106
|
"transform": {
|
|
102
107
|
"\\.js$": "@swc/jest"
|