tailwindcss 3.0.24 → 3.1.0

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 (88) hide show
  1. package/CHANGELOG.md +57 -3
  2. package/colors.d.ts +3 -0
  3. package/defaultConfig.d.ts +3 -0
  4. package/defaultTheme.d.ts +3 -0
  5. package/lib/cli-peer-dependencies.js +8 -3
  6. package/lib/cli.js +118 -77
  7. package/lib/corePluginList.js +1 -0
  8. package/lib/corePlugins.js +146 -117
  9. package/lib/css/preflight.css +1 -8
  10. package/lib/featureFlags.js +8 -6
  11. package/lib/index.js +10 -13
  12. package/lib/lib/cacheInvalidation.js +32 -14
  13. package/lib/lib/collapseAdjacentRules.js +5 -3
  14. package/lib/lib/defaultExtractor.js +191 -32
  15. package/lib/lib/evaluateTailwindFunctions.js +22 -13
  16. package/lib/lib/expandApplyAtRules.js +232 -195
  17. package/lib/lib/expandTailwindAtRules.js +40 -26
  18. package/lib/lib/generateRules.js +106 -42
  19. package/lib/lib/regex.js +52 -0
  20. package/lib/lib/resolveDefaultsAtRules.js +6 -9
  21. package/lib/lib/setupContextUtils.js +131 -79
  22. package/lib/lib/setupTrackingContext.js +7 -9
  23. package/lib/lib/sharedState.js +1 -2
  24. package/lib/lib/substituteScreenAtRules.js +1 -2
  25. package/lib/postcss-plugins/nesting/plugin.js +1 -2
  26. package/lib/util/buildMediaQuery.js +1 -2
  27. package/lib/util/cloneDeep.js +2 -4
  28. package/lib/util/color.js +26 -36
  29. package/lib/util/createPlugin.js +1 -2
  30. package/lib/util/createUtilityPlugin.js +1 -2
  31. package/lib/util/dataTypes.js +14 -12
  32. package/lib/util/flattenColorPalette.js +2 -5
  33. package/lib/util/formatVariantSelector.js +64 -57
  34. package/lib/util/getAllConfigs.js +10 -5
  35. package/lib/util/isValidArbitraryValue.js +1 -2
  36. package/lib/util/log.js +2 -3
  37. package/lib/util/negateValue.js +1 -2
  38. package/lib/util/normalizeConfig.js +33 -23
  39. package/lib/util/normalizeScreens.js +1 -2
  40. package/lib/util/parseAnimationValue.js +1 -2
  41. package/lib/util/parseBoxShadowValue.js +2 -43
  42. package/lib/util/pluginUtils.js +11 -3
  43. package/lib/util/resolveConfig.js +57 -34
  44. package/lib/util/splitAtTopLevelOnly.js +90 -0
  45. package/lib/util/transformThemeValue.js +4 -2
  46. package/lib/util/validateConfig.js +21 -0
  47. package/lib/util/withAlphaVariable.js +5 -5
  48. package/package.json +21 -16
  49. package/peers/index.js +3264 -1330
  50. package/plugin.d.ts +11 -0
  51. package/src/cli-peer-dependencies.js +7 -1
  52. package/src/cli.js +97 -33
  53. package/src/corePluginList.js +1 -1
  54. package/src/corePlugins.js +57 -40
  55. package/src/css/preflight.css +1 -8
  56. package/src/featureFlags.js +2 -2
  57. package/src/index.js +0 -2
  58. package/src/lib/collapseAdjacentRules.js +5 -1
  59. package/src/lib/defaultExtractor.js +177 -35
  60. package/src/lib/evaluateTailwindFunctions.js +20 -4
  61. package/src/lib/expandApplyAtRules.js +247 -188
  62. package/src/lib/expandTailwindAtRules.js +4 -4
  63. package/src/lib/generateRules.js +69 -5
  64. package/src/lib/regex.js +74 -0
  65. package/src/lib/resolveDefaultsAtRules.js +1 -1
  66. package/src/lib/setupContextUtils.js +103 -39
  67. package/src/lib/setupTrackingContext.js +4 -0
  68. package/src/util/color.js +20 -18
  69. package/src/util/dataTypes.js +11 -5
  70. package/src/util/formatVariantSelector.js +79 -62
  71. package/src/util/getAllConfigs.js +7 -0
  72. package/src/util/log.js +1 -1
  73. package/src/util/normalizeConfig.js +0 -8
  74. package/src/util/parseBoxShadowValue.js +3 -50
  75. package/src/util/pluginUtils.js +13 -1
  76. package/src/util/resolveConfig.js +66 -54
  77. package/src/util/splitAtTopLevelOnly.js +71 -0
  78. package/src/util/toPath.js +1 -1
  79. package/src/util/transformThemeValue.js +4 -2
  80. package/src/util/validateConfig.js +13 -0
  81. package/src/util/withAlphaVariable.js +1 -1
  82. package/stubs/defaultConfig.stub.js +2 -3
  83. package/stubs/simpleConfig.stub.js +1 -0
  84. package/types/config.d.ts +325 -0
  85. package/types/generated/.gitkeep +0 -0
  86. package/types/generated/colors.d.ts +276 -0
  87. package/types/generated/corePluginList.d.ts +1 -0
  88. package/types/index.d.ts +1 -0
@@ -47,8 +47,10 @@ function transformThemeValue(themeSection) {
47
47
  return value;
48
48
  };
49
49
  }
50
- return (value)=>{
51
- if (typeof value === "function") value = value({});
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.0.24",
3
+ "version": "3.1.0",
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.56",
43
- "@swc/core": "^1.2.160",
44
- "@swc/jest": "^0.2.20",
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.4",
47
- "cssnano": "^5.1.7",
48
- "esbuild": "^0.14.25",
49
- "eslint": "^8.11.0",
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": "^27.5.1",
53
- "jest-diff": "^27.5.1",
54
- "prettier": "^2.6.0",
55
- "prettier-plugin-tailwindcss": "^0.1.8",
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.0",
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.12",
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"