@weapp-tailwindcss/postcss 1.0.21 → 1.1.0-alpha.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.
package/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
  > [!NOTE]
24
24
  > 降低开发维护成本,提升开发效率的 `小程序` `tailwindcss` 全方面解决方案
25
25
  >
26
- > 小程序原生工具链 `weapp-vite` 已经发布,使用它改善你的原生小程序开发体验吧,更多详见 [官方文档](https://vite.icebreaker.top/)
26
+ > `weapp-tailwindcss@4.2.x` 现已支持 `uni-app x` 同时构建 `Web`,`小程序`,`安卓`,`IOS`,`鸿蒙`,详见 [**uni-app x 专题**](https://tw.icebreaker.top/docs/uni-app-x)
27
27
 
28
28
  \[[文档地址](https://tw.icebreaker.top)\] \| \[[备用文档地址](https://ice-tw.netlify.app/)\] \| \[[加入技术交流群](https://tw.icebreaker.top/docs/community/group)\]
29
29
 
@@ -35,7 +35,6 @@
35
35
  - [各个框架的模板](#各个框架的模板)
36
36
  - [旧版本迁移指南](#旧版本迁移指南)
37
37
  - [配置项参考](#配置项参考)
38
- - [变更日志](#变更日志)
39
38
  - [Contribute](#contribute)
40
39
  - [License](#license)
41
40
  - [Star History](#star-history)
@@ -48,9 +47,9 @@
48
47
  | --------------------------------------------------- | ----------------------------------------------- |
49
48
  | ![wepback+vite+gulp](./assets/weapp-tw-plugins.png) | ![frameworks](./assets/weapp-tw-frameworks.png) |
50
49
 
51
- 核心插件支持 `webpack`/`vite`/`gulp` 为基底的框架类小程序开发,涵盖了市面上几乎所有的主流的开发框架。
50
+ 核心插件支持 `webpack`/`vite`/`rspack`/`rollup`/`rolldown`/`gulp` 为基底的框架类小程序开发,涵盖了市面上几乎所有的主流的开发框架。
52
51
 
53
- 同时也支持最原生的开发者工具创建的原生小程序应用。
52
+ 也支持直接从各个开发者工具中,直接创建的原生小程序应用。
54
53
 
55
54
  这些插件能够自动识别并精确处理所有 `tailwindcss` 的工具类来适配小程序环境。
56
55
 
@@ -75,8 +74,6 @@
75
74
 
76
75
  ## [配置项参考](https://tw.icebreaker.top/docs/api/interfaces/UserDefinedOptions)
77
76
 
78
- ## [变更日志](./CHANGELOG.md)
79
-
80
77
  ## Contribute
81
78
 
82
79
  我们邀请你来贡献和帮助改进 `weapp-tailwindcss` 💚💚💚
@@ -38,10 +38,16 @@ var postcssHtmlTransform = (opts = {}) => {
38
38
  return {
39
39
  postcssPlugin: "postcss-html-transform",
40
40
  Rule(rule) {
41
- _optionalChain([walkRules, 'optionalCall', _ => _(rule)]);
41
+ if (typeof walkRules === "function") {
42
+ if (selectorFilter && selectorFilter.test(rule.selector)) {
43
+ walkRules(rule);
44
+ } else {
45
+ walkRules(rule);
46
+ }
47
+ }
42
48
  },
43
49
  Declaration(decl) {
44
- if (_optionalChain([options, 'optionalAccess', _2 => _2.removeCursorStyle])) {
50
+ if (_optionalChain([options, 'optionalAccess', _ => _.removeCursorStyle])) {
45
51
  if (decl.prop === "cursor") {
46
52
  decl.remove();
47
53
  }
@@ -38,7 +38,13 @@ var postcssHtmlTransform = (opts = {}) => {
38
38
  return {
39
39
  postcssPlugin: "postcss-html-transform",
40
40
  Rule(rule) {
41
- walkRules?.(rule);
41
+ if (typeof walkRules === "function") {
42
+ if (selectorFilter && selectorFilter.test(rule.selector)) {
43
+ walkRules(rule);
44
+ } else {
45
+ walkRules(rule);
46
+ }
47
+ }
42
48
  },
43
49
  Declaration(decl) {
44
50
  if (options?.removeCursorStyle) {
package/dist/index.js CHANGED
@@ -59,6 +59,7 @@ function createContext() {
59
59
  var postcssPlugin = "postcss-weapp-tailwindcss-rename-plugin";
60
60
 
61
61
  // src/selectorParser.ts
62
+
62
63
  var _postcssselectorparser = require('postcss-selector-parser'); var _postcssselectorparser2 = _interopRequireDefault(_postcssselectorparser);
63
64
 
64
65
  // src/shared.ts
@@ -190,9 +191,6 @@ function createRuleTransform(rule, options) {
190
191
  }
191
192
  }
192
193
  }
193
- if (uniAppX) {
194
- selector.remove();
195
- }
196
194
  } else if (selector.type === "combinator") {
197
195
  if (selector.value === ">") {
198
196
  const nodes2 = _optionalChain([selector, 'access', _5 => _5.parent, 'optionalAccess', _6 => _6.nodes]);
@@ -259,7 +257,8 @@ function isOnlyBeforeAndAfterPseudoElement(node) {
259
257
  }).astSync(node);
260
258
  return b && a;
261
259
  }
262
- function getFallbackRemove(rule) {
260
+ function getFallbackRemove(rule, options) {
261
+ const { uniAppX } = _shared.defuOverrideArray.call(void 0, options, {});
263
262
  const fallbackRemove = _postcssselectorparser2.default.call(void 0, (selectors) => {
264
263
  let maybeImportantId = false;
265
264
  selectors.walk((selector, idx) => {
@@ -307,6 +306,10 @@ function getFallbackRemove(rule) {
307
306
  if (res) {
308
307
  selector.remove();
309
308
  }
309
+ } else if (selector.type === "pseudo") {
310
+ if (uniAppX) {
311
+ selector.remove();
312
+ }
310
313
  }
311
314
  }
312
315
  });
@@ -324,34 +327,32 @@ var postcssWeappTailwindcssPostPlugin = (options) => {
324
327
  postcssPlugin
325
328
  };
326
329
  if (opts.isMainChunk) {
327
- p.OnceExit = (root) => {
328
- root.walkRules((rule) => {
329
- getFallbackRemove(rule).transformSync(rule, {
330
- updateSelector: true,
331
- lossless: false
332
- });
333
- if (rule.selectors.length === 0 || rule.selectors.length === 1 && rule.selector.trim() === "") {
334
- rule.remove();
335
- }
336
- rule.walkDecls((decl) => {
337
- if (decl.prop === "--tw-gradient-position" && decl.value.endsWith(OklabSuffix)) {
338
- decl.value = decl.value.slice(0, decl.value.length - OklabSuffix.length);
339
- } else if (/calc\(\s*infinity\s*\*\s*1px/.test(decl.value)) {
340
- decl.value = "9999px";
341
- }
342
- });
343
- if (opts.uniAppX) {
344
- if (rule.nodes.length === 0) {
345
- rule.remove();
346
- }
347
- }
330
+ p.RuleExit = (rule) => {
331
+ getFallbackRemove(rule, opts).transformSync(rule, {
332
+ updateSelector: true,
333
+ lossless: false
348
334
  });
349
- root.walkAtRules((atRule) => {
350
- if (opts.cssRemoveProperty && atRule.name === "property") {
351
- atRule.remove();
335
+ if (rule.selectors.length === 0 || rule.selectors.length === 1 && rule.selector.trim() === "") {
336
+ rule.remove();
337
+ }
338
+ if (opts.uniAppX) {
339
+ if (rule.nodes.length === 0) {
340
+ rule.remove();
352
341
  }
353
- _optionalChain([atRule, 'access', _24 => _24.nodes, 'optionalAccess', _25 => _25.length]) === 0 && atRule.remove();
354
- });
342
+ }
343
+ };
344
+ p.DeclarationExit = (decl) => {
345
+ if (decl.prop === "--tw-gradient-position" && decl.value.endsWith(OklabSuffix)) {
346
+ decl.value = decl.value.slice(0, decl.value.length - OklabSuffix.length);
347
+ } else if (/calc\(\s*infinity\s*\*\s*1px/.test(decl.value)) {
348
+ decl.value = "9999px";
349
+ }
350
+ };
351
+ p.AtRuleExit = (atRule) => {
352
+ if (opts.cssRemoveProperty && atRule.name === "property") {
353
+ atRule.remove();
354
+ }
355
+ _optionalChain([atRule, 'access', _24 => _24.nodes, 'optionalAccess', _25 => _25.length]) === 0 && atRule.remove();
355
356
  };
356
357
  }
357
358
  if (typeof opts.customRuleCallback === "function") {
@@ -944,12 +945,12 @@ function selectorSpecificity(t, s) {
944
945
  case ":nth-child":
945
946
  case ":nth-last-child":
946
947
  if (n2 += 1, t.nodes && t.nodes.length > 0) {
947
- const i2 = t.nodes[0].nodes.findIndex((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase());
948
+ const i2 = t.nodes[0].nodes.findIndex(((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase()));
948
949
  if (i2 > -1) {
949
950
  const a = _postcssselectorparser2.default.selector({ nodes: [], value: "" });
950
- t.nodes[0].nodes.slice(i2 + 1).forEach((e3) => {
951
+ t.nodes[0].nodes.slice(i2 + 1).forEach(((e3) => {
951
952
  a.append(e3.clone());
952
- });
953
+ }));
953
954
  const r = [a];
954
955
  t.nodes.length > 1 && r.push(...t.nodes.slice(1));
955
956
  const l = specificityOfMostSpecificListItem(r, s);
@@ -959,10 +960,10 @@ function selectorSpecificity(t, s) {
959
960
  break;
960
961
  case ":local":
961
962
  case ":global":
962
- t.nodes && t.nodes.length > 0 && t.nodes.forEach((e3) => {
963
+ t.nodes && t.nodes.length > 0 && t.nodes.forEach(((e3) => {
963
964
  const t2 = selectorSpecificity(e3, s);
964
965
  c += t2.a, n2 += t2.b, o2 += t2.c;
965
- });
966
+ }));
966
967
  break;
967
968
  case ":host":
968
969
  case ":host-context":
@@ -975,18 +976,18 @@ function selectorSpecificity(t, s) {
975
976
  case ":active-view-transition-type":
976
977
  return { a: 0, b: 1, c: 0 };
977
978
  }
978
- else _postcssselectorparser2.default.isContainer(t) && _optionalChain([t, 'access', _38 => _38.nodes, 'optionalAccess', _39 => _39.length]) > 0 && t.nodes.forEach((e3) => {
979
+ else _postcssselectorparser2.default.isContainer(t) && _optionalChain([t, 'access', _38 => _38.nodes, 'optionalAccess', _39 => _39.length]) > 0 && t.nodes.forEach(((e3) => {
979
980
  const t2 = selectorSpecificity(e3, s);
980
981
  c += t2.a, n2 += t2.b, o2 += t2.c;
981
- });
982
+ }));
982
983
  return { a: c, b: n2, c: o2 };
983
984
  }
984
985
  function specificityOfMostSpecificListItem(e3, t) {
985
986
  let s = { a: 0, b: 0, c: 0 };
986
- return e3.forEach((e4) => {
987
+ return e3.forEach(((e4) => {
987
988
  const i = selectorSpecificity(e4, t);
988
989
  compare(i, s) < 0 || (s = i);
989
- }), s;
990
+ })), s;
990
991
  }
991
992
  function isPseudoElement(t) {
992
993
  return _postcssselectorparser2.default.isPseudoElement(t);
@@ -994,7 +995,7 @@ function isPseudoElement(t) {
994
995
  function selectorNodeContainsNothingOrOnlyUniversal(e3) {
995
996
  if (!e3) return false;
996
997
  if (!e3.nodes) return false;
997
- const t = e3.nodes.filter((e4) => "comment" !== e4.type);
998
+ const t = e3.nodes.filter(((e4) => "comment" !== e4.type));
998
999
  return 0 === t.length || 1 === t.length && "universal" === t[0].type;
999
1000
  }
1000
1001
 
@@ -1002,17 +1003,17 @@ function selectorNodeContainsNothingOrOnlyUniversal(e3) {
1002
1003
  function alwaysValidSelector(s) {
1003
1004
  const o2 = _postcssselectorparser2.default.call(void 0, ).astSync(s);
1004
1005
  let n2 = true;
1005
- return o2.walk((e3) => {
1006
+ return o2.walk(((e3) => {
1006
1007
  if ("class" !== e3.type && "comment" !== e3.type && "id" !== e3.type && "root" !== e3.type && "selector" !== e3.type && "string" !== e3.type && "tag" !== e3.type && "universal" !== e3.type && ("attribute" !== e3.type || e3.insensitive) && ("combinator" !== e3.type || "+" !== e3.value && ">" !== e3.value && "~" !== e3.value && " " !== e3.value) && ("pseudo" !== e3.type || _optionalChain([e3, 'access', _40 => _40.nodes, 'optionalAccess', _41 => _41.length]) || ":hover" !== e3.value.toLowerCase() && ":focus" !== e3.value.toLowerCase())) {
1007
1008
  if ("pseudo" === e3.type && 1 === _optionalChain([e3, 'access', _42 => _42.nodes, 'optionalAccess', _43 => _43.length]) && ":not" === e3.value.toLowerCase()) {
1008
1009
  let s2 = true;
1009
- if (e3.nodes[0].walkCombinators(() => {
1010
+ if (e3.nodes[0].walkCombinators((() => {
1010
1011
  s2 = false;
1011
- }), s2) return;
1012
+ })), s2) return;
1012
1013
  }
1013
1014
  return n2 = false, false;
1014
1015
  }
1015
- }), n2;
1016
+ })), n2;
1016
1017
  }
1017
1018
  function sortCompoundSelectorsInsideComplexSelector(s) {
1018
1019
  if (!s || !s.nodes || 1 === s.nodes.length) return;
@@ -1023,8 +1024,8 @@ function sortCompoundSelectorsInsideComplexSelector(s) {
1023
1024
  const t = [];
1024
1025
  for (let e3 = 0; e3 < o2.length; e3++) {
1025
1026
  const s2 = o2[e3];
1026
- s2.sort((e4, s3) => "selector" === e4.type && "selector" === s3.type && e4.nodes.length && s3.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : "selector" === e4.type && e4.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3, s3.type) : "selector" === s3.type && s3.nodes.length ? selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3, s3.type));
1027
- const n3 = new Set(s2.map((e4) => e4.type)), r = n3.has("universal") && (n3.has("tag") || n3.has("attribute") || n3.has("class") || n3.has("id") || n3.has("pseudo"));
1027
+ s2.sort(((e4, s3) => "selector" === e4.type && "selector" === s3.type && e4.nodes.length && s3.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : "selector" === e4.type && e4.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3, s3.type) : "selector" === s3.type && s3.nodes.length ? selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3, s3.type)));
1028
+ const n3 = new Set(s2.map(((e4) => e4.type))), r = n3.has("universal") && (n3.has("tag") || n3.has("attribute") || n3.has("class") || n3.has("id") || n3.has("pseudo"));
1028
1029
  for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() : t.push(s2[e4]);
1029
1030
  }
1030
1031
  s.removeAll();
@@ -1075,15 +1076,15 @@ function isPseudoInFirstCompound(s) {
1075
1076
  const n2 = s.nodes[o2];
1076
1077
  if (!n2 || !_postcssselectorparser2.default.isPseudoClass(n2)) return false;
1077
1078
  const t = s.nodes.slice(0, o2), r = s.nodes.slice(o2 + 1);
1078
- return t.forEach((e3) => {
1079
+ return t.forEach(((e3) => {
1079
1080
  n2.nodes[0].append(e3.clone());
1080
- }), r.forEach((e3) => {
1081
+ })), r.forEach(((e3) => {
1081
1082
  n2.nodes[0].append(e3.clone());
1082
- }), n2.replaceWith(...n2.nodes), t.forEach((e3) => {
1083
+ })), n2.replaceWith(...n2.nodes), t.forEach(((e3) => {
1083
1084
  e3.remove();
1084
- }), r.forEach((e3) => {
1085
+ })), r.forEach(((e3) => {
1085
1086
  e3.remove();
1086
- }), true;
1087
+ })), true;
1087
1088
  }
1088
1089
  function samePrecedingElement(s) {
1089
1090
  if (!s || !s.nodes) return false;
@@ -1109,50 +1110,50 @@ function samePrecedingElement(s) {
1109
1110
  const r = s.nodes[n2];
1110
1111
  if (!r || !_postcssselectorparser2.default.isPseudoClass(r)) return false;
1111
1112
  const d = s.nodes.slice(0, o2), l = s.nodes.slice(n2 + 1);
1112
- return s.each((e3) => {
1113
+ return s.each(((e3) => {
1113
1114
  e3.remove();
1114
- }), d.forEach((e3) => {
1115
+ })), d.forEach(((e3) => {
1115
1116
  s.append(e3);
1116
- }), r.nodes[0].nodes.forEach((e3) => {
1117
+ })), r.nodes[0].nodes.forEach(((e3) => {
1117
1118
  s.append(e3);
1118
- }), l.forEach((e3) => {
1119
+ })), l.forEach(((e3) => {
1119
1120
  s.append(e3);
1120
- }), true;
1121
+ })), true;
1121
1122
  }
1122
1123
  function complexSelectors(s, o2, n2, t) {
1123
- return s.flatMap((s2) => {
1124
+ return s.flatMap(((s2) => {
1124
1125
  if (-1 === s2.indexOf(":-csstools-matches") && -1 === s2.toLowerCase().indexOf(":is")) return s2;
1125
1126
  const r = _postcssselectorparser2.default.call(void 0, ).astSync(s2);
1126
- return r.walkPseudos((s3) => {
1127
+ return r.walkPseudos(((s3) => {
1127
1128
  if (":is" === s3.value.toLowerCase() && s3.nodes && s3.nodes.length && "selector" === s3.nodes[0].type && 0 === s3.nodes[0].nodes.length) return s3.value = ":not", void s3.nodes[0].append(_postcssselectorparser2.default.universal());
1128
1129
  if (":-csstools-matches" === s3.value) if (!s3.nodes || s3.nodes.length) {
1129
- if (s3.walkPseudos((s4) => {
1130
+ if (s3.walkPseudos(((s4) => {
1130
1131
  if (_postcssselectorparser2.default.isPseudoElement(s4)) {
1131
1132
  let e3 = s4.value;
1132
1133
  if (e3.startsWith("::-csstools-invalid-")) return;
1133
1134
  for (; e3.startsWith(":"); ) e3 = e3.slice(1);
1134
1135
  s4.value = `::-csstools-invalid-${e3}`, t();
1135
1136
  }
1136
- }), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
1137
+ })), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
1137
1138
  if (1 === s3.nodes[0].nodes.length) return void s3.replaceWith(s3.nodes[0].nodes[0]);
1138
- if (!s3.nodes[0].some((e3) => "combinator" === e3.type)) return void s3.replaceWith(...s3.nodes[0].nodes);
1139
+ if (!s3.nodes[0].some(((e3) => "combinator" === e3.type))) return void s3.replaceWith(...s3.nodes[0].nodes);
1139
1140
  }
1140
1141
  1 !== r.nodes.length || "selector" !== r.nodes[0].type || 1 !== r.nodes[0].nodes.length || r.nodes[0].nodes[0] !== s3 ? childAdjacentChild(s3.parent) || isInCompoundWithOneOtherElement(s3.parent) || isPseudoInFirstCompound(s3.parent) || samePrecedingElement(s3.parent) || ("warning" === o2.onComplexSelector && n2(), s3.value = ":is") : s3.replaceWith(...s3.nodes[0].nodes);
1141
1142
  } else s3.remove();
1142
- }), r.walk((e3) => {
1143
+ })), r.walk(((e3) => {
1143
1144
  "selector" === e3.type && "nodes" in e3 && 1 === e3.nodes.length && "selector" === e3.nodes[0].type && e3.replaceWith(e3.nodes[0]);
1144
- }), r.walk((e3) => {
1145
+ })), r.walk(((e3) => {
1145
1146
  "nodes" in e3 && sortCompoundSelectorsInsideComplexSelector(e3);
1146
- }), r.toString();
1147
- }).filter((e3) => !!e3);
1147
+ })), r.toString();
1148
+ })).filter(((e3) => !!e3));
1148
1149
  }
1149
1150
  function splitSelectors(o2, n2, t = 0) {
1150
1151
  const r = ":not(#" + n2.specificityMatchingName + ")", d = ":not(." + n2.specificityMatchingName + ")", l = ":not(" + n2.specificityMatchingName + ")";
1151
- return o2.flatMap((o3) => {
1152
+ return o2.flatMap(((o3) => {
1152
1153
  if (-1 === o3.toLowerCase().indexOf(":is")) return o3;
1153
1154
  let i = false;
1154
1155
  const a = [];
1155
- if (_postcssselectorparser2.default.call(void 0, ).astSync(o3).walkPseudos((e3) => {
1156
+ if (_postcssselectorparser2.default.call(void 0, ).astSync(o3).walkPseudos(((e3) => {
1156
1157
  if (":is" !== e3.value.toLowerCase() || !e3.nodes || !e3.nodes.length) return;
1157
1158
  if ("selector" === e3.nodes[0].type && 0 === e3.nodes[0].nodes.length) return;
1158
1159
  if ("pseudo" === _optionalChain([e3, 'access', _44 => _44.parent, 'optionalAccess', _45 => _45.parent, 'optionalAccess', _46 => _46.type]) && ":not" === _optionalChain([e3, 'access', _47 => _47.parent, 'optionalAccess', _48 => _48.parent, 'optionalAccess', _49 => _49.value, 'optionalAccess', _50 => _50.toLowerCase, 'call', _51 => _51()])) return void a.push([{ start: e3.parent.parent.sourceIndex, end: e3.parent.parent.sourceIndex + e3.parent.parent.toString().length, option: `:not(${e3.nodes.toString()})` }]);
@@ -1163,7 +1164,7 @@ function splitSelectors(o2, n2, t = 0) {
1163
1164
  o4 = o4.parent;
1164
1165
  }
1165
1166
  const n3 = selectorSpecificity(e3), t2 = e3.sourceIndex, c2 = t2 + e3.toString().length, p = [];
1166
- e3.nodes.forEach((e4) => {
1167
+ e3.nodes.forEach(((e4) => {
1167
1168
  const o5 = { start: t2, end: c2, option: "" }, i2 = selectorSpecificity(e4);
1168
1169
  let a2 = e4.toString().trim();
1169
1170
  const u = Math.max(0, n3.a - i2.a), h = Math.max(0, n3.b - i2.b), f = Math.max(0, n3.c - i2.c);
@@ -1171,27 +1172,27 @@ function splitSelectors(o2, n2, t = 0) {
1171
1172
  for (let e5 = 0; e5 < h; e5++) a2 += d;
1172
1173
  for (let e5 = 0; e5 < f; e5++) a2 += l;
1173
1174
  o5.option = a2, p.push(o5);
1174
- }), a.push(p);
1175
- }), !a.length) return [o3];
1175
+ })), a.push(p);
1176
+ })), !a.length) return [o3];
1176
1177
  let c = [];
1177
- return cartesianProduct(...a).forEach((e3) => {
1178
+ return cartesianProduct(...a).forEach(((e3) => {
1178
1179
  let s = "";
1179
1180
  for (let n3 = 0; n3 < e3.length; n3++) {
1180
1181
  const t2 = e3[n3];
1181
1182
  s += o3.substring(_optionalChain([e3, 'access', _60 => _60[n3 - 1], 'optionalAccess', _61 => _61.end]) || 0, e3[n3].start), s += ":-csstools-matches(" + t2.option + ")", n3 === e3.length - 1 && (s += o3.substring(e3[n3].end));
1182
1183
  }
1183
1184
  c.push(s);
1184
- }), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
1185
- }).filter((e3) => !!e3);
1185
+ })), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
1186
+ })).filter(((e3) => !!e3));
1186
1187
  }
1187
1188
  function cartesianProduct(...e3) {
1188
1189
  const s = [], o2 = e3.length - 1;
1189
- return function helper(n2, t) {
1190
+ return (function helper(n2, t) {
1190
1191
  for (let r = 0, d = e3[t].length; r < d; r++) {
1191
1192
  const d2 = n2.slice(0);
1192
1193
  d2.push(e3[t][r]), t === o2 ? s.push(d2) : helper(d2, t + 1);
1193
1194
  }
1194
- }([], 0), s;
1195
+ })([], 0), s;
1195
1196
  }
1196
1197
  var n = /:is\(/i;
1197
1198
  var creator = (e3) => {
@@ -1213,13 +1214,13 @@ var creator = (e3) => {
1213
1214
  try {
1214
1215
  let n2 = false;
1215
1216
  const t2 = [], r2 = complexSelectors(splitSelectors(o2.selectors, { specificityMatchingName: s.specificityMatchingName }), { onComplexSelector: s.onComplexSelector }, warnOnComplexSelector, warnOnPseudoElements);
1216
- if (Array.from(new Set(r2)).forEach((s2) => {
1217
+ if (Array.from(new Set(r2)).forEach(((s2) => {
1217
1218
  if (o2.selectors.indexOf(s2) > -1) t2.push(s2);
1218
1219
  else {
1219
1220
  if (alwaysValidSelector(s2)) return t2.push(s2), void (n2 = true);
1220
1221
  e4.add(o2), o2.cloneBefore({ selector: s2 }), n2 = true;
1221
1222
  }
1222
- }), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
1223
+ })), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
1223
1224
  if (!n2) return;
1224
1225
  o2.remove();
1225
1226
  }
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./chunk-WAXGOBY2.mjs";
2
2
 
3
3
  // src/handler.ts
4
- import { defu as defu3, defuOverrideArray } from "@weapp-tailwindcss/shared";
4
+ import { defu as defu3, defuOverrideArray as defuOverrideArray2 } from "@weapp-tailwindcss/shared";
5
5
  import postcss from "postcss";
6
6
 
7
7
  // src/defaults.ts
@@ -59,6 +59,7 @@ import { defu } from "@weapp-tailwindcss/shared";
59
59
  var postcssPlugin = "postcss-weapp-tailwindcss-rename-plugin";
60
60
 
61
61
  // src/selectorParser.ts
62
+ import { defuOverrideArray } from "@weapp-tailwindcss/shared";
62
63
  import psp from "postcss-selector-parser";
63
64
 
64
65
  // src/shared.ts
@@ -190,9 +191,6 @@ function createRuleTransform(rule, options) {
190
191
  }
191
192
  }
192
193
  }
193
- if (uniAppX) {
194
- selector.remove();
195
- }
196
194
  } else if (selector.type === "combinator") {
197
195
  if (selector.value === ">") {
198
196
  const nodes2 = selector.parent?.nodes;
@@ -259,7 +257,8 @@ function isOnlyBeforeAndAfterPseudoElement(node) {
259
257
  }).astSync(node);
260
258
  return b && a;
261
259
  }
262
- function getFallbackRemove(rule) {
260
+ function getFallbackRemove(rule, options) {
261
+ const { uniAppX } = defuOverrideArray(options, {});
263
262
  const fallbackRemove = psp((selectors) => {
264
263
  let maybeImportantId = false;
265
264
  selectors.walk((selector, idx) => {
@@ -307,6 +306,10 @@ function getFallbackRemove(rule) {
307
306
  if (res) {
308
307
  selector.remove();
309
308
  }
309
+ } else if (selector.type === "pseudo") {
310
+ if (uniAppX) {
311
+ selector.remove();
312
+ }
310
313
  }
311
314
  }
312
315
  });
@@ -324,34 +327,32 @@ var postcssWeappTailwindcssPostPlugin = (options) => {
324
327
  postcssPlugin
325
328
  };
326
329
  if (opts.isMainChunk) {
327
- p.OnceExit = (root) => {
328
- root.walkRules((rule) => {
329
- getFallbackRemove(rule).transformSync(rule, {
330
- updateSelector: true,
331
- lossless: false
332
- });
333
- if (rule.selectors.length === 0 || rule.selectors.length === 1 && rule.selector.trim() === "") {
334
- rule.remove();
335
- }
336
- rule.walkDecls((decl) => {
337
- if (decl.prop === "--tw-gradient-position" && decl.value.endsWith(OklabSuffix)) {
338
- decl.value = decl.value.slice(0, decl.value.length - OklabSuffix.length);
339
- } else if (/calc\(\s*infinity\s*\*\s*1px/.test(decl.value)) {
340
- decl.value = "9999px";
341
- }
342
- });
343
- if (opts.uniAppX) {
344
- if (rule.nodes.length === 0) {
345
- rule.remove();
346
- }
347
- }
330
+ p.RuleExit = (rule) => {
331
+ getFallbackRemove(rule, opts).transformSync(rule, {
332
+ updateSelector: true,
333
+ lossless: false
348
334
  });
349
- root.walkAtRules((atRule) => {
350
- if (opts.cssRemoveProperty && atRule.name === "property") {
351
- atRule.remove();
335
+ if (rule.selectors.length === 0 || rule.selectors.length === 1 && rule.selector.trim() === "") {
336
+ rule.remove();
337
+ }
338
+ if (opts.uniAppX) {
339
+ if (rule.nodes.length === 0) {
340
+ rule.remove();
352
341
  }
353
- atRule.nodes?.length === 0 && atRule.remove();
354
- });
342
+ }
343
+ };
344
+ p.DeclarationExit = (decl) => {
345
+ if (decl.prop === "--tw-gradient-position" && decl.value.endsWith(OklabSuffix)) {
346
+ decl.value = decl.value.slice(0, decl.value.length - OklabSuffix.length);
347
+ } else if (/calc\(\s*infinity\s*\*\s*1px/.test(decl.value)) {
348
+ decl.value = "9999px";
349
+ }
350
+ };
351
+ p.AtRuleExit = (atRule) => {
352
+ if (opts.cssRemoveProperty && atRule.name === "property") {
353
+ atRule.remove();
354
+ }
355
+ atRule.nodes?.length === 0 && atRule.remove();
355
356
  };
356
357
  }
357
358
  if (typeof opts.customRuleCallback === "function") {
@@ -944,12 +945,12 @@ function selectorSpecificity(t, s) {
944
945
  case ":nth-child":
945
946
  case ":nth-last-child":
946
947
  if (n2 += 1, t.nodes && t.nodes.length > 0) {
947
- const i2 = t.nodes[0].nodes.findIndex((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase());
948
+ const i2 = t.nodes[0].nodes.findIndex(((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase()));
948
949
  if (i2 > -1) {
949
950
  const a = e.selector({ nodes: [], value: "" });
950
- t.nodes[0].nodes.slice(i2 + 1).forEach((e3) => {
951
+ t.nodes[0].nodes.slice(i2 + 1).forEach(((e3) => {
951
952
  a.append(e3.clone());
952
- });
953
+ }));
953
954
  const r = [a];
954
955
  t.nodes.length > 1 && r.push(...t.nodes.slice(1));
955
956
  const l = specificityOfMostSpecificListItem(r, s);
@@ -959,10 +960,10 @@ function selectorSpecificity(t, s) {
959
960
  break;
960
961
  case ":local":
961
962
  case ":global":
962
- t.nodes && t.nodes.length > 0 && t.nodes.forEach((e3) => {
963
+ t.nodes && t.nodes.length > 0 && t.nodes.forEach(((e3) => {
963
964
  const t2 = selectorSpecificity(e3, s);
964
965
  c += t2.a, n2 += t2.b, o2 += t2.c;
965
- });
966
+ }));
966
967
  break;
967
968
  case ":host":
968
969
  case ":host-context":
@@ -975,18 +976,18 @@ function selectorSpecificity(t, s) {
975
976
  case ":active-view-transition-type":
976
977
  return { a: 0, b: 1, c: 0 };
977
978
  }
978
- else e.isContainer(t) && t.nodes?.length > 0 && t.nodes.forEach((e3) => {
979
+ else e.isContainer(t) && t.nodes?.length > 0 && t.nodes.forEach(((e3) => {
979
980
  const t2 = selectorSpecificity(e3, s);
980
981
  c += t2.a, n2 += t2.b, o2 += t2.c;
981
- });
982
+ }));
982
983
  return { a: c, b: n2, c: o2 };
983
984
  }
984
985
  function specificityOfMostSpecificListItem(e3, t) {
985
986
  let s = { a: 0, b: 0, c: 0 };
986
- return e3.forEach((e4) => {
987
+ return e3.forEach(((e4) => {
987
988
  const i = selectorSpecificity(e4, t);
988
989
  compare(i, s) < 0 || (s = i);
989
- }), s;
990
+ })), s;
990
991
  }
991
992
  function isPseudoElement(t) {
992
993
  return e.isPseudoElement(t);
@@ -994,7 +995,7 @@ function isPseudoElement(t) {
994
995
  function selectorNodeContainsNothingOrOnlyUniversal(e3) {
995
996
  if (!e3) return false;
996
997
  if (!e3.nodes) return false;
997
- const t = e3.nodes.filter((e4) => "comment" !== e4.type);
998
+ const t = e3.nodes.filter(((e4) => "comment" !== e4.type));
998
999
  return 0 === t.length || 1 === t.length && "universal" === t[0].type;
999
1000
  }
1000
1001
 
@@ -1002,17 +1003,17 @@ function selectorNodeContainsNothingOrOnlyUniversal(e3) {
1002
1003
  function alwaysValidSelector(s) {
1003
1004
  const o2 = e2().astSync(s);
1004
1005
  let n2 = true;
1005
- return o2.walk((e3) => {
1006
+ return o2.walk(((e3) => {
1006
1007
  if ("class" !== e3.type && "comment" !== e3.type && "id" !== e3.type && "root" !== e3.type && "selector" !== e3.type && "string" !== e3.type && "tag" !== e3.type && "universal" !== e3.type && ("attribute" !== e3.type || e3.insensitive) && ("combinator" !== e3.type || "+" !== e3.value && ">" !== e3.value && "~" !== e3.value && " " !== e3.value) && ("pseudo" !== e3.type || e3.nodes?.length || ":hover" !== e3.value.toLowerCase() && ":focus" !== e3.value.toLowerCase())) {
1007
1008
  if ("pseudo" === e3.type && 1 === e3.nodes?.length && ":not" === e3.value.toLowerCase()) {
1008
1009
  let s2 = true;
1009
- if (e3.nodes[0].walkCombinators(() => {
1010
+ if (e3.nodes[0].walkCombinators((() => {
1010
1011
  s2 = false;
1011
- }), s2) return;
1012
+ })), s2) return;
1012
1013
  }
1013
1014
  return n2 = false, false;
1014
1015
  }
1015
- }), n2;
1016
+ })), n2;
1016
1017
  }
1017
1018
  function sortCompoundSelectorsInsideComplexSelector(s) {
1018
1019
  if (!s || !s.nodes || 1 === s.nodes.length) return;
@@ -1023,8 +1024,8 @@ function sortCompoundSelectorsInsideComplexSelector(s) {
1023
1024
  const t = [];
1024
1025
  for (let e3 = 0; e3 < o2.length; e3++) {
1025
1026
  const s2 = o2[e3];
1026
- s2.sort((e4, s3) => "selector" === e4.type && "selector" === s3.type && e4.nodes.length && s3.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : "selector" === e4.type && e4.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3, s3.type) : "selector" === s3.type && s3.nodes.length ? selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3, s3.type));
1027
- const n3 = new Set(s2.map((e4) => e4.type)), r = n3.has("universal") && (n3.has("tag") || n3.has("attribute") || n3.has("class") || n3.has("id") || n3.has("pseudo"));
1027
+ s2.sort(((e4, s3) => "selector" === e4.type && "selector" === s3.type && e4.nodes.length && s3.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : "selector" === e4.type && e4.nodes.length ? selectorTypeOrder(e4.nodes[0], e4.nodes[0].type) - selectorTypeOrder(s3, s3.type) : "selector" === s3.type && s3.nodes.length ? selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3.nodes[0], s3.nodes[0].type) : selectorTypeOrder(e4, e4.type) - selectorTypeOrder(s3, s3.type)));
1028
+ const n3 = new Set(s2.map(((e4) => e4.type))), r = n3.has("universal") && (n3.has("tag") || n3.has("attribute") || n3.has("class") || n3.has("id") || n3.has("pseudo"));
1028
1029
  for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() : t.push(s2[e4]);
1029
1030
  }
1030
1031
  s.removeAll();
@@ -1075,15 +1076,15 @@ function isPseudoInFirstCompound(s) {
1075
1076
  const n2 = s.nodes[o2];
1076
1077
  if (!n2 || !e2.isPseudoClass(n2)) return false;
1077
1078
  const t = s.nodes.slice(0, o2), r = s.nodes.slice(o2 + 1);
1078
- return t.forEach((e3) => {
1079
+ return t.forEach(((e3) => {
1079
1080
  n2.nodes[0].append(e3.clone());
1080
- }), r.forEach((e3) => {
1081
+ })), r.forEach(((e3) => {
1081
1082
  n2.nodes[0].append(e3.clone());
1082
- }), n2.replaceWith(...n2.nodes), t.forEach((e3) => {
1083
+ })), n2.replaceWith(...n2.nodes), t.forEach(((e3) => {
1083
1084
  e3.remove();
1084
- }), r.forEach((e3) => {
1085
+ })), r.forEach(((e3) => {
1085
1086
  e3.remove();
1086
- }), true;
1087
+ })), true;
1087
1088
  }
1088
1089
  function samePrecedingElement(s) {
1089
1090
  if (!s || !s.nodes) return false;
@@ -1109,50 +1110,50 @@ function samePrecedingElement(s) {
1109
1110
  const r = s.nodes[n2];
1110
1111
  if (!r || !e2.isPseudoClass(r)) return false;
1111
1112
  const d = s.nodes.slice(0, o2), l = s.nodes.slice(n2 + 1);
1112
- return s.each((e3) => {
1113
+ return s.each(((e3) => {
1113
1114
  e3.remove();
1114
- }), d.forEach((e3) => {
1115
+ })), d.forEach(((e3) => {
1115
1116
  s.append(e3);
1116
- }), r.nodes[0].nodes.forEach((e3) => {
1117
+ })), r.nodes[0].nodes.forEach(((e3) => {
1117
1118
  s.append(e3);
1118
- }), l.forEach((e3) => {
1119
+ })), l.forEach(((e3) => {
1119
1120
  s.append(e3);
1120
- }), true;
1121
+ })), true;
1121
1122
  }
1122
1123
  function complexSelectors(s, o2, n2, t) {
1123
- return s.flatMap((s2) => {
1124
+ return s.flatMap(((s2) => {
1124
1125
  if (-1 === s2.indexOf(":-csstools-matches") && -1 === s2.toLowerCase().indexOf(":is")) return s2;
1125
1126
  const r = e2().astSync(s2);
1126
- return r.walkPseudos((s3) => {
1127
+ return r.walkPseudos(((s3) => {
1127
1128
  if (":is" === s3.value.toLowerCase() && s3.nodes && s3.nodes.length && "selector" === s3.nodes[0].type && 0 === s3.nodes[0].nodes.length) return s3.value = ":not", void s3.nodes[0].append(e2.universal());
1128
1129
  if (":-csstools-matches" === s3.value) if (!s3.nodes || s3.nodes.length) {
1129
- if (s3.walkPseudos((s4) => {
1130
+ if (s3.walkPseudos(((s4) => {
1130
1131
  if (e2.isPseudoElement(s4)) {
1131
1132
  let e3 = s4.value;
1132
1133
  if (e3.startsWith("::-csstools-invalid-")) return;
1133
1134
  for (; e3.startsWith(":"); ) e3 = e3.slice(1);
1134
1135
  s4.value = `::-csstools-invalid-${e3}`, t();
1135
1136
  }
1136
- }), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
1137
+ })), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
1137
1138
  if (1 === s3.nodes[0].nodes.length) return void s3.replaceWith(s3.nodes[0].nodes[0]);
1138
- if (!s3.nodes[0].some((e3) => "combinator" === e3.type)) return void s3.replaceWith(...s3.nodes[0].nodes);
1139
+ if (!s3.nodes[0].some(((e3) => "combinator" === e3.type))) return void s3.replaceWith(...s3.nodes[0].nodes);
1139
1140
  }
1140
1141
  1 !== r.nodes.length || "selector" !== r.nodes[0].type || 1 !== r.nodes[0].nodes.length || r.nodes[0].nodes[0] !== s3 ? childAdjacentChild(s3.parent) || isInCompoundWithOneOtherElement(s3.parent) || isPseudoInFirstCompound(s3.parent) || samePrecedingElement(s3.parent) || ("warning" === o2.onComplexSelector && n2(), s3.value = ":is") : s3.replaceWith(...s3.nodes[0].nodes);
1141
1142
  } else s3.remove();
1142
- }), r.walk((e3) => {
1143
+ })), r.walk(((e3) => {
1143
1144
  "selector" === e3.type && "nodes" in e3 && 1 === e3.nodes.length && "selector" === e3.nodes[0].type && e3.replaceWith(e3.nodes[0]);
1144
- }), r.walk((e3) => {
1145
+ })), r.walk(((e3) => {
1145
1146
  "nodes" in e3 && sortCompoundSelectorsInsideComplexSelector(e3);
1146
- }), r.toString();
1147
- }).filter((e3) => !!e3);
1147
+ })), r.toString();
1148
+ })).filter(((e3) => !!e3));
1148
1149
  }
1149
1150
  function splitSelectors(o2, n2, t = 0) {
1150
1151
  const r = ":not(#" + n2.specificityMatchingName + ")", d = ":not(." + n2.specificityMatchingName + ")", l = ":not(" + n2.specificityMatchingName + ")";
1151
- return o2.flatMap((o3) => {
1152
+ return o2.flatMap(((o3) => {
1152
1153
  if (-1 === o3.toLowerCase().indexOf(":is")) return o3;
1153
1154
  let i = false;
1154
1155
  const a = [];
1155
- if (e2().astSync(o3).walkPseudos((e3) => {
1156
+ if (e2().astSync(o3).walkPseudos(((e3) => {
1156
1157
  if (":is" !== e3.value.toLowerCase() || !e3.nodes || !e3.nodes.length) return;
1157
1158
  if ("selector" === e3.nodes[0].type && 0 === e3.nodes[0].nodes.length) return;
1158
1159
  if ("pseudo" === e3.parent?.parent?.type && ":not" === e3.parent?.parent?.value?.toLowerCase()) return void a.push([{ start: e3.parent.parent.sourceIndex, end: e3.parent.parent.sourceIndex + e3.parent.parent.toString().length, option: `:not(${e3.nodes.toString()})` }]);
@@ -1163,7 +1164,7 @@ function splitSelectors(o2, n2, t = 0) {
1163
1164
  o4 = o4.parent;
1164
1165
  }
1165
1166
  const n3 = selectorSpecificity(e3), t2 = e3.sourceIndex, c2 = t2 + e3.toString().length, p = [];
1166
- e3.nodes.forEach((e4) => {
1167
+ e3.nodes.forEach(((e4) => {
1167
1168
  const o5 = { start: t2, end: c2, option: "" }, i2 = selectorSpecificity(e4);
1168
1169
  let a2 = e4.toString().trim();
1169
1170
  const u = Math.max(0, n3.a - i2.a), h = Math.max(0, n3.b - i2.b), f = Math.max(0, n3.c - i2.c);
@@ -1171,27 +1172,27 @@ function splitSelectors(o2, n2, t = 0) {
1171
1172
  for (let e5 = 0; e5 < h; e5++) a2 += d;
1172
1173
  for (let e5 = 0; e5 < f; e5++) a2 += l;
1173
1174
  o5.option = a2, p.push(o5);
1174
- }), a.push(p);
1175
- }), !a.length) return [o3];
1175
+ })), a.push(p);
1176
+ })), !a.length) return [o3];
1176
1177
  let c = [];
1177
- return cartesianProduct(...a).forEach((e3) => {
1178
+ return cartesianProduct(...a).forEach(((e3) => {
1178
1179
  let s = "";
1179
1180
  for (let n3 = 0; n3 < e3.length; n3++) {
1180
1181
  const t2 = e3[n3];
1181
1182
  s += o3.substring(e3[n3 - 1]?.end || 0, e3[n3].start), s += ":-csstools-matches(" + t2.option + ")", n3 === e3.length - 1 && (s += o3.substring(e3[n3].end));
1182
1183
  }
1183
1184
  c.push(s);
1184
- }), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
1185
- }).filter((e3) => !!e3);
1185
+ })), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
1186
+ })).filter(((e3) => !!e3));
1186
1187
  }
1187
1188
  function cartesianProduct(...e3) {
1188
1189
  const s = [], o2 = e3.length - 1;
1189
- return function helper(n2, t) {
1190
+ return (function helper(n2, t) {
1190
1191
  for (let r = 0, d = e3[t].length; r < d; r++) {
1191
1192
  const d2 = n2.slice(0);
1192
1193
  d2.push(e3[t][r]), t === o2 ? s.push(d2) : helper(d2, t + 1);
1193
1194
  }
1194
- }([], 0), s;
1195
+ })([], 0), s;
1195
1196
  }
1196
1197
  var n = /:is\(/i;
1197
1198
  var creator = (e3) => {
@@ -1213,13 +1214,13 @@ var creator = (e3) => {
1213
1214
  try {
1214
1215
  let n2 = false;
1215
1216
  const t2 = [], r2 = complexSelectors(splitSelectors(o2.selectors, { specificityMatchingName: s.specificityMatchingName }), { onComplexSelector: s.onComplexSelector }, warnOnComplexSelector, warnOnPseudoElements);
1216
- if (Array.from(new Set(r2)).forEach((s2) => {
1217
+ if (Array.from(new Set(r2)).forEach(((s2) => {
1217
1218
  if (o2.selectors.indexOf(s2) > -1) t2.push(s2);
1218
1219
  else {
1219
1220
  if (alwaysValidSelector(s2)) return t2.push(s2), void (n2 = true);
1220
1221
  e4.add(o2), o2.cloneBefore({ selector: s2 }), n2 = true;
1221
1222
  }
1222
- }), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
1223
+ })), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
1223
1224
  if (!n2) return;
1224
1225
  o2.remove();
1225
1226
  }
@@ -1289,7 +1290,7 @@ function styleHandler(rawSource, options) {
1289
1290
  ).async();
1290
1291
  }
1291
1292
  function createStyleHandler(options) {
1292
- const cachedOptions = defuOverrideArray(
1293
+ const cachedOptions = defuOverrideArray2(
1293
1294
  options,
1294
1295
  getDefaultOptions()
1295
1296
  );
@@ -1297,7 +1298,7 @@ function createStyleHandler(options) {
1297
1298
  return (rawSource, opt) => {
1298
1299
  return styleHandler(
1299
1300
  rawSource,
1300
- defuOverrideArray(opt, cachedOptions)
1301
+ defuOverrideArray2(opt, cachedOptions)
1301
1302
  );
1302
1303
  };
1303
1304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "1.0.21",
3
+ "version": "1.1.0-alpha.1",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@weapp-core/escape": "~4.0.1",
43
43
  "postcss": "~8.5.6",
44
- "postcss-preset-env": "^10.2.4",
44
+ "postcss-preset-env": "^10.3.0",
45
45
  "postcss-rem-to-responsive-pixel": "~6.0.2",
46
46
  "postcss-selector-parser": "~7.1.0",
47
47
  "@weapp-tailwindcss/shared": "1.0.3"