tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.cab1fce

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 (148) hide show
  1. package/CHANGELOG.md +380 -1
  2. package/LICENSE +1 -2
  3. package/README.md +8 -4
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -1
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -1
  8. package/defaultTheme.d.ts +3 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli-peer-dependencies.js +10 -5
  11. package/lib/cli.js +311 -213
  12. package/lib/constants.js +9 -9
  13. package/lib/corePluginList.js +11 -1
  14. package/lib/corePlugins.js +1895 -1773
  15. package/lib/css/preflight.css +19 -13
  16. package/lib/featureFlags.js +22 -16
  17. package/lib/index.js +17 -8
  18. package/lib/lib/cacheInvalidation.js +69 -0
  19. package/lib/lib/collapseAdjacentRules.js +30 -14
  20. package/lib/lib/collapseDuplicateDeclarations.js +80 -0
  21. package/lib/lib/defaultExtractor.js +187 -0
  22. package/lib/lib/detectNesting.js +17 -2
  23. package/lib/lib/evaluateTailwindFunctions.js +40 -24
  24. package/lib/lib/expandApplyAtRules.js +414 -157
  25. package/lib/lib/expandTailwindAtRules.js +156 -151
  26. package/lib/lib/generateRules.js +402 -68
  27. package/lib/lib/getModuleDependencies.js +14 -14
  28. package/lib/lib/normalizeTailwindDirectives.js +45 -36
  29. package/lib/lib/partitionApplyAtRules.js +53 -0
  30. package/lib/lib/regex.js +53 -0
  31. package/lib/lib/resolveDefaultsAtRules.js +105 -90
  32. package/lib/lib/setupContextUtils.js +416 -291
  33. package/lib/lib/setupTrackingContext.js +60 -56
  34. package/lib/lib/sharedState.js +38 -15
  35. package/lib/lib/substituteScreenAtRules.js +9 -6
  36. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  37. package/lib/postcss-plugins/nesting/index.js +17 -0
  38. package/lib/postcss-plugins/nesting/plugin.js +85 -0
  39. package/lib/processTailwindFeatures.js +21 -9
  40. package/lib/public/colors.js +244 -248
  41. package/lib/public/resolve-config.js +5 -5
  42. package/lib/util/buildMediaQuery.js +13 -24
  43. package/lib/util/cloneDeep.js +1 -1
  44. package/lib/util/cloneNodes.js +12 -1
  45. package/lib/util/color.js +43 -32
  46. package/lib/util/createPlugin.js +1 -2
  47. package/lib/util/createUtilityPlugin.js +13 -17
  48. package/lib/util/dataTypes.js +114 -74
  49. package/lib/util/defaults.js +6 -0
  50. package/lib/util/escapeClassName.js +5 -5
  51. package/lib/util/escapeCommas.js +1 -1
  52. package/lib/util/flattenColorPalette.js +2 -4
  53. package/lib/util/formatVariantSelector.js +194 -0
  54. package/lib/util/getAllConfigs.js +13 -5
  55. package/lib/util/hashConfig.js +5 -5
  56. package/lib/util/isKeyframeRule.js +1 -1
  57. package/lib/util/isPlainObject.js +1 -1
  58. package/lib/util/isValidArbitraryValue.js +64 -0
  59. package/lib/util/log.js +35 -19
  60. package/lib/util/nameClass.js +7 -6
  61. package/lib/util/negateValue.js +5 -3
  62. package/lib/util/normalizeConfig.js +233 -0
  63. package/lib/util/normalizeScreens.js +59 -0
  64. package/lib/util/parseAnimationValue.js +56 -56
  65. package/lib/util/parseBoxShadowValue.js +76 -0
  66. package/lib/util/parseDependency.js +32 -32
  67. package/lib/util/parseObjectStyles.js +6 -6
  68. package/lib/util/pluginUtils.js +67 -170
  69. package/lib/util/prefixSelector.js +4 -7
  70. package/lib/util/resolveConfig.js +123 -133
  71. package/lib/util/resolveConfigPath.js +17 -18
  72. package/lib/util/responsive.js +6 -6
  73. package/lib/util/splitAtTopLevelOnly.js +72 -0
  74. package/lib/util/toColorValue.js +1 -2
  75. package/lib/util/toPath.js +6 -1
  76. package/lib/util/transformThemeValue.js +42 -34
  77. package/lib/util/validateConfig.js +21 -0
  78. package/lib/util/withAlphaVariable.js +19 -19
  79. package/nesting/index.js +2 -12
  80. package/package.json +41 -42
  81. package/peers/index.js +11539 -10859
  82. package/plugin.d.ts +11 -0
  83. package/plugin.js +2 -1
  84. package/resolveConfig.js +2 -1
  85. package/scripts/create-plugin-list.js +2 -2
  86. package/scripts/generate-types.js +52 -0
  87. package/src/cli-peer-dependencies.js +7 -1
  88. package/src/cli.js +174 -41
  89. package/src/corePluginList.js +1 -1
  90. package/src/corePlugins.js +641 -596
  91. package/src/css/preflight.css +19 -13
  92. package/src/featureFlags.js +16 -10
  93. package/src/index.js +14 -6
  94. package/src/lib/cacheInvalidation.js +52 -0
  95. package/src/lib/collapseAdjacentRules.js +21 -2
  96. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  97. package/src/lib/defaultExtractor.js +192 -0
  98. package/src/lib/detectNesting.js +22 -3
  99. package/src/lib/evaluateTailwindFunctions.js +24 -7
  100. package/src/lib/expandApplyAtRules.js +442 -154
  101. package/src/lib/expandTailwindAtRules.js +91 -65
  102. package/src/lib/generateRules.js +409 -43
  103. package/src/lib/normalizeTailwindDirectives.js +10 -3
  104. package/src/lib/partitionApplyAtRules.js +52 -0
  105. package/src/lib/regex.js +74 -0
  106. package/src/lib/resolveDefaultsAtRules.js +74 -53
  107. package/src/lib/setupContextUtils.js +388 -208
  108. package/src/lib/setupTrackingContext.js +15 -12
  109. package/src/lib/sharedState.js +42 -7
  110. package/src/lib/substituteScreenAtRules.js +6 -3
  111. package/src/postcss-plugins/nesting/README.md +42 -0
  112. package/src/postcss-plugins/nesting/index.js +13 -0
  113. package/src/postcss-plugins/nesting/plugin.js +80 -0
  114. package/src/processTailwindFeatures.js +17 -2
  115. package/src/public/colors.js +4 -9
  116. package/src/util/buildMediaQuery.js +14 -18
  117. package/src/util/cloneNodes.js +14 -1
  118. package/src/util/color.js +31 -14
  119. package/src/util/createUtilityPlugin.js +2 -2
  120. package/src/util/dataTypes.js +56 -16
  121. package/src/util/defaults.js +6 -0
  122. package/src/util/formatVariantSelector.js +213 -0
  123. package/src/util/getAllConfigs.js +7 -0
  124. package/src/util/isValidArbitraryValue.js +61 -0
  125. package/src/util/log.js +23 -22
  126. package/src/util/nameClass.js +2 -2
  127. package/src/util/negateValue.js +4 -2
  128. package/src/util/normalizeConfig.js +262 -0
  129. package/src/util/normalizeScreens.js +45 -0
  130. package/src/util/parseBoxShadowValue.js +72 -0
  131. package/src/util/pluginUtils.js +51 -147
  132. package/src/util/prefixSelector.js +7 -8
  133. package/src/util/resolveConfig.js +108 -79
  134. package/src/util/splitAtTopLevelOnly.js +71 -0
  135. package/src/util/toPath.js +23 -1
  136. package/src/util/transformThemeValue.js +24 -7
  137. package/src/util/validateConfig.js +13 -0
  138. package/stubs/defaultConfig.stub.js +157 -94
  139. package/stubs/simpleConfig.stub.js +0 -1
  140. package/types/config.d.ts +325 -0
  141. package/types/generated/.gitkeep +0 -0
  142. package/types/generated/colors.d.ts +276 -0
  143. package/types/generated/corePluginList.d.ts +1 -0
  144. package/types/index.d.ts +1 -0
  145. package/types.d.ts +1 -0
  146. package/lib/lib/setupWatchingContext.js +0 -284
  147. package/nesting/plugin.js +0 -41
  148. package/src/lib/setupWatchingContext.js +0 -306
@@ -2,29 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- exports.withAlphaValue = withAlphaValue;
6
5
  exports.default = withAlphaVariable;
6
+ exports.withAlphaValue = withAlphaValue;
7
7
  var _color = require("./color");
8
- function withAlphaValue(color, alphaValue, defaultValue) {
9
- if (typeof color === 'function') {
10
- return color({
11
- opacityValue: alphaValue
12
- });
13
- }
14
- let parsed = (0, _color).parseColor(color);
15
- if (parsed === null) {
16
- return defaultValue;
17
- }
18
- return (0, _color).formatColor({
19
- ...parsed,
20
- alpha: alphaValue
21
- });
22
- }
23
8
  function withAlphaVariable({ color , property , variable }) {
24
9
  let properties = [].concat(property);
25
- if (typeof color === 'function') {
10
+ if (typeof color === "function") {
26
11
  return {
27
- [variable]: '1',
12
+ [variable]: "1",
28
13
  ...Object.fromEntries(properties.map((p)=>{
29
14
  return [
30
15
  p,
@@ -53,7 +38,7 @@ function withAlphaVariable({ color , property , variable }) {
53
38
  ));
54
39
  }
55
40
  return {
56
- [variable]: '1',
41
+ [variable]: "1",
57
42
  ...Object.fromEntries(properties.map((p)=>{
58
43
  return [
59
44
  p,
@@ -65,3 +50,18 @@ function withAlphaVariable({ color , property , variable }) {
65
50
  }))
66
51
  };
67
52
  }
53
+ function withAlphaValue(color, alphaValue, defaultValue) {
54
+ if (typeof color === "function") {
55
+ return color({
56
+ opacityValue: alphaValue
57
+ });
58
+ }
59
+ let parsed = (0, _color).parseColor(color);
60
+ if (parsed === null) {
61
+ return defaultValue;
62
+ }
63
+ return (0, _color).formatColor({
64
+ ...parsed,
65
+ alpha: alphaValue
66
+ });
67
+ }
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,10 +1,10 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.ca1dfd6",
3
+ "version": "0.0.0-insiders.cab1fce",
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
- "style": "dist/tailwind.css",
7
+ "types": "types/index.d.ts",
8
8
  "repository": "https://github.com/tailwindlabs/tailwindcss.git",
9
9
  "bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
10
10
  "homepage": "https://tailwindcss.com",
@@ -12,24 +12,21 @@
12
12
  "tailwind": "lib/cli.js",
13
13
  "tailwindcss": "lib/cli.js"
14
14
  },
15
- "contributors": [
16
- "Adam Wathan <adam.wathan@gmail.com>",
17
- "Jonathan Reinink <jonathan@reinink.ca>",
18
- "David Hemphill <davidlee.hemphill@gmail.com>"
19
- ],
20
15
  "scripts": {
21
- "preswcify": "npm run generate:plugin-list && rimraf lib",
16
+ "preswcify": "npm run generate && rimraf lib",
22
17
  "swcify": "swc src --out-dir lib --copy-files",
23
18
  "postswcify": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js",
24
19
  "rebuild-fixtures": "npm run swcify && node -r @swc/register scripts/rebuildFixtures.js",
25
20
  "prepublishOnly": "npm install --force && npm run swcify",
26
21
  "style": "eslint .",
27
- "pretest": "npm run generate:plugin-list",
28
- "test": "cross-env TAILWIND_MODE=build jest",
22
+ "pretest": "npm run generate",
23
+ "test": "jest",
29
24
  "test:integrations": "npm run test --prefix ./integrations",
30
25
  "install:integrations": "node scripts/install-integrations.js",
31
26
  "posttest": "npm run style",
32
- "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js"
27
+ "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
28
+ "generate:types": "node -r @swc/register scripts/generate-types.js",
29
+ "generate": "npm run generate:plugin-list && npm run generate:types"
33
30
  },
34
31
  "files": [
35
32
  "src/*",
@@ -39,54 +36,55 @@
39
36
  "scripts/*.js",
40
37
  "stubs/*.stub.js",
41
38
  "nesting/*",
39
+ "types/**/*",
40
+ "*.d.ts",
42
41
  "*.css",
43
42
  "*.js"
44
43
  ],
45
44
  "devDependencies": {
46
- "@swc/cli": "^0.1.50",
47
- "@swc/core": "^1.2.90",
48
- "@swc/jest": "^0.1.5",
49
- "@swc/register": "^0.1.7",
50
- "autoprefixer": "^10.3.3",
51
- "cross-env": "^7.0.3",
52
- "cssnano": "^5.0.8",
53
- "esbuild": "^0.13.2",
54
- "eslint": "^7.32.0",
55
- "eslint-config-prettier": "^8.3.0",
45
+ "@swc/cli": "^0.1.57",
46
+ "@swc/core": "^1.2.160",
47
+ "@swc/jest": "^0.2.21",
48
+ "@swc/register": "^0.1.10",
49
+ "autoprefixer": "^10.4.7",
50
+ "cssnano": "^5.1.9",
51
+ "esbuild": "^0.14.39",
52
+ "eslint": "^8.15.0",
53
+ "eslint-config-prettier": "^8.5.0",
56
54
  "eslint-plugin-prettier": "^4.0.0",
57
- "jest": "^27.1.0",
58
- "jest-diff": "^27.2.0",
59
- "postcss": "^8.3.8",
60
- "postcss-cli": "^8.3.1",
61
- "prettier": "^2.4.1",
62
- "rimraf": "^3.0.0"
55
+ "jest": "^28.1.0",
56
+ "jest-diff": "^28.1.0",
57
+ "prettier": "^2.6.2",
58
+ "prettier-plugin-tailwindcss": "^0.1.11",
59
+ "rimraf": "^3.0.0",
60
+ "source-map-js": "^1.0.2"
63
61
  },
64
62
  "peerDependencies": {
65
- "autoprefixer": "^10.0.2",
66
63
  "postcss": "^8.0.9"
67
64
  },
68
65
  "dependencies": {
69
66
  "arg": "^5.0.1",
70
- "chalk": "^4.1.2",
71
- "chokidar": "^3.5.2",
67
+ "chokidar": "^3.5.3",
72
68
  "color-name": "^1.1.4",
73
- "cosmiconfig": "^7.0.1",
74
69
  "detective": "^5.2.0",
75
70
  "didyoumean": "^1.2.2",
76
71
  "dlv": "^1.1.3",
77
- "fast-glob": "^3.2.7",
78
- "glob-parent": "^6.0.1",
79
- "is-glob": "^4.0.1",
72
+ "fast-glob": "^3.2.11",
73
+ "glob-parent": "^6.0.2",
74
+ "is-glob": "^4.0.3",
75
+ "lilconfig": "^2.0.5",
80
76
  "normalize-path": "^3.0.0",
81
- "object-hash": "^2.2.0",
82
- "postcss-js": "^3.0.3",
83
- "postcss-load-config": "^3.1.0",
77
+ "object-hash": "^3.0.0",
78
+ "picocolors": "^1.0.0",
79
+ "postcss": "^8.0.9",
80
+ "postcss-import": "^14.1.0",
81
+ "postcss-js": "^4.0.0",
82
+ "postcss-load-config": "^3.1.4",
84
83
  "postcss-nested": "5.0.6",
85
- "postcss-selector-parser": "^6.0.6",
86
- "postcss-value-parser": "^4.1.0",
84
+ "postcss-selector-parser": "^6.0.10",
85
+ "postcss-value-parser": "^4.2.0",
87
86
  "quick-lru": "^5.1.1",
88
- "resolve": "^1.20.0",
89
- "tmp": "^0.2.1"
87
+ "resolve": "^1.22.0"
90
88
  },
91
89
  "browserslist": [
92
90
  "> 1%",
@@ -101,7 +99,8 @@
101
99
  ],
102
100
  "testPathIgnorePatterns": [
103
101
  "/node_modules/",
104
- "/integrations/"
102
+ "/integrations/",
103
+ "/standalone-cli/"
105
104
  ],
106
105
  "transform": {
107
106
  "\\.js$": "@swc/jest"