@weapp-tailwindcss/postcss 3.2.0 → 3.2.1

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 (3) hide show
  1. package/dist/index.cjs +3994 -2272
  2. package/dist/index.js +18 -0
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -882,6 +882,7 @@ function consumeUniAppXSystemRootTheme(root, customPropertyValues) {
882
882
  const ALLOWED_DISPLAY_VALUES = /* @__PURE__ */ new Set(["flex", "none"]);
883
883
  const FALLBACK_CLASS_RE = /\.((?:\\.|[\w-])+)/g;
884
884
  const IMPORTANT_SUFFIX_RE = /\s*!important$/i;
885
+ const TRANSFORM_PROPERTIES = /* @__PURE__ */ new Set(["transform", "-webkit-transform"]);
885
886
  function isUniAppXUvueTarget(options) {
886
887
  return Boolean(options?.uniAppX) && options?.uniAppXCssTarget === "uvue";
887
888
  }
@@ -891,6 +892,22 @@ function normalizeUnsupportedMode(mode) {
891
892
  function normalizeValue(value) {
892
893
  return value.trim().toLowerCase().replace(IMPORTANT_SUFFIX_RE, "");
893
894
  }
895
+ function normalizeUniAppXTransformValue(value) {
896
+ if (!value.toLowerCase().includes("translate(") || !value.includes(",")) return value;
897
+ const parsed = valueParser(value);
898
+ let changed = false;
899
+ parsed.walk((node) => {
900
+ if (node.type !== "function" || node.value.toLowerCase() !== "translate") return;
901
+ for (const child of node.nodes) {
902
+ if (child.type !== "div" || child.value !== ",") continue;
903
+ child.value = " ";
904
+ child.before = "";
905
+ child.after = "";
906
+ changed = true;
907
+ }
908
+ });
909
+ return changed ? parsed.toString() : value;
910
+ }
894
911
  function getSourceFile(rule, result) {
895
912
  return rule.source?.input.from ?? result.opts.from ?? "unknown source";
896
913
  }
@@ -943,6 +960,7 @@ function applyUniAppXUvueCompatibility(result, options) {
943
960
  if (root.type === "root" && Array.isArray(root.nodes) && typeof root.walkDecls === "function") {
944
961
  root.walkDecls((decl) => {
945
962
  normalizeTailwindcssV4Declaration(decl);
963
+ if (TRANSFORM_PROPERTIES.has(decl.prop.toLowerCase())) decl.value = normalizeUniAppXTransformValue(decl.value);
946
964
  });
947
965
  const calcResult = postcss$1([postcssCalc()]).process(root, result.opts).sync();
948
966
  root = calcResult.root;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
3
  "type": "module",
4
- "version": "3.2.0",
4
+ "version": "3.2.1",
5
5
  "description": "@weapp-tailwindcss/postcss",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "node": "^20.19.0 || >=22.12.0"
66
66
  },
67
67
  "dependencies": {
68
- "@csstools/css-color-parser": "^4.1.9",
68
+ "@csstools/css-color-parser": "^4.1.10",
69
69
  "@csstools/css-parser-algorithms": "^4.0.0",
70
70
  "@csstools/css-tokenizer": "^4.0.0",
71
71
  "@tailwindcss-mangle/engine": "0.2.0",
@@ -74,7 +74,7 @@
74
74
  "es-toolkit": "^1.49.0",
75
75
  "lru-cache": "11.5.2",
76
76
  "micromatch": "^4.0.8",
77
- "postcss": "^8.5.21",
77
+ "postcss": "^8.5.22",
78
78
  "postcss-load-config": "^6.0.1",
79
79
  "postcss-preset-env": "^11.3.2",
80
80
  "postcss-pxtrans": "^1.0.4",