tailwindcss 0.0.0-insiders.eeec89a → 0.0.0-insiders.eef91c9

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 (97) hide show
  1. package/README.md +1 -2
  2. package/lib/cli/build/deps.js +62 -0
  3. package/lib/cli/build/index.js +0 -3
  4. package/lib/cli/build/plugin.js +66 -126
  5. package/lib/cli/build/watching.js +2 -2
  6. package/lib/cli/help/index.js +2 -2
  7. package/lib/cli/index.js +3 -4
  8. package/lib/cli-peer-dependencies.js +36 -0
  9. package/lib/corePluginList.js +4 -1
  10. package/lib/corePlugins.js +318 -185
  11. package/lib/css/preflight.css +20 -9
  12. package/lib/featureFlags.js +9 -15
  13. package/lib/lib/content.js +2 -28
  14. package/lib/lib/defaultExtractor.js +33 -25
  15. package/lib/lib/evaluateTailwindFunctions.js +4 -4
  16. package/lib/lib/expandApplyAtRules.js +19 -0
  17. package/lib/lib/expandTailwindAtRules.js +22 -58
  18. package/lib/lib/generateRules.js +47 -27
  19. package/lib/lib/load-config.js +18 -3
  20. package/lib/lib/normalizeTailwindDirectives.js +15 -0
  21. package/lib/lib/offsets.js +53 -4
  22. package/lib/lib/resolveDefaultsAtRules.js +4 -2
  23. package/lib/lib/setupContextUtils.js +108 -80
  24. package/lib/lib/setupTrackingContext.js +2 -3
  25. package/lib/lib/substituteScreenAtRules.js +2 -2
  26. package/lib/plugin.js +0 -116
  27. package/lib/postcss-plugins/nesting/index.js +1 -1
  28. package/lib/postcss-plugins/nesting/plugin.js +2 -2
  29. package/lib/processTailwindFeatures.js +1 -3
  30. package/lib/public/colors.js +1 -1
  31. package/lib/util/cloneNodes.js +33 -13
  32. package/lib/util/color.js +4 -4
  33. package/lib/util/createUtilityPlugin.js +2 -2
  34. package/lib/util/dataTypes.js +69 -6
  35. package/lib/util/defaults.js +4 -4
  36. package/lib/util/escapeClassName.js +2 -2
  37. package/lib/util/formatVariantSelector.js +12 -7
  38. package/lib/util/getAllConfigs.js +2 -3
  39. package/lib/util/isPlainObject.js +1 -1
  40. package/lib/util/log.js +0 -17
  41. package/lib/util/normalizeConfig.js +28 -59
  42. package/lib/util/normalizeScreens.js +3 -3
  43. package/lib/util/pluginUtils.js +22 -7
  44. package/lib/util/pseudoElements.js +3 -0
  45. package/lib/util/resolveConfig.js +6 -10
  46. package/lib/util/validateConfig.js +0 -11
  47. package/lib/util/withAlphaVariable.js +1 -1
  48. package/nesting/index.d.ts +4 -0
  49. package/package.json +39 -34
  50. package/peers/index.js +96671 -0
  51. package/resolveConfig.d.ts +22 -3
  52. package/scripts/generate-types.js +1 -2
  53. package/src/cli/build/deps.js +56 -0
  54. package/src/cli/build/index.js +0 -4
  55. package/src/cli/build/plugin.js +53 -85
  56. package/src/cli/build/watching.js +1 -1
  57. package/src/cli/index.js +0 -1
  58. package/src/cli-peer-dependencies.js +15 -0
  59. package/src/corePluginList.js +1 -1
  60. package/src/corePlugins.js +157 -44
  61. package/src/css/preflight.css +20 -9
  62. package/src/featureFlags.js +3 -9
  63. package/src/lib/content.js +1 -33
  64. package/src/lib/defaultExtractor.js +30 -17
  65. package/src/lib/expandApplyAtRules.js +24 -0
  66. package/src/lib/expandTailwindAtRules.js +19 -56
  67. package/src/lib/generateRules.js +43 -22
  68. package/src/lib/load-config.ts +13 -0
  69. package/src/lib/normalizeTailwindDirectives.js +27 -0
  70. package/src/lib/offsets.js +62 -3
  71. package/src/lib/resolveDefaultsAtRules.js +5 -1
  72. package/src/lib/setupContextUtils.js +79 -39
  73. package/src/plugin.js +0 -86
  74. package/src/processTailwindFeatures.js +0 -3
  75. package/src/util/cloneNodes.js +35 -14
  76. package/src/util/color.js +1 -1
  77. package/src/util/dataTypes.js +78 -6
  78. package/src/util/formatVariantSelector.js +7 -0
  79. package/src/util/isPlainObject.js +1 -1
  80. package/src/util/log.js +0 -24
  81. package/src/util/normalizeConfig.js +11 -38
  82. package/src/util/pluginUtils.js +21 -1
  83. package/src/util/pseudoElements.js +4 -0
  84. package/src/util/validateConfig.js +0 -10
  85. package/stubs/config.full.js +75 -16
  86. package/stubs/config.simple.js +1 -1
  87. package/stubs/postcss.config.cjs +1 -0
  88. package/stubs/postcss.config.js +1 -0
  89. package/types/config.d.ts +12 -5
  90. package/types/generated/corePluginList.d.ts +1 -1
  91. package/types/generated/default-theme.d.ts +34 -9
  92. package/types/index.d.ts +7 -3
  93. package/index.css +0 -5
  94. package/lib/lib/detectNesting.js +0 -45
  95. package/lib/lib/handleImportAtRules.js +0 -50
  96. package/src/lib/detectNesting.js +0 -47
  97. package/src/lib/handleImportAtRules.js +0 -34
@@ -39,6 +39,7 @@ const _withAlphaVariable = require("./withAlphaVariable");
39
39
  const _dataTypes = require("./dataTypes");
40
40
  const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
41
41
  const _validateFormalSyntax = require("./validateFormalSyntax");
42
+ const _featureFlags = require("../featureFlags.js");
42
43
  function _interop_require_default(obj) {
43
44
  return obj && obj.__esModule ? obj : {
44
45
  default: obj
@@ -75,7 +76,7 @@ function asNegativeValue(modifier, lookup = {}, validate) {
75
76
  return (0, _negateValue.default)(resolved);
76
77
  }
77
78
  }
78
- function asValue(modifier, options = {}, { validate = ()=>true } = {}) {
79
+ function asValue(modifier, options = {}, { validate =()=>true } = {}) {
79
80
  var _options_values;
80
81
  let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
81
82
  if (value !== undefined) {
@@ -91,6 +92,19 @@ function isArbitraryValue(input) {
91
92
  }
92
93
  function splitUtilityModifier(modifier) {
93
94
  let slashIdx = modifier.lastIndexOf("/");
95
+ // If the `/` is inside an arbitrary, we want to find the previous one if any
96
+ // This logic probably isn't perfect but it should work for most cases
97
+ let arbitraryStartIdx = modifier.lastIndexOf("[", slashIdx);
98
+ let arbitraryEndIdx = modifier.indexOf("]", slashIdx);
99
+ let isNextToArbitrary = modifier[slashIdx - 1] === "]" || modifier[slashIdx + 1] === "[";
100
+ // Backtrack to the previous `/` if the one we found was inside an arbitrary
101
+ if (!isNextToArbitrary) {
102
+ if (arbitraryStartIdx !== -1 && arbitraryEndIdx !== -1) {
103
+ if (arbitraryStartIdx < slashIdx && slashIdx < arbitraryEndIdx) {
104
+ slashIdx = modifier.lastIndexOf("/", arbitraryStartIdx);
105
+ }
106
+ }
107
+ }
94
108
  if (slashIdx === -1 || slashIdx === modifier.length - 1) {
95
109
  return [
96
110
  modifier,
@@ -115,14 +129,14 @@ function splitUtilityModifier(modifier) {
115
129
  function parseColorFormat(value) {
116
130
  if (typeof value === "string" && value.includes("<alpha-value>")) {
117
131
  let oldValue = value;
118
- return ({ opacityValue = 1 })=>oldValue.replace("<alpha-value>", opacityValue);
132
+ return ({ opacityValue =1 })=>oldValue.replace(/<alpha-value>/g, opacityValue);
119
133
  }
120
134
  return value;
121
135
  }
122
136
  function unwrapArbitraryModifier(modifier) {
123
137
  return (0, _dataTypes.normalize)(modifier.slice(1, -1));
124
138
  }
125
- function asColor(modifier, options = {}, { tailwindConfig = {} } = {}) {
139
+ function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
126
140
  var _options_values;
127
141
  if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
128
142
  var _options_values1;
@@ -132,7 +146,7 @@ function asColor(modifier, options = {}, { tailwindConfig = {} } = {}) {
132
146
  // We do this here because we need the alpha value (if any)
133
147
  let [color, alpha] = splitUtilityModifier(modifier);
134
148
  if (alpha !== undefined) {
135
- var _options_values2, _tailwindConfig_theme_opacity, _tailwindConfig_theme;
149
+ var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
136
150
  var _options_values_color;
137
151
  let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
138
152
  if (normalizedColor === undefined) {
@@ -194,7 +208,7 @@ function splitAtFirst(input, delim) {
194
208
  }
195
209
  function coerceValue(types, modifier, options, tailwindConfig) {
196
210
  if (options.values && modifier in options.values) {
197
- for (let { type } of types !== null && types !== void 0 ? types : []){
211
+ for (let { type } of types !== null && types !== void 0 ? types : []){
198
212
  let result = typeMap[type](modifier, options, {
199
213
  tailwindConfig
200
214
  });
@@ -235,8 +249,9 @@ function coerceValue(types, modifier, options, tailwindConfig) {
235
249
  return [];
236
250
  }
237
251
  function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
252
+ let modifiersEnabled = (0, _featureFlags.flagEnabled)(tailwindConfig, "generalizedModifiers");
238
253
  let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
239
- let canUseUtilityModifier = options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
254
+ let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
240
255
  if (!canUseUtilityModifier) {
241
256
  modifier = rawModifier;
242
257
  utilityModifier = undefined;
@@ -258,7 +273,7 @@ function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
258
273
  }
259
274
  }
260
275
  }
261
- for (let { type } of types !== null && types !== void 0 ? types : []){
276
+ for (let { type } of types !== null && types !== void 0 ? types : []){
262
277
  let result = typeMap[type](modifier, options, {
263
278
  tailwindConfig
264
279
  });
@@ -114,6 +114,9 @@ let elementProperties = {
114
114
  "terminal",
115
115
  "jumpable"
116
116
  ],
117
+ ":where": [],
118
+ ":is": [],
119
+ ":has": [],
117
120
  // The default value is used when the pseudo-element is not recognized
118
121
  // Because it's not recognized, we don't know if it's terminal or not
119
122
  // So we assume it can be moved AND can have user-action pseudo classes attached to it
@@ -69,7 +69,7 @@ function value(valueToResolve, ...args) {
69
69
  return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
70
70
  }
71
71
  function collectExtends(items) {
72
- return items.reduce((merged, { extend })=>{
72
+ return items.reduce((merged, { extend })=>{
73
73
  return mergeWith(merged, extend, (mergedValue, extendValue)=>{
74
74
  if (mergedValue === undefined) {
75
75
  return [
@@ -116,7 +116,7 @@ function mergeExtensionCustomizer(merged, value) {
116
116
  // Execute default behaviour
117
117
  return undefined;
118
118
  }
119
- function mergeExtensions({ extend, ...theme }) {
119
+ function mergeExtensions({ extend , ...theme }) {
120
120
  return mergeWith(theme, extend, (themeValue, extensions)=>{
121
121
  // The `extend` property is an array, so we need to check if it contains any functions
122
122
  if (!isFunction(themeValue) && !extensions.some(isFunction)) {
@@ -186,18 +186,16 @@ function resolveFunctionKeys(object) {
186
186
  function extractPluginConfigs(configs) {
187
187
  let allConfigs = [];
188
188
  configs.forEach((config)=>{
189
- var _config;
190
189
  allConfigs = [
191
190
  ...allConfigs,
192
191
  config
193
192
  ];
194
193
  var _config_plugins;
195
- const plugins = (_config_plugins = (_config = config) === null || _config === void 0 ? void 0 : _config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
194
+ const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
196
195
  if (plugins.length === 0) {
197
196
  return;
198
197
  }
199
198
  plugins.forEach((plugin)=>{
200
- var _plugin;
201
199
  if (plugin.__isOptionsFunction) {
202
200
  plugin = plugin();
203
201
  }
@@ -205,7 +203,7 @@ function extractPluginConfigs(configs) {
205
203
  allConfigs = [
206
204
  ...allConfigs,
207
205
  ...extractPluginConfigs([
208
- (_plugin_config = (_plugin = plugin) === null || _plugin === void 0 ? void 0 : _plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
206
+ (_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
209
207
  ])
210
208
  ];
211
209
  });
@@ -248,13 +246,11 @@ function resolveConfig(configs) {
248
246
  var _t_theme, _c_plugins;
249
247
  return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
250
248
  theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
251
- var _t;
252
- return (_t_theme = (_t = t) === null || _t === void 0 ? void 0 : _t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
249
+ return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
253
250
  })))),
254
251
  corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
255
252
  plugins: resolvePluginLists(configs.map((c)=>{
256
- var _c;
257
- return (_c_plugins = (_c = c) === null || _c === void 0 ? void 0 : _c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
253
+ return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
258
254
  }))
259
255
  }, ...allConfigs));
260
256
  }
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "validateConfig", {
8
8
  return validateConfig;
9
9
  }
10
10
  });
11
- const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors"));
12
11
  const _log = /*#__PURE__*/ _interop_require_default(require("./log"));
13
12
  function _interop_require_default(obj) {
14
13
  return obj && obj.__esModule ? obj : {
@@ -23,16 +22,6 @@ function validateConfig(config) {
23
22
  "https://tailwindcss.com/docs/content-configuration"
24
23
  ]);
25
24
  }
26
- if (config.content.files.includes("auto")) {
27
- _log.default.group("auto-content-experimental", (log)=>{
28
- log.info([
29
- _picocolors.default.bold("Automatically detecting Tailwind CSS content sources...")
30
- ]);
31
- log.warn([
32
- "Automatic content detection is experimental, and the behavior may change at any time."
33
- ]);
34
- });
35
- }
36
25
  // Warn if the line-clamp plugin is installed
37
26
  try {
38
27
  let plugin = require("@tailwindcss/line-clamp");
@@ -34,7 +34,7 @@ function withAlphaValue(color, alphaValue, defaultValue) {
34
34
  alpha: alphaValue
35
35
  });
36
36
  }
37
- function withAlphaVariable({ color, property, variable }) {
37
+ function withAlphaVariable({ color , property , variable }) {
38
38
  let properties = [].concat(property);
39
39
  if (typeof color === "function") {
40
40
  return {
@@ -0,0 +1,4 @@
1
+ import type { AcceptedPlugin, PluginCreator } from 'postcss'
2
+
3
+ declare const plugin: PluginCreator<AcceptedPlugin | string | void>
4
+ export = plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.eeec89a",
3
+ "version": "0.0.0-insiders.eef91c9",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -12,28 +12,28 @@
12
12
  "tailwind": "lib/cli.js",
13
13
  "tailwindcss": "lib/cli.js"
14
14
  },
15
- "workspaces": [
16
- "integrations/*",
17
- "oxide/crates/node"
18
- ],
19
15
  "scripts": {
20
- "dev": "concurrently -n tailwind,oxide-node -c green,yellow 'npm run dev:js' 'npm run dev:rust'",
21
- "build": "npm run build:rust && npm run build:js",
22
- "test": "jest",
23
- "test:integrations": "npm run test -w ./integrations",
16
+ "prebuild": "npm run generate && rimraf lib",
17
+ "build": "swc src --out-dir lib --copy-files",
18
+ "postbuild": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js --define:process.env.CSS_TRANSFORMER_WASM=false",
19
+ "rebuild-fixtures": "npm run build && node -r @swc/register scripts/rebuildFixtures.js",
24
20
  "style": "eslint .",
25
- "prepublishOnly": "npm install --force && npm run build && npm run generate:types",
26
- "dev:rust": "npm run --prefix ./oxide dev:node",
27
- "dev:js": "npm run build:js -- --watch",
28
- "build:rust": "npm run --prefix ./oxide build:node",
29
- "build:js": "npm run generate:plugin-list && swc src --out-dir lib --copy-files --delete-dir-on-start",
21
+ "pretest": "npm run generate",
22
+ "test": "jest",
23
+ "test:integrations": "npm run test --prefix ./integrations",
24
+ "install:integrations": "node scripts/install-integrations.js",
30
25
  "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
31
- "generate:types": "node -r @swc/register scripts/generate-types.js"
26
+ "generate:types": "node -r @swc/register scripts/generate-types.js",
27
+ "generate": "npm run generate:plugin-list && npm run generate:types",
28
+ "release-channel": "node ./scripts/release-channel.js",
29
+ "release-notes": "node ./scripts/release-notes.js",
30
+ "prepublishOnly": "npm install --force && npm run build"
32
31
  },
33
32
  "files": [
34
33
  "src/*",
35
34
  "cli/*",
36
35
  "lib/*",
36
+ "peers/*",
37
37
  "scripts/*.js",
38
38
  "stubs/*",
39
39
  "nesting/*",
@@ -44,55 +44,57 @@
44
44
  ],
45
45
  "devDependencies": {
46
46
  "@swc/cli": "^0.1.62",
47
- "@swc/core": "^1.3.68",
47
+ "@swc/core": "^1.3.55",
48
48
  "@swc/jest": "^0.2.26",
49
49
  "@swc/register": "^0.1.10",
50
+ "autoprefixer": "^10.4.14",
51
+ "browserslist": "^4.21.5",
50
52
  "concurrently": "^8.0.1",
51
- "eslint": "^8.45.0",
53
+ "cssnano": "^6.0.0",
54
+ "esbuild": "^0.20.2",
55
+ "eslint": "^8.39.0",
52
56
  "eslint-config-prettier": "^8.8.0",
53
57
  "eslint-plugin-prettier": "^4.2.1",
54
- "jest": "^29.6.1",
55
- "jest-diff": "^29.6.1",
58
+ "jest": "^29.6.0",
59
+ "jest-diff": "^29.6.0",
60
+ "lightningcss": "1.24.1",
56
61
  "prettier": "^2.8.8",
57
62
  "rimraf": "^5.0.0",
58
63
  "source-map-js": "^1.0.2",
59
- "turbo": "^1.10.12"
64
+ "turbo": "^1.9.3"
60
65
  },
61
66
  "dependencies": {
62
67
  "@alloc/quick-lru": "^5.2.0",
63
- "@tailwindcss/oxide": "0.0.0-insiders.eeec89a",
64
68
  "arg": "^5.0.2",
65
- "browserslist": "^4.21.9",
66
69
  "chokidar": "^3.5.3",
67
70
  "didyoumean": "^1.2.2",
68
71
  "dlv": "^1.1.3",
69
- "fast-glob": "^3.3.1",
72
+ "fast-glob": "^3.3.0",
70
73
  "glob-parent": "^6.0.2",
71
74
  "is-glob": "^4.0.3",
72
- "jiti": "^1.19.1",
73
- "lightningcss": "^1.21.5",
75
+ "jiti": "^1.21.0",
74
76
  "lilconfig": "^2.1.0",
75
77
  "micromatch": "^4.0.5",
76
78
  "normalize-path": "^3.0.0",
77
79
  "object-hash": "^3.0.0",
78
80
  "picocolors": "^1.0.0",
79
- "postcss": "^8.4.25",
81
+ "postcss": "^8.4.23",
80
82
  "postcss-import": "^15.1.0",
81
83
  "postcss-js": "^4.0.1",
82
84
  "postcss-load-config": "^4.0.1",
83
85
  "postcss-nested": "^6.0.1",
84
- "postcss-selector-parser": "^6.0.12",
85
- "postcss-value-parser": "^4.2.0",
86
- "resolve": "^1.22.3",
87
- "sucrase": "^3.34.0"
86
+ "postcss-selector-parser": "^6.0.11",
87
+ "resolve": "^1.22.2",
88
+ "sucrase": "^3.32.0"
88
89
  },
89
90
  "browserslist": [
90
- "defaults and supports css-variables and supports css-matches-pseudo",
91
- "safari >= 14"
91
+ "> 1%",
92
+ "not edge <= 18",
93
+ "not ie 11",
94
+ "not op_mini all"
92
95
  ],
93
96
  "jest": {
94
97
  "testTimeout": 30000,
95
- "globalSetup": "<rootDir>/jest/global-setup.js",
96
98
  "setupFilesAfterEnv": [
97
99
  "<rootDir>/jest/customMatchers.js"
98
100
  ],
@@ -102,12 +104,15 @@
102
104
  "/standalone-cli/",
103
105
  "\\.test\\.skip\\.js$"
104
106
  ],
107
+ "transformIgnorePatterns": [
108
+ "node_modules/(?!lightningcss)"
109
+ ],
105
110
  "transform": {
106
111
  "\\.js$": "@swc/jest",
107
112
  "\\.ts$": "@swc/jest"
108
113
  }
109
114
  },
110
115
  "engines": {
111
- "node": ">=16.0.0"
116
+ "node": ">=14.0.0"
112
117
  }
113
118
  }