tailwindcss 0.0.0-insiders.a9c7e52 → 0.0.0-insiders.aad299c

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 CHANGED
@@ -7,8 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+
10
12
  - Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604))
11
13
  - Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587))
14
+ - Ignore PostCSS nodes returned by `addVariant` ([#8608](https://github.com/tailwindlabs/tailwindcss/pull/8608))
15
+ - Fix missing spaces around arithmetic operators ([#8615](https://github.com/tailwindlabs/tailwindcss/pull/8615))
12
16
 
13
17
  ## [3.1.2] - 2022-06-10
14
18
 
@@ -478,10 +478,11 @@ function buildPluginApi(tailwindConfig, context, { variantList , variantMap , of
478
478
  throw new Error(`Your custom variant \`${variantName}\` has an invalid format string. Make sure it's an at-rule or contains a \`&\` placeholder.`);
479
479
  }
480
480
  if (Array.isArray(result)) {
481
- return result.map((variant)=>parseVariant(variant));
481
+ return result.filter((variant)=>typeof variant === "string").map((variant)=>parseVariant(variant));
482
482
  }
483
483
  // result may be undefined with legacy variants that use APIs like `modifySelectors`
484
- return result && parseVariant(result)(api);
484
+ // result may also be a postcss node if someone was returning the result from `modifySelectors`
485
+ return result && typeof result === "string" && parseVariant(result)(api);
485
486
  };
486
487
  }
487
488
  if (!isValidVariantFormatString(variantFunction)) {
@@ -46,9 +46,9 @@ function normalize(value, isRoot = true) {
46
46
  if (isRoot) {
47
47
  value = value.trim();
48
48
  }
49
- // Add spaces around operators inside calc() that do not follow an operator
49
+ // Add spaces around operators inside math functions like calc() that do not follow an operator
50
50
  // or '('.
51
- value = value.replace(/calc\(.+\)/g, (match)=>{
51
+ value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
52
52
  return match.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
53
53
  });
54
54
  // Add spaces around some operators not inside calc() that do not follow an operator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.a9c7e52",
3
+ "version": "0.0.0-insiders.aad299c",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -63,7 +63,7 @@
63
63
  "postcss": "^8.0.9"
64
64
  },
65
65
  "dependencies": {
66
- "arg": "^5.0.1",
66
+ "arg": "^5.0.2",
67
67
  "chokidar": "^3.5.3",
68
68
  "color-name": "^1.1.4",
69
69
  "detective": "^5.2.1",
@@ -465,11 +465,14 @@ function buildPluginApi(tailwindConfig, context, { variantList, variantMap, offs
465
465
  }
466
466
 
467
467
  if (Array.isArray(result)) {
468
- return result.map((variant) => parseVariant(variant))
468
+ return result
469
+ .filter((variant) => typeof variant === 'string')
470
+ .map((variant) => parseVariant(variant))
469
471
  }
470
472
 
471
473
  // result may be undefined with legacy variants that use APIs like `modifySelectors`
472
- return result && parseVariant(result)(api)
474
+ // result may also be a postcss node if someone was returning the result from `modifySelectors`
475
+ return result && typeof result === 'string' && parseVariant(result)(api)
473
476
  }
474
477
  }
475
478
 
@@ -40,9 +40,9 @@ export function normalize(value, isRoot = true) {
40
40
  value = value.trim()
41
41
  }
42
42
 
43
- // Add spaces around operators inside calc() that do not follow an operator
43
+ // Add spaces around operators inside math functions like calc() that do not follow an operator
44
44
  // or '('.
45
- value = value.replace(/calc\(.+\)/g, (match) => {
45
+ value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => {
46
46
  return match.replace(
47
47
  /(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,
48
48
  '$1 $2 '