@weapp-tailwindcss/postcss 1.0.13 → 1.0.15
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/dist/index.js +180 -133
- package/dist/index.mjs +180 -133
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -280,8 +280,8 @@ function getFallbackRemove(rule) {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
} else if (selector.value === ":where") {
|
|
283
|
-
for (const
|
|
284
|
-
for (const node of
|
|
283
|
+
for (const n2 of selector.nodes) {
|
|
284
|
+
for (const node of n2.nodes) {
|
|
285
285
|
if (node.type === "attribute") {
|
|
286
286
|
node.remove();
|
|
287
287
|
}
|
|
@@ -846,6 +846,10 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
846
846
|
if (/color-mix/.test(atRule.params)) {
|
|
847
847
|
atRule.remove();
|
|
848
848
|
}
|
|
849
|
+
} else if (atRule.name === "layer") {
|
|
850
|
+
if (atRule.nodes === void 0 || Array.isArray(atRule.nodes) && atRule.nodes.length === 0) {
|
|
851
|
+
atRule.remove();
|
|
852
|
+
}
|
|
849
853
|
}
|
|
850
854
|
}
|
|
851
855
|
};
|
|
@@ -853,16 +857,20 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
853
857
|
let layerProperties;
|
|
854
858
|
p.Once = (root) => {
|
|
855
859
|
root.walkAtRules((atRule) => {
|
|
856
|
-
if (atRule.name === "layer"
|
|
857
|
-
if (atRule.
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
if (
|
|
861
|
-
layerProperties
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
860
|
+
if (atRule.name === "layer") {
|
|
861
|
+
if (atRule.params === "properties") {
|
|
862
|
+
if (atRule.nodes === void 0 || _optionalChain([atRule, 'access', _30 => _30.nodes, 'optionalAccess', _31 => _31.length]) === 0) {
|
|
863
|
+
layerProperties = atRule;
|
|
864
|
+
} else if (_optionalChain([atRule, 'access', _32 => _32.first, 'optionalAccess', _33 => _33.type]) === "atrule" && isTailwindcssV4ModernCheck(atRule.first)) {
|
|
865
|
+
if (layerProperties) {
|
|
866
|
+
layerProperties.replaceWith(atRule.first.nodes);
|
|
867
|
+
atRule.remove();
|
|
868
|
+
} else {
|
|
869
|
+
atRule.replaceWith(atRule.first.nodes);
|
|
870
|
+
}
|
|
865
871
|
}
|
|
872
|
+
} else {
|
|
873
|
+
atRule.replaceWith(atRule.nodes);
|
|
866
874
|
}
|
|
867
875
|
} else if (isTailwindcssV4ModernCheck(atRule)) {
|
|
868
876
|
if (_optionalChain([atRule, 'access', _34 => _34.first, 'optionalAccess', _35 => _35.type]) === "atrule" && atRule.first.name === "layer") {
|
|
@@ -879,118 +887,118 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
879
887
|
};
|
|
880
888
|
postcssWeappTailwindcssPrePlugin.postcss = true;
|
|
881
889
|
|
|
882
|
-
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.
|
|
890
|
+
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.3_postcss@8.5.6/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
|
|
883
891
|
|
|
884
892
|
|
|
885
893
|
// ../../node_modules/.pnpm/@csstools+selector-specificity@5.0.0_postcss-selector-parser@7.1.0/node_modules/@csstools/selector-specificity/dist/index.mjs
|
|
886
894
|
|
|
887
|
-
function compare(e3,
|
|
888
|
-
return e3.a ===
|
|
895
|
+
function compare(e3, t) {
|
|
896
|
+
return e3.a === t.a ? e3.b === t.b ? e3.c - t.c : e3.b - t.b : e3.a - t.a;
|
|
889
897
|
}
|
|
890
|
-
function selectorSpecificity(
|
|
891
|
-
const i = _optionalChain([s, 'optionalAccess', _36 => _36.customSpecificity, 'optionalCall', _37 => _37(
|
|
898
|
+
function selectorSpecificity(t, s) {
|
|
899
|
+
const i = _optionalChain([s, 'optionalAccess', _36 => _36.customSpecificity, 'optionalCall', _37 => _37(t)]);
|
|
892
900
|
if (i) return i;
|
|
893
|
-
if (!
|
|
894
|
-
let c = 0,
|
|
895
|
-
if ("universal" ==
|
|
896
|
-
if ("id" ===
|
|
897
|
-
else if ("tag" ===
|
|
898
|
-
else if ("class" ===
|
|
899
|
-
else if ("attribute" ===
|
|
900
|
-
else if (isPseudoElement(
|
|
901
|
+
if (!t) return { a: 0, b: 0, c: 0 };
|
|
902
|
+
let c = 0, n2 = 0, o2 = 0;
|
|
903
|
+
if ("universal" == t.type) return { a: 0, b: 0, c: 0 };
|
|
904
|
+
if ("id" === t.type) c += 1;
|
|
905
|
+
else if ("tag" === t.type) o2 += 1;
|
|
906
|
+
else if ("class" === t.type) n2 += 1;
|
|
907
|
+
else if ("attribute" === t.type) n2 += 1;
|
|
908
|
+
else if (isPseudoElement(t)) switch (t.value.toLowerCase()) {
|
|
901
909
|
case "::slotted":
|
|
902
|
-
if (o2 += 1,
|
|
903
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
904
|
-
c += e3.a,
|
|
910
|
+
if (o2 += 1, t.nodes && t.nodes.length > 0) {
|
|
911
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
912
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
905
913
|
}
|
|
906
914
|
break;
|
|
907
915
|
case "::view-transition-group":
|
|
908
916
|
case "::view-transition-image-pair":
|
|
909
917
|
case "::view-transition-old":
|
|
910
918
|
case "::view-transition-new":
|
|
911
|
-
return
|
|
919
|
+
return t.nodes && 1 === t.nodes.length && "selector" === t.nodes[0].type && selectorNodeContainsNothingOrOnlyUniversal(t.nodes[0]) ? { a: 0, b: 0, c: 0 } : { a: 0, b: 0, c: 1 };
|
|
912
920
|
default:
|
|
913
921
|
o2 += 1;
|
|
914
922
|
}
|
|
915
|
-
else if (_postcssselectorparser2.default.isPseudoClass(
|
|
923
|
+
else if (_postcssselectorparser2.default.isPseudoClass(t)) switch (t.value.toLowerCase()) {
|
|
916
924
|
case ":-webkit-any":
|
|
917
925
|
case ":any":
|
|
918
926
|
default:
|
|
919
|
-
|
|
927
|
+
n2 += 1;
|
|
920
928
|
break;
|
|
921
929
|
case ":-moz-any":
|
|
922
930
|
case ":has":
|
|
923
931
|
case ":is":
|
|
924
932
|
case ":matches":
|
|
925
933
|
case ":not":
|
|
926
|
-
if (
|
|
927
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
928
|
-
c += e3.a,
|
|
934
|
+
if (t.nodes && t.nodes.length > 0) {
|
|
935
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
936
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
929
937
|
}
|
|
930
938
|
break;
|
|
931
939
|
case ":where":
|
|
932
940
|
break;
|
|
933
941
|
case ":nth-child":
|
|
934
942
|
case ":nth-last-child":
|
|
935
|
-
if (
|
|
936
|
-
const i2 =
|
|
943
|
+
if (n2 += 1, t.nodes && t.nodes.length > 0) {
|
|
944
|
+
const i2 = t.nodes[0].nodes.findIndex((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase());
|
|
937
945
|
if (i2 > -1) {
|
|
938
946
|
const a = _postcssselectorparser2.default.selector({ nodes: [], value: "" });
|
|
939
|
-
|
|
947
|
+
t.nodes[0].nodes.slice(i2 + 1).forEach((e3) => {
|
|
940
948
|
a.append(e3.clone());
|
|
941
949
|
});
|
|
942
950
|
const r = [a];
|
|
943
|
-
|
|
951
|
+
t.nodes.length > 1 && r.push(...t.nodes.slice(1));
|
|
944
952
|
const l = specificityOfMostSpecificListItem(r, s);
|
|
945
|
-
c += l.a,
|
|
953
|
+
c += l.a, n2 += l.b, o2 += l.c;
|
|
946
954
|
}
|
|
947
955
|
}
|
|
948
956
|
break;
|
|
949
957
|
case ":local":
|
|
950
958
|
case ":global":
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
c +=
|
|
959
|
+
t.nodes && t.nodes.length > 0 && t.nodes.forEach((e3) => {
|
|
960
|
+
const t2 = selectorSpecificity(e3, s);
|
|
961
|
+
c += t2.a, n2 += t2.b, o2 += t2.c;
|
|
954
962
|
});
|
|
955
963
|
break;
|
|
956
964
|
case ":host":
|
|
957
965
|
case ":host-context":
|
|
958
|
-
if (
|
|
959
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
960
|
-
c += e3.a,
|
|
966
|
+
if (n2 += 1, t.nodes && t.nodes.length > 0) {
|
|
967
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
968
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
961
969
|
}
|
|
962
970
|
break;
|
|
963
971
|
case ":active-view-transition":
|
|
964
972
|
case ":active-view-transition-type":
|
|
965
973
|
return { a: 0, b: 1, c: 0 };
|
|
966
974
|
}
|
|
967
|
-
else _postcssselectorparser2.default.isContainer(
|
|
968
|
-
const
|
|
969
|
-
c +=
|
|
975
|
+
else _postcssselectorparser2.default.isContainer(t) && _optionalChain([t, 'access', _38 => _38.nodes, 'optionalAccess', _39 => _39.length]) > 0 && t.nodes.forEach((e3) => {
|
|
976
|
+
const t2 = selectorSpecificity(e3, s);
|
|
977
|
+
c += t2.a, n2 += t2.b, o2 += t2.c;
|
|
970
978
|
});
|
|
971
|
-
return { a: c, b:
|
|
979
|
+
return { a: c, b: n2, c: o2 };
|
|
972
980
|
}
|
|
973
|
-
function specificityOfMostSpecificListItem(e3,
|
|
981
|
+
function specificityOfMostSpecificListItem(e3, t) {
|
|
974
982
|
let s = { a: 0, b: 0, c: 0 };
|
|
975
983
|
return e3.forEach((e4) => {
|
|
976
|
-
const i = selectorSpecificity(e4,
|
|
984
|
+
const i = selectorSpecificity(e4, t);
|
|
977
985
|
compare(i, s) < 0 || (s = i);
|
|
978
986
|
}), s;
|
|
979
987
|
}
|
|
980
|
-
function isPseudoElement(
|
|
981
|
-
return _postcssselectorparser2.default.isPseudoElement(
|
|
988
|
+
function isPseudoElement(t) {
|
|
989
|
+
return _postcssselectorparser2.default.isPseudoElement(t);
|
|
982
990
|
}
|
|
983
991
|
function selectorNodeContainsNothingOrOnlyUniversal(e3) {
|
|
984
992
|
if (!e3) return false;
|
|
985
993
|
if (!e3.nodes) return false;
|
|
986
|
-
const
|
|
987
|
-
return 0 ===
|
|
994
|
+
const t = e3.nodes.filter((e4) => "comment" !== e4.type);
|
|
995
|
+
return 0 === t.length || 1 === t.length && "universal" === t[0].type;
|
|
988
996
|
}
|
|
989
997
|
|
|
990
|
-
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.
|
|
998
|
+
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.3_postcss@8.5.6/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
|
|
991
999
|
function alwaysValidSelector(s) {
|
|
992
1000
|
const o2 = _postcssselectorparser2.default.call(void 0, ).astSync(s);
|
|
993
|
-
let
|
|
1001
|
+
let n2 = true;
|
|
994
1002
|
return o2.walk((e3) => {
|
|
995
1003
|
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())) {
|
|
996
1004
|
if ("pseudo" === e3.type && 1 === _optionalChain([e3, 'access', _42 => _42.nodes, 'optionalAccess', _43 => _43.length]) && ":not" === e3.value.toLowerCase()) {
|
|
@@ -999,34 +1007,34 @@ function alwaysValidSelector(s) {
|
|
|
999
1007
|
s2 = false;
|
|
1000
1008
|
}), s2) return;
|
|
1001
1009
|
}
|
|
1002
|
-
return
|
|
1010
|
+
return n2 = false, false;
|
|
1003
1011
|
}
|
|
1004
|
-
}),
|
|
1012
|
+
}), n2;
|
|
1005
1013
|
}
|
|
1006
1014
|
function sortCompoundSelectorsInsideComplexSelector(s) {
|
|
1007
1015
|
if (!s || !s.nodes || 1 === s.nodes.length) return;
|
|
1008
1016
|
const o2 = [];
|
|
1009
|
-
let
|
|
1010
|
-
for (let
|
|
1011
|
-
o2.push(
|
|
1012
|
-
const
|
|
1017
|
+
let n2 = [];
|
|
1018
|
+
for (let t2 = 0; t2 < s.nodes.length; t2++) "combinator" !== s.nodes[t2].type ? _postcssselectorparser2.default.isPseudoElement(s.nodes[t2]) ? (o2.push(n2), n2 = [s.nodes[t2]]) : n2.push(s.nodes[t2]) : (o2.push(n2), o2.push([s.nodes[t2]]), n2 = []);
|
|
1019
|
+
o2.push(n2);
|
|
1020
|
+
const t = [];
|
|
1013
1021
|
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1014
1022
|
const s2 = o2[e3];
|
|
1015
1023
|
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));
|
|
1016
|
-
const
|
|
1017
|
-
for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() :
|
|
1024
|
+
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"));
|
|
1025
|
+
for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() : t.push(s2[e4]);
|
|
1018
1026
|
}
|
|
1019
1027
|
s.removeAll();
|
|
1020
|
-
for (let o3 =
|
|
1021
|
-
const
|
|
1022
|
-
if (
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
} else
|
|
1028
|
+
for (let o3 = t.length - 1; o3 >= 0; o3--) {
|
|
1029
|
+
const n3 = t[o3 - 1];
|
|
1030
|
+
if (t[o3].remove(), n3 && "tag" === n3.type && "tag" === t[o3].type) {
|
|
1031
|
+
const n4 = _postcssselectorparser2.default.pseudo({ value: ":is", nodes: [_postcssselectorparser2.default.selector({ value: "", nodes: [t[o3]] })] });
|
|
1032
|
+
n4.parent = s, s.nodes.unshift(n4);
|
|
1033
|
+
} else t[o3].parent = s, s.nodes.unshift(t[o3]);
|
|
1026
1034
|
}
|
|
1027
1035
|
}
|
|
1028
|
-
function selectorTypeOrder(s,
|
|
1029
|
-
return _postcssselectorparser2.default.isPseudoElement(s) ? o.pseudoElement : o[
|
|
1036
|
+
function selectorTypeOrder(s, n2) {
|
|
1037
|
+
return _postcssselectorparser2.default.isPseudoElement(s) ? o.pseudoElement : o[n2];
|
|
1030
1038
|
}
|
|
1031
1039
|
var o = { universal: 0, tag: 1, pseudoElement: 2, id: 3, class: 4, attribute: 5, pseudo: 6, selector: 7, string: 8, root: 9, comment: 10 };
|
|
1032
1040
|
function childAdjacentChild(e3) {
|
|
@@ -1036,40 +1044,79 @@ function isInCompoundWithOneOtherElement(s) {
|
|
|
1036
1044
|
if (!s || !s.nodes) return false;
|
|
1037
1045
|
if (!_postcssselectorparser2.default.isSelector(s)) return false;
|
|
1038
1046
|
if (2 !== s.nodes.length) return false;
|
|
1039
|
-
let o2 = -1,
|
|
1040
|
-
s.nodes[0] && _postcssselectorparser2.default.isPseudoClass(s.nodes[0]) && ":-csstools-matches" === s.nodes[0].value ? (o2 = 0,
|
|
1041
|
-
const
|
|
1042
|
-
if (!
|
|
1043
|
-
const r = s.nodes[
|
|
1044
|
-
return !!r && (!_postcssselectorparser2.default.isCombinator(r) && (
|
|
1047
|
+
let o2 = -1, n2 = -1;
|
|
1048
|
+
s.nodes[0] && _postcssselectorparser2.default.isPseudoClass(s.nodes[0]) && ":-csstools-matches" === s.nodes[0].value ? (o2 = 0, n2 = 1) : s.nodes[1] && _postcssselectorparser2.default.isPseudoClass(s.nodes[1]) && ":-csstools-matches" === s.nodes[1].value && (o2 = 1, n2 = 0);
|
|
1049
|
+
const t = s.nodes[o2];
|
|
1050
|
+
if (!t || !_postcssselectorparser2.default.isPseudoClass(t) || 1 !== t.nodes.length) return false;
|
|
1051
|
+
const r = s.nodes[n2];
|
|
1052
|
+
return !!r && (!_postcssselectorparser2.default.isCombinator(r) && (!_postcssselectorparser2.default.isPseudoElement(r) && (t.nodes[0].append(r.clone()), t.replaceWith(...t.nodes[0].nodes), r.remove(), true)));
|
|
1045
1053
|
}
|
|
1046
1054
|
function isPseudoInFirstCompound(s) {
|
|
1047
1055
|
if (!s || !s.nodes) return false;
|
|
1048
1056
|
if (!_postcssselectorparser2.default.isSelector(s)) return false;
|
|
1049
1057
|
let o2 = -1;
|
|
1050
|
-
for (let
|
|
1051
|
-
const
|
|
1052
|
-
if (_postcssselectorparser2.default.isCombinator(
|
|
1053
|
-
if (_postcssselectorparser2.default.
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1058
|
+
for (let n3 = 0; n3 < s.nodes.length; n3++) {
|
|
1059
|
+
const t2 = s.nodes[n3];
|
|
1060
|
+
if (_postcssselectorparser2.default.isCombinator(t2)) return false;
|
|
1061
|
+
if (_postcssselectorparser2.default.isPseudoElement(t2)) return false;
|
|
1062
|
+
if (_postcssselectorparser2.default.isPseudoClass(t2)) {
|
|
1063
|
+
const e3 = t2;
|
|
1064
|
+
if (":-csstools-matches" === e3.value) {
|
|
1065
|
+
if (!e3.nodes || 1 !== e3.nodes.length) return false;
|
|
1066
|
+
o2 = n3;
|
|
1067
|
+
break;
|
|
1068
|
+
}
|
|
1057
1069
|
}
|
|
1058
1070
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1071
|
+
if (-1 === o2) return false;
|
|
1072
|
+
const n2 = s.nodes[o2];
|
|
1073
|
+
if (!n2 || !_postcssselectorparser2.default.isPseudoClass(n2)) return false;
|
|
1074
|
+
const t = s.nodes.slice(0, o2), r = s.nodes.slice(o2 + 1);
|
|
1075
|
+
return t.forEach((e3) => {
|
|
1076
|
+
n2.nodes[0].append(e3.clone());
|
|
1064
1077
|
}), r.forEach((e3) => {
|
|
1065
|
-
|
|
1066
|
-
}),
|
|
1078
|
+
n2.nodes[0].append(e3.clone());
|
|
1079
|
+
}), n2.replaceWith(...n2.nodes), t.forEach((e3) => {
|
|
1067
1080
|
e3.remove();
|
|
1068
1081
|
}), r.forEach((e3) => {
|
|
1069
1082
|
e3.remove();
|
|
1070
1083
|
}), true;
|
|
1071
1084
|
}
|
|
1072
|
-
function
|
|
1085
|
+
function samePrecedingElement(s) {
|
|
1086
|
+
if (!s || !s.nodes) return false;
|
|
1087
|
+
if ("selector" !== s.type) return false;
|
|
1088
|
+
let o2 = -1;
|
|
1089
|
+
for (let n3 = 0; n3 < s.nodes.length; n3++) {
|
|
1090
|
+
const t2 = s.nodes[n3];
|
|
1091
|
+
if (_postcssselectorparser2.default.isCombinator(t2)) {
|
|
1092
|
+
o2 = n3;
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
if (_postcssselectorparser2.default.isPseudoElement(t2)) return false;
|
|
1096
|
+
}
|
|
1097
|
+
if (-1 === o2) return false;
|
|
1098
|
+
const n2 = o2 + 1;
|
|
1099
|
+
if (!s.nodes[o2] || "combinator" !== s.nodes[o2].type || ">" !== s.nodes[o2].value && "+" !== s.nodes[o2].value) return false;
|
|
1100
|
+
const t = s.nodes[o2].value;
|
|
1101
|
+
if (!s.nodes[n2] || "pseudo" !== s.nodes[n2].type || ":-csstools-matches" !== s.nodes[n2].value) return false;
|
|
1102
|
+
if (!s.nodes[n2].nodes || 1 !== s.nodes[n2].nodes.length) return false;
|
|
1103
|
+
if ("selector" !== s.nodes[n2].nodes[0].type) return false;
|
|
1104
|
+
if (!s.nodes[n2].nodes[0].nodes || 3 !== s.nodes[n2].nodes[0].nodes.length) return false;
|
|
1105
|
+
if (!s.nodes[n2].nodes[0].nodes || "combinator" !== s.nodes[n2].nodes[0].nodes[1].type || s.nodes[n2].nodes[0].nodes[1].value !== t) return false;
|
|
1106
|
+
const r = s.nodes[n2];
|
|
1107
|
+
if (!r || !_postcssselectorparser2.default.isPseudoClass(r)) return false;
|
|
1108
|
+
const d = s.nodes.slice(0, o2), l = s.nodes.slice(n2 + 1);
|
|
1109
|
+
return s.each((e3) => {
|
|
1110
|
+
e3.remove();
|
|
1111
|
+
}), d.forEach((e3) => {
|
|
1112
|
+
s.append(e3);
|
|
1113
|
+
}), r.nodes[0].nodes.forEach((e3) => {
|
|
1114
|
+
s.append(e3);
|
|
1115
|
+
}), l.forEach((e3) => {
|
|
1116
|
+
s.append(e3);
|
|
1117
|
+
}), true;
|
|
1118
|
+
}
|
|
1119
|
+
function complexSelectors(s, o2, n2, t) {
|
|
1073
1120
|
return s.flatMap((s2) => {
|
|
1074
1121
|
if (-1 === s2.indexOf(":-csstools-matches") && -1 === s2.toLowerCase().indexOf(":is")) return s2;
|
|
1075
1122
|
const r = _postcssselectorparser2.default.call(void 0, ).astSync(s2);
|
|
@@ -1081,13 +1128,13 @@ function complexSelectors(s, o2, t2, n) {
|
|
|
1081
1128
|
let e3 = s4.value;
|
|
1082
1129
|
if (e3.startsWith("::-csstools-invalid-")) return;
|
|
1083
1130
|
for (; e3.startsWith(":"); ) e3 = e3.slice(1);
|
|
1084
|
-
s4.value = `::-csstools-invalid-${e3}`,
|
|
1131
|
+
s4.value = `::-csstools-invalid-${e3}`, t();
|
|
1085
1132
|
}
|
|
1086
1133
|
}), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
|
|
1087
1134
|
if (1 === s3.nodes[0].nodes.length) return void s3.replaceWith(s3.nodes[0].nodes[0]);
|
|
1088
1135
|
if (!s3.nodes[0].some((e3) => "combinator" === e3.type)) return void s3.replaceWith(...s3.nodes[0].nodes);
|
|
1089
1136
|
}
|
|
1090
|
-
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) || ("warning" === o2.onComplexSelector &&
|
|
1137
|
+
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);
|
|
1091
1138
|
} else s3.remove();
|
|
1092
1139
|
}), r.walk((e3) => {
|
|
1093
1140
|
"selector" === e3.type && "nodes" in e3 && 1 === e3.nodes.length && "selector" === e3.nodes[0].type && e3.replaceWith(e3.nodes[0]);
|
|
@@ -1096,87 +1143,87 @@ function complexSelectors(s, o2, t2, n) {
|
|
|
1096
1143
|
}), r.toString();
|
|
1097
1144
|
}).filter((e3) => !!e3);
|
|
1098
1145
|
}
|
|
1099
|
-
function splitSelectors(o2,
|
|
1100
|
-
const r = ":not(#" +
|
|
1146
|
+
function splitSelectors(o2, n2, t = 0) {
|
|
1147
|
+
const r = ":not(#" + n2.specificityMatchingName + ")", d = ":not(." + n2.specificityMatchingName + ")", l = ":not(" + n2.specificityMatchingName + ")";
|
|
1101
1148
|
return o2.flatMap((o3) => {
|
|
1102
1149
|
if (-1 === o3.toLowerCase().indexOf(":is")) return o3;
|
|
1103
|
-
let
|
|
1104
|
-
const
|
|
1150
|
+
let i = false;
|
|
1151
|
+
const a = [];
|
|
1105
1152
|
if (_postcssselectorparser2.default.call(void 0, ).astSync(o3).walkPseudos((e3) => {
|
|
1106
1153
|
if (":is" !== e3.value.toLowerCase() || !e3.nodes || !e3.nodes.length) return;
|
|
1107
1154
|
if ("selector" === e3.nodes[0].type && 0 === e3.nodes[0].nodes.length) return;
|
|
1108
|
-
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
|
|
1155
|
+
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()})` }]);
|
|
1109
1156
|
if ("pseudo" === _optionalChain([e3, 'access', _52 => _52.parent, 'optionalAccess', _53 => _53.parent, 'optionalAccess', _54 => _54.type]) && ":has" === _optionalChain([e3, 'access', _55 => _55.parent, 'optionalAccess', _56 => _56.parent, 'optionalAccess', _57 => _57.value, 'optionalAccess', _58 => _58.toLowerCase, 'call', _59 => _59()])) return void (e3.value = ":-csstools-matches");
|
|
1110
1157
|
let o4 = e3.parent;
|
|
1111
1158
|
for (; o4; ) {
|
|
1112
|
-
if (o4.value && ":is" === o4.value.toLowerCase() && "pseudo" === o4.type) return void (
|
|
1159
|
+
if (o4.value && ":is" === o4.value.toLowerCase() && "pseudo" === o4.type) return void (i = true);
|
|
1113
1160
|
o4 = o4.parent;
|
|
1114
1161
|
}
|
|
1115
|
-
const
|
|
1162
|
+
const n3 = selectorSpecificity(e3), t2 = e3.sourceIndex, c2 = t2 + e3.toString().length, p = [];
|
|
1116
1163
|
e3.nodes.forEach((e4) => {
|
|
1117
|
-
const o5 = { start:
|
|
1118
|
-
let
|
|
1119
|
-
const u = Math.max(0,
|
|
1120
|
-
for (let e5 = 0; e5 < u; e5++)
|
|
1121
|
-
for (let e5 = 0; e5 < h; e5++)
|
|
1122
|
-
for (let e5 = 0; e5 < f; e5++)
|
|
1123
|
-
o5.option =
|
|
1124
|
-
}),
|
|
1125
|
-
}), !
|
|
1164
|
+
const o5 = { start: t2, end: c2, option: "" }, i2 = selectorSpecificity(e4);
|
|
1165
|
+
let a2 = e4.toString().trim();
|
|
1166
|
+
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);
|
|
1167
|
+
for (let e5 = 0; e5 < u; e5++) a2 += r;
|
|
1168
|
+
for (let e5 = 0; e5 < h; e5++) a2 += d;
|
|
1169
|
+
for (let e5 = 0; e5 < f; e5++) a2 += l;
|
|
1170
|
+
o5.option = a2, p.push(o5);
|
|
1171
|
+
}), a.push(p);
|
|
1172
|
+
}), !a.length) return [o3];
|
|
1126
1173
|
let c = [];
|
|
1127
|
-
return cartesianProduct(...
|
|
1174
|
+
return cartesianProduct(...a).forEach((e3) => {
|
|
1128
1175
|
let s = "";
|
|
1129
|
-
for (let
|
|
1130
|
-
const
|
|
1131
|
-
s += o3.substring(_optionalChain([e3, 'access', _60 => _60[
|
|
1176
|
+
for (let n3 = 0; n3 < e3.length; n3++) {
|
|
1177
|
+
const t2 = e3[n3];
|
|
1178
|
+
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));
|
|
1132
1179
|
}
|
|
1133
1180
|
c.push(s);
|
|
1134
|
-
}),
|
|
1181
|
+
}), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
|
|
1135
1182
|
}).filter((e3) => !!e3);
|
|
1136
1183
|
}
|
|
1137
1184
|
function cartesianProduct(...e3) {
|
|
1138
1185
|
const s = [], o2 = e3.length - 1;
|
|
1139
|
-
return function helper(
|
|
1140
|
-
for (let r = 0, d = e3[
|
|
1141
|
-
const d2 =
|
|
1142
|
-
d2.push(e3[
|
|
1186
|
+
return function helper(n2, t) {
|
|
1187
|
+
for (let r = 0, d = e3[t].length; r < d; r++) {
|
|
1188
|
+
const d2 = n2.slice(0);
|
|
1189
|
+
d2.push(e3[t][r]), t === o2 ? s.push(d2) : helper(d2, t + 1);
|
|
1143
1190
|
}
|
|
1144
1191
|
}([], 0), s;
|
|
1145
1192
|
}
|
|
1146
|
-
var
|
|
1193
|
+
var n = /:is\(/i;
|
|
1147
1194
|
var creator = (e3) => {
|
|
1148
1195
|
const s = { specificityMatchingName: "does-not-exist", ...e3 || {} };
|
|
1149
1196
|
return { postcssPlugin: "postcss-is-pseudo-class", prepare() {
|
|
1150
1197
|
const e4 = /* @__PURE__ */ new WeakSet();
|
|
1151
|
-
return { postcssPlugin: "postcss-is-pseudo-class", Rule(o2, { result:
|
|
1198
|
+
return { postcssPlugin: "postcss-is-pseudo-class", Rule(o2, { result: t }) {
|
|
1152
1199
|
if (!o2.selector) return;
|
|
1153
|
-
if (!
|
|
1200
|
+
if (!n.test(o2.selector)) return;
|
|
1154
1201
|
if (e4.has(o2)) return;
|
|
1155
1202
|
let r = false;
|
|
1156
1203
|
const warnOnComplexSelector = () => {
|
|
1157
|
-
"warning" === s.onComplexSelector && (r || (r = true, o2.warn(
|
|
1204
|
+
"warning" === s.onComplexSelector && (r || (r = true, o2.warn(t, `Complex selectors in '${o2.selector}' can not be transformed to an equivalent selector without ':is()'.`)));
|
|
1158
1205
|
};
|
|
1159
1206
|
let d = false;
|
|
1160
1207
|
const warnOnPseudoElements = () => {
|
|
1161
|
-
"warning" === s.onPseudoElement && (d || (d = true, o2.warn(
|
|
1208
|
+
"warning" === s.onPseudoElement && (d || (d = true, o2.warn(t, `Pseudo elements are not allowed in ':is()', unable to transform '${o2.selector}'`)));
|
|
1162
1209
|
};
|
|
1163
1210
|
try {
|
|
1164
|
-
let
|
|
1165
|
-
const
|
|
1211
|
+
let n2 = false;
|
|
1212
|
+
const t2 = [], r2 = complexSelectors(splitSelectors(o2.selectors, { specificityMatchingName: s.specificityMatchingName }), { onComplexSelector: s.onComplexSelector }, warnOnComplexSelector, warnOnPseudoElements);
|
|
1166
1213
|
if (Array.from(new Set(r2)).forEach((s2) => {
|
|
1167
|
-
if (o2.selectors.indexOf(s2) > -1)
|
|
1214
|
+
if (o2.selectors.indexOf(s2) > -1) t2.push(s2);
|
|
1168
1215
|
else {
|
|
1169
|
-
if (alwaysValidSelector(s2)) return
|
|
1170
|
-
e4.add(o2), o2.cloneBefore({ selector: s2 }),
|
|
1216
|
+
if (alwaysValidSelector(s2)) return t2.push(s2), void (n2 = true);
|
|
1217
|
+
e4.add(o2), o2.cloneBefore({ selector: s2 }), n2 = true;
|
|
1171
1218
|
}
|
|
1172
|
-
}),
|
|
1173
|
-
if (!
|
|
1219
|
+
}), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
|
|
1220
|
+
if (!n2) return;
|
|
1174
1221
|
o2.remove();
|
|
1175
1222
|
}
|
|
1176
1223
|
} catch (e5) {
|
|
1177
1224
|
if (!(e5 instanceof Error)) throw e5;
|
|
1178
1225
|
if (e5.message.indexOf("call stack size exceeded") > -1) throw e5;
|
|
1179
|
-
o2.warn(
|
|
1226
|
+
o2.warn(t, `Failed to parse selector "${o2.selector}" with error: ${e5.message}`);
|
|
1180
1227
|
}
|
|
1181
1228
|
} };
|
|
1182
1229
|
} };
|
package/dist/index.mjs
CHANGED
|
@@ -280,8 +280,8 @@ function getFallbackRemove(rule) {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
} else if (selector.value === ":where") {
|
|
283
|
-
for (const
|
|
284
|
-
for (const node of
|
|
283
|
+
for (const n2 of selector.nodes) {
|
|
284
|
+
for (const node of n2.nodes) {
|
|
285
285
|
if (node.type === "attribute") {
|
|
286
286
|
node.remove();
|
|
287
287
|
}
|
|
@@ -846,6 +846,10 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
846
846
|
if (/color-mix/.test(atRule.params)) {
|
|
847
847
|
atRule.remove();
|
|
848
848
|
}
|
|
849
|
+
} else if (atRule.name === "layer") {
|
|
850
|
+
if (atRule.nodes === void 0 || Array.isArray(atRule.nodes) && atRule.nodes.length === 0) {
|
|
851
|
+
atRule.remove();
|
|
852
|
+
}
|
|
849
853
|
}
|
|
850
854
|
}
|
|
851
855
|
};
|
|
@@ -853,16 +857,20 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
853
857
|
let layerProperties;
|
|
854
858
|
p.Once = (root) => {
|
|
855
859
|
root.walkAtRules((atRule) => {
|
|
856
|
-
if (atRule.name === "layer"
|
|
857
|
-
if (atRule.
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
if (
|
|
861
|
-
layerProperties
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
860
|
+
if (atRule.name === "layer") {
|
|
861
|
+
if (atRule.params === "properties") {
|
|
862
|
+
if (atRule.nodes === void 0 || atRule.nodes?.length === 0) {
|
|
863
|
+
layerProperties = atRule;
|
|
864
|
+
} else if (atRule.first?.type === "atrule" && isTailwindcssV4ModernCheck(atRule.first)) {
|
|
865
|
+
if (layerProperties) {
|
|
866
|
+
layerProperties.replaceWith(atRule.first.nodes);
|
|
867
|
+
atRule.remove();
|
|
868
|
+
} else {
|
|
869
|
+
atRule.replaceWith(atRule.first.nodes);
|
|
870
|
+
}
|
|
865
871
|
}
|
|
872
|
+
} else {
|
|
873
|
+
atRule.replaceWith(atRule.nodes);
|
|
866
874
|
}
|
|
867
875
|
} else if (isTailwindcssV4ModernCheck(atRule)) {
|
|
868
876
|
if (atRule.first?.type === "atrule" && atRule.first.name === "layer") {
|
|
@@ -879,118 +887,118 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
|
|
|
879
887
|
};
|
|
880
888
|
postcssWeappTailwindcssPrePlugin.postcss = true;
|
|
881
889
|
|
|
882
|
-
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.
|
|
890
|
+
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.3_postcss@8.5.6/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
|
|
883
891
|
import e2 from "postcss-selector-parser";
|
|
884
892
|
|
|
885
893
|
// ../../node_modules/.pnpm/@csstools+selector-specificity@5.0.0_postcss-selector-parser@7.1.0/node_modules/@csstools/selector-specificity/dist/index.mjs
|
|
886
894
|
import e from "postcss-selector-parser";
|
|
887
|
-
function compare(e3,
|
|
888
|
-
return e3.a ===
|
|
895
|
+
function compare(e3, t) {
|
|
896
|
+
return e3.a === t.a ? e3.b === t.b ? e3.c - t.c : e3.b - t.b : e3.a - t.a;
|
|
889
897
|
}
|
|
890
|
-
function selectorSpecificity(
|
|
891
|
-
const i = s?.customSpecificity?.(
|
|
898
|
+
function selectorSpecificity(t, s) {
|
|
899
|
+
const i = s?.customSpecificity?.(t);
|
|
892
900
|
if (i) return i;
|
|
893
|
-
if (!
|
|
894
|
-
let c = 0,
|
|
895
|
-
if ("universal" ==
|
|
896
|
-
if ("id" ===
|
|
897
|
-
else if ("tag" ===
|
|
898
|
-
else if ("class" ===
|
|
899
|
-
else if ("attribute" ===
|
|
900
|
-
else if (isPseudoElement(
|
|
901
|
+
if (!t) return { a: 0, b: 0, c: 0 };
|
|
902
|
+
let c = 0, n2 = 0, o2 = 0;
|
|
903
|
+
if ("universal" == t.type) return { a: 0, b: 0, c: 0 };
|
|
904
|
+
if ("id" === t.type) c += 1;
|
|
905
|
+
else if ("tag" === t.type) o2 += 1;
|
|
906
|
+
else if ("class" === t.type) n2 += 1;
|
|
907
|
+
else if ("attribute" === t.type) n2 += 1;
|
|
908
|
+
else if (isPseudoElement(t)) switch (t.value.toLowerCase()) {
|
|
901
909
|
case "::slotted":
|
|
902
|
-
if (o2 += 1,
|
|
903
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
904
|
-
c += e3.a,
|
|
910
|
+
if (o2 += 1, t.nodes && t.nodes.length > 0) {
|
|
911
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
912
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
905
913
|
}
|
|
906
914
|
break;
|
|
907
915
|
case "::view-transition-group":
|
|
908
916
|
case "::view-transition-image-pair":
|
|
909
917
|
case "::view-transition-old":
|
|
910
918
|
case "::view-transition-new":
|
|
911
|
-
return
|
|
919
|
+
return t.nodes && 1 === t.nodes.length && "selector" === t.nodes[0].type && selectorNodeContainsNothingOrOnlyUniversal(t.nodes[0]) ? { a: 0, b: 0, c: 0 } : { a: 0, b: 0, c: 1 };
|
|
912
920
|
default:
|
|
913
921
|
o2 += 1;
|
|
914
922
|
}
|
|
915
|
-
else if (e.isPseudoClass(
|
|
923
|
+
else if (e.isPseudoClass(t)) switch (t.value.toLowerCase()) {
|
|
916
924
|
case ":-webkit-any":
|
|
917
925
|
case ":any":
|
|
918
926
|
default:
|
|
919
|
-
|
|
927
|
+
n2 += 1;
|
|
920
928
|
break;
|
|
921
929
|
case ":-moz-any":
|
|
922
930
|
case ":has":
|
|
923
931
|
case ":is":
|
|
924
932
|
case ":matches":
|
|
925
933
|
case ":not":
|
|
926
|
-
if (
|
|
927
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
928
|
-
c += e3.a,
|
|
934
|
+
if (t.nodes && t.nodes.length > 0) {
|
|
935
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
936
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
929
937
|
}
|
|
930
938
|
break;
|
|
931
939
|
case ":where":
|
|
932
940
|
break;
|
|
933
941
|
case ":nth-child":
|
|
934
942
|
case ":nth-last-child":
|
|
935
|
-
if (
|
|
936
|
-
const i2 =
|
|
943
|
+
if (n2 += 1, t.nodes && t.nodes.length > 0) {
|
|
944
|
+
const i2 = t.nodes[0].nodes.findIndex((e3) => "tag" === e3.type && "of" === e3.value.toLowerCase());
|
|
937
945
|
if (i2 > -1) {
|
|
938
946
|
const a = e.selector({ nodes: [], value: "" });
|
|
939
|
-
|
|
947
|
+
t.nodes[0].nodes.slice(i2 + 1).forEach((e3) => {
|
|
940
948
|
a.append(e3.clone());
|
|
941
949
|
});
|
|
942
950
|
const r = [a];
|
|
943
|
-
|
|
951
|
+
t.nodes.length > 1 && r.push(...t.nodes.slice(1));
|
|
944
952
|
const l = specificityOfMostSpecificListItem(r, s);
|
|
945
|
-
c += l.a,
|
|
953
|
+
c += l.a, n2 += l.b, o2 += l.c;
|
|
946
954
|
}
|
|
947
955
|
}
|
|
948
956
|
break;
|
|
949
957
|
case ":local":
|
|
950
958
|
case ":global":
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
c +=
|
|
959
|
+
t.nodes && t.nodes.length > 0 && t.nodes.forEach((e3) => {
|
|
960
|
+
const t2 = selectorSpecificity(e3, s);
|
|
961
|
+
c += t2.a, n2 += t2.b, o2 += t2.c;
|
|
954
962
|
});
|
|
955
963
|
break;
|
|
956
964
|
case ":host":
|
|
957
965
|
case ":host-context":
|
|
958
|
-
if (
|
|
959
|
-
const e3 = specificityOfMostSpecificListItem(
|
|
960
|
-
c += e3.a,
|
|
966
|
+
if (n2 += 1, t.nodes && t.nodes.length > 0) {
|
|
967
|
+
const e3 = specificityOfMostSpecificListItem(t.nodes, s);
|
|
968
|
+
c += e3.a, n2 += e3.b, o2 += e3.c;
|
|
961
969
|
}
|
|
962
970
|
break;
|
|
963
971
|
case ":active-view-transition":
|
|
964
972
|
case ":active-view-transition-type":
|
|
965
973
|
return { a: 0, b: 1, c: 0 };
|
|
966
974
|
}
|
|
967
|
-
else e.isContainer(
|
|
968
|
-
const
|
|
969
|
-
c +=
|
|
975
|
+
else e.isContainer(t) && t.nodes?.length > 0 && t.nodes.forEach((e3) => {
|
|
976
|
+
const t2 = selectorSpecificity(e3, s);
|
|
977
|
+
c += t2.a, n2 += t2.b, o2 += t2.c;
|
|
970
978
|
});
|
|
971
|
-
return { a: c, b:
|
|
979
|
+
return { a: c, b: n2, c: o2 };
|
|
972
980
|
}
|
|
973
|
-
function specificityOfMostSpecificListItem(e3,
|
|
981
|
+
function specificityOfMostSpecificListItem(e3, t) {
|
|
974
982
|
let s = { a: 0, b: 0, c: 0 };
|
|
975
983
|
return e3.forEach((e4) => {
|
|
976
|
-
const i = selectorSpecificity(e4,
|
|
984
|
+
const i = selectorSpecificity(e4, t);
|
|
977
985
|
compare(i, s) < 0 || (s = i);
|
|
978
986
|
}), s;
|
|
979
987
|
}
|
|
980
|
-
function isPseudoElement(
|
|
981
|
-
return e.isPseudoElement(
|
|
988
|
+
function isPseudoElement(t) {
|
|
989
|
+
return e.isPseudoElement(t);
|
|
982
990
|
}
|
|
983
991
|
function selectorNodeContainsNothingOrOnlyUniversal(e3) {
|
|
984
992
|
if (!e3) return false;
|
|
985
993
|
if (!e3.nodes) return false;
|
|
986
|
-
const
|
|
987
|
-
return 0 ===
|
|
994
|
+
const t = e3.nodes.filter((e4) => "comment" !== e4.type);
|
|
995
|
+
return 0 === t.length || 1 === t.length && "universal" === t[0].type;
|
|
988
996
|
}
|
|
989
997
|
|
|
990
|
-
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.
|
|
998
|
+
// ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@5.0.3_postcss@8.5.6/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
|
|
991
999
|
function alwaysValidSelector(s) {
|
|
992
1000
|
const o2 = e2().astSync(s);
|
|
993
|
-
let
|
|
1001
|
+
let n2 = true;
|
|
994
1002
|
return o2.walk((e3) => {
|
|
995
1003
|
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())) {
|
|
996
1004
|
if ("pseudo" === e3.type && 1 === e3.nodes?.length && ":not" === e3.value.toLowerCase()) {
|
|
@@ -999,34 +1007,34 @@ function alwaysValidSelector(s) {
|
|
|
999
1007
|
s2 = false;
|
|
1000
1008
|
}), s2) return;
|
|
1001
1009
|
}
|
|
1002
|
-
return
|
|
1010
|
+
return n2 = false, false;
|
|
1003
1011
|
}
|
|
1004
|
-
}),
|
|
1012
|
+
}), n2;
|
|
1005
1013
|
}
|
|
1006
1014
|
function sortCompoundSelectorsInsideComplexSelector(s) {
|
|
1007
1015
|
if (!s || !s.nodes || 1 === s.nodes.length) return;
|
|
1008
1016
|
const o2 = [];
|
|
1009
|
-
let
|
|
1010
|
-
for (let
|
|
1011
|
-
o2.push(
|
|
1012
|
-
const
|
|
1017
|
+
let n2 = [];
|
|
1018
|
+
for (let t2 = 0; t2 < s.nodes.length; t2++) "combinator" !== s.nodes[t2].type ? e2.isPseudoElement(s.nodes[t2]) ? (o2.push(n2), n2 = [s.nodes[t2]]) : n2.push(s.nodes[t2]) : (o2.push(n2), o2.push([s.nodes[t2]]), n2 = []);
|
|
1019
|
+
o2.push(n2);
|
|
1020
|
+
const t = [];
|
|
1013
1021
|
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1014
1022
|
const s2 = o2[e3];
|
|
1015
1023
|
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));
|
|
1016
|
-
const
|
|
1017
|
-
for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() :
|
|
1024
|
+
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"));
|
|
1025
|
+
for (let e4 = 0; e4 < s2.length; e4++) "universal" === s2[e4].type && r ? s2[e4].remove() : t.push(s2[e4]);
|
|
1018
1026
|
}
|
|
1019
1027
|
s.removeAll();
|
|
1020
|
-
for (let o3 =
|
|
1021
|
-
const
|
|
1022
|
-
if (
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
} else
|
|
1028
|
+
for (let o3 = t.length - 1; o3 >= 0; o3--) {
|
|
1029
|
+
const n3 = t[o3 - 1];
|
|
1030
|
+
if (t[o3].remove(), n3 && "tag" === n3.type && "tag" === t[o3].type) {
|
|
1031
|
+
const n4 = e2.pseudo({ value: ":is", nodes: [e2.selector({ value: "", nodes: [t[o3]] })] });
|
|
1032
|
+
n4.parent = s, s.nodes.unshift(n4);
|
|
1033
|
+
} else t[o3].parent = s, s.nodes.unshift(t[o3]);
|
|
1026
1034
|
}
|
|
1027
1035
|
}
|
|
1028
|
-
function selectorTypeOrder(s,
|
|
1029
|
-
return e2.isPseudoElement(s) ? o.pseudoElement : o[
|
|
1036
|
+
function selectorTypeOrder(s, n2) {
|
|
1037
|
+
return e2.isPseudoElement(s) ? o.pseudoElement : o[n2];
|
|
1030
1038
|
}
|
|
1031
1039
|
var o = { universal: 0, tag: 1, pseudoElement: 2, id: 3, class: 4, attribute: 5, pseudo: 6, selector: 7, string: 8, root: 9, comment: 10 };
|
|
1032
1040
|
function childAdjacentChild(e3) {
|
|
@@ -1036,40 +1044,79 @@ function isInCompoundWithOneOtherElement(s) {
|
|
|
1036
1044
|
if (!s || !s.nodes) return false;
|
|
1037
1045
|
if (!e2.isSelector(s)) return false;
|
|
1038
1046
|
if (2 !== s.nodes.length) return false;
|
|
1039
|
-
let o2 = -1,
|
|
1040
|
-
s.nodes[0] && e2.isPseudoClass(s.nodes[0]) && ":-csstools-matches" === s.nodes[0].value ? (o2 = 0,
|
|
1041
|
-
const
|
|
1042
|
-
if (!
|
|
1043
|
-
const r = s.nodes[
|
|
1044
|
-
return !!r && (!e2.isCombinator(r) && (
|
|
1047
|
+
let o2 = -1, n2 = -1;
|
|
1048
|
+
s.nodes[0] && e2.isPseudoClass(s.nodes[0]) && ":-csstools-matches" === s.nodes[0].value ? (o2 = 0, n2 = 1) : s.nodes[1] && e2.isPseudoClass(s.nodes[1]) && ":-csstools-matches" === s.nodes[1].value && (o2 = 1, n2 = 0);
|
|
1049
|
+
const t = s.nodes[o2];
|
|
1050
|
+
if (!t || !e2.isPseudoClass(t) || 1 !== t.nodes.length) return false;
|
|
1051
|
+
const r = s.nodes[n2];
|
|
1052
|
+
return !!r && (!e2.isCombinator(r) && (!e2.isPseudoElement(r) && (t.nodes[0].append(r.clone()), t.replaceWith(...t.nodes[0].nodes), r.remove(), true)));
|
|
1045
1053
|
}
|
|
1046
1054
|
function isPseudoInFirstCompound(s) {
|
|
1047
1055
|
if (!s || !s.nodes) return false;
|
|
1048
1056
|
if (!e2.isSelector(s)) return false;
|
|
1049
1057
|
let o2 = -1;
|
|
1050
|
-
for (let
|
|
1051
|
-
const
|
|
1052
|
-
if (e2.isCombinator(
|
|
1053
|
-
if (e2.
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1058
|
+
for (let n3 = 0; n3 < s.nodes.length; n3++) {
|
|
1059
|
+
const t2 = s.nodes[n3];
|
|
1060
|
+
if (e2.isCombinator(t2)) return false;
|
|
1061
|
+
if (e2.isPseudoElement(t2)) return false;
|
|
1062
|
+
if (e2.isPseudoClass(t2)) {
|
|
1063
|
+
const e3 = t2;
|
|
1064
|
+
if (":-csstools-matches" === e3.value) {
|
|
1065
|
+
if (!e3.nodes || 1 !== e3.nodes.length) return false;
|
|
1066
|
+
o2 = n3;
|
|
1067
|
+
break;
|
|
1068
|
+
}
|
|
1057
1069
|
}
|
|
1058
1070
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1071
|
+
if (-1 === o2) return false;
|
|
1072
|
+
const n2 = s.nodes[o2];
|
|
1073
|
+
if (!n2 || !e2.isPseudoClass(n2)) return false;
|
|
1074
|
+
const t = s.nodes.slice(0, o2), r = s.nodes.slice(o2 + 1);
|
|
1075
|
+
return t.forEach((e3) => {
|
|
1076
|
+
n2.nodes[0].append(e3.clone());
|
|
1064
1077
|
}), r.forEach((e3) => {
|
|
1065
|
-
|
|
1066
|
-
}),
|
|
1078
|
+
n2.nodes[0].append(e3.clone());
|
|
1079
|
+
}), n2.replaceWith(...n2.nodes), t.forEach((e3) => {
|
|
1067
1080
|
e3.remove();
|
|
1068
1081
|
}), r.forEach((e3) => {
|
|
1069
1082
|
e3.remove();
|
|
1070
1083
|
}), true;
|
|
1071
1084
|
}
|
|
1072
|
-
function
|
|
1085
|
+
function samePrecedingElement(s) {
|
|
1086
|
+
if (!s || !s.nodes) return false;
|
|
1087
|
+
if ("selector" !== s.type) return false;
|
|
1088
|
+
let o2 = -1;
|
|
1089
|
+
for (let n3 = 0; n3 < s.nodes.length; n3++) {
|
|
1090
|
+
const t2 = s.nodes[n3];
|
|
1091
|
+
if (e2.isCombinator(t2)) {
|
|
1092
|
+
o2 = n3;
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
if (e2.isPseudoElement(t2)) return false;
|
|
1096
|
+
}
|
|
1097
|
+
if (-1 === o2) return false;
|
|
1098
|
+
const n2 = o2 + 1;
|
|
1099
|
+
if (!s.nodes[o2] || "combinator" !== s.nodes[o2].type || ">" !== s.nodes[o2].value && "+" !== s.nodes[o2].value) return false;
|
|
1100
|
+
const t = s.nodes[o2].value;
|
|
1101
|
+
if (!s.nodes[n2] || "pseudo" !== s.nodes[n2].type || ":-csstools-matches" !== s.nodes[n2].value) return false;
|
|
1102
|
+
if (!s.nodes[n2].nodes || 1 !== s.nodes[n2].nodes.length) return false;
|
|
1103
|
+
if ("selector" !== s.nodes[n2].nodes[0].type) return false;
|
|
1104
|
+
if (!s.nodes[n2].nodes[0].nodes || 3 !== s.nodes[n2].nodes[0].nodes.length) return false;
|
|
1105
|
+
if (!s.nodes[n2].nodes[0].nodes || "combinator" !== s.nodes[n2].nodes[0].nodes[1].type || s.nodes[n2].nodes[0].nodes[1].value !== t) return false;
|
|
1106
|
+
const r = s.nodes[n2];
|
|
1107
|
+
if (!r || !e2.isPseudoClass(r)) return false;
|
|
1108
|
+
const d = s.nodes.slice(0, o2), l = s.nodes.slice(n2 + 1);
|
|
1109
|
+
return s.each((e3) => {
|
|
1110
|
+
e3.remove();
|
|
1111
|
+
}), d.forEach((e3) => {
|
|
1112
|
+
s.append(e3);
|
|
1113
|
+
}), r.nodes[0].nodes.forEach((e3) => {
|
|
1114
|
+
s.append(e3);
|
|
1115
|
+
}), l.forEach((e3) => {
|
|
1116
|
+
s.append(e3);
|
|
1117
|
+
}), true;
|
|
1118
|
+
}
|
|
1119
|
+
function complexSelectors(s, o2, n2, t) {
|
|
1073
1120
|
return s.flatMap((s2) => {
|
|
1074
1121
|
if (-1 === s2.indexOf(":-csstools-matches") && -1 === s2.toLowerCase().indexOf(":is")) return s2;
|
|
1075
1122
|
const r = e2().astSync(s2);
|
|
@@ -1081,13 +1128,13 @@ function complexSelectors(s, o2, t2, n) {
|
|
|
1081
1128
|
let e3 = s4.value;
|
|
1082
1129
|
if (e3.startsWith("::-csstools-invalid-")) return;
|
|
1083
1130
|
for (; e3.startsWith(":"); ) e3 = e3.slice(1);
|
|
1084
|
-
s4.value = `::-csstools-invalid-${e3}`,
|
|
1131
|
+
s4.value = `::-csstools-invalid-${e3}`, t();
|
|
1085
1132
|
}
|
|
1086
1133
|
}), 1 === s3.nodes.length && "selector" === s3.nodes[0].type) {
|
|
1087
1134
|
if (1 === s3.nodes[0].nodes.length) return void s3.replaceWith(s3.nodes[0].nodes[0]);
|
|
1088
1135
|
if (!s3.nodes[0].some((e3) => "combinator" === e3.type)) return void s3.replaceWith(...s3.nodes[0].nodes);
|
|
1089
1136
|
}
|
|
1090
|
-
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) || ("warning" === o2.onComplexSelector &&
|
|
1137
|
+
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);
|
|
1091
1138
|
} else s3.remove();
|
|
1092
1139
|
}), r.walk((e3) => {
|
|
1093
1140
|
"selector" === e3.type && "nodes" in e3 && 1 === e3.nodes.length && "selector" === e3.nodes[0].type && e3.replaceWith(e3.nodes[0]);
|
|
@@ -1096,87 +1143,87 @@ function complexSelectors(s, o2, t2, n) {
|
|
|
1096
1143
|
}), r.toString();
|
|
1097
1144
|
}).filter((e3) => !!e3);
|
|
1098
1145
|
}
|
|
1099
|
-
function splitSelectors(o2,
|
|
1100
|
-
const r = ":not(#" +
|
|
1146
|
+
function splitSelectors(o2, n2, t = 0) {
|
|
1147
|
+
const r = ":not(#" + n2.specificityMatchingName + ")", d = ":not(." + n2.specificityMatchingName + ")", l = ":not(" + n2.specificityMatchingName + ")";
|
|
1101
1148
|
return o2.flatMap((o3) => {
|
|
1102
1149
|
if (-1 === o3.toLowerCase().indexOf(":is")) return o3;
|
|
1103
|
-
let
|
|
1104
|
-
const
|
|
1150
|
+
let i = false;
|
|
1151
|
+
const a = [];
|
|
1105
1152
|
if (e2().astSync(o3).walkPseudos((e3) => {
|
|
1106
1153
|
if (":is" !== e3.value.toLowerCase() || !e3.nodes || !e3.nodes.length) return;
|
|
1107
1154
|
if ("selector" === e3.nodes[0].type && 0 === e3.nodes[0].nodes.length) return;
|
|
1108
|
-
if ("pseudo" === e3.parent?.parent?.type && ":not" === e3.parent?.parent?.value?.toLowerCase()) return void
|
|
1155
|
+
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()})` }]);
|
|
1109
1156
|
if ("pseudo" === e3.parent?.parent?.type && ":has" === e3.parent?.parent?.value?.toLowerCase()) return void (e3.value = ":-csstools-matches");
|
|
1110
1157
|
let o4 = e3.parent;
|
|
1111
1158
|
for (; o4; ) {
|
|
1112
|
-
if (o4.value && ":is" === o4.value.toLowerCase() && "pseudo" === o4.type) return void (
|
|
1159
|
+
if (o4.value && ":is" === o4.value.toLowerCase() && "pseudo" === o4.type) return void (i = true);
|
|
1113
1160
|
o4 = o4.parent;
|
|
1114
1161
|
}
|
|
1115
|
-
const
|
|
1162
|
+
const n3 = selectorSpecificity(e3), t2 = e3.sourceIndex, c2 = t2 + e3.toString().length, p = [];
|
|
1116
1163
|
e3.nodes.forEach((e4) => {
|
|
1117
|
-
const o5 = { start:
|
|
1118
|
-
let
|
|
1119
|
-
const u = Math.max(0,
|
|
1120
|
-
for (let e5 = 0; e5 < u; e5++)
|
|
1121
|
-
for (let e5 = 0; e5 < h; e5++)
|
|
1122
|
-
for (let e5 = 0; e5 < f; e5++)
|
|
1123
|
-
o5.option =
|
|
1124
|
-
}),
|
|
1125
|
-
}), !
|
|
1164
|
+
const o5 = { start: t2, end: c2, option: "" }, i2 = selectorSpecificity(e4);
|
|
1165
|
+
let a2 = e4.toString().trim();
|
|
1166
|
+
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);
|
|
1167
|
+
for (let e5 = 0; e5 < u; e5++) a2 += r;
|
|
1168
|
+
for (let e5 = 0; e5 < h; e5++) a2 += d;
|
|
1169
|
+
for (let e5 = 0; e5 < f; e5++) a2 += l;
|
|
1170
|
+
o5.option = a2, p.push(o5);
|
|
1171
|
+
}), a.push(p);
|
|
1172
|
+
}), !a.length) return [o3];
|
|
1126
1173
|
let c = [];
|
|
1127
|
-
return cartesianProduct(...
|
|
1174
|
+
return cartesianProduct(...a).forEach((e3) => {
|
|
1128
1175
|
let s = "";
|
|
1129
|
-
for (let
|
|
1130
|
-
const
|
|
1131
|
-
s += o3.substring(e3[
|
|
1176
|
+
for (let n3 = 0; n3 < e3.length; n3++) {
|
|
1177
|
+
const t2 = e3[n3];
|
|
1178
|
+
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));
|
|
1132
1179
|
}
|
|
1133
1180
|
c.push(s);
|
|
1134
|
-
}),
|
|
1181
|
+
}), i && t < 10 && (c = splitSelectors(c, n2, t + 1)), c;
|
|
1135
1182
|
}).filter((e3) => !!e3);
|
|
1136
1183
|
}
|
|
1137
1184
|
function cartesianProduct(...e3) {
|
|
1138
1185
|
const s = [], o2 = e3.length - 1;
|
|
1139
|
-
return function helper(
|
|
1140
|
-
for (let r = 0, d = e3[
|
|
1141
|
-
const d2 =
|
|
1142
|
-
d2.push(e3[
|
|
1186
|
+
return function helper(n2, t) {
|
|
1187
|
+
for (let r = 0, d = e3[t].length; r < d; r++) {
|
|
1188
|
+
const d2 = n2.slice(0);
|
|
1189
|
+
d2.push(e3[t][r]), t === o2 ? s.push(d2) : helper(d2, t + 1);
|
|
1143
1190
|
}
|
|
1144
1191
|
}([], 0), s;
|
|
1145
1192
|
}
|
|
1146
|
-
var
|
|
1193
|
+
var n = /:is\(/i;
|
|
1147
1194
|
var creator = (e3) => {
|
|
1148
1195
|
const s = { specificityMatchingName: "does-not-exist", ...e3 || {} };
|
|
1149
1196
|
return { postcssPlugin: "postcss-is-pseudo-class", prepare() {
|
|
1150
1197
|
const e4 = /* @__PURE__ */ new WeakSet();
|
|
1151
|
-
return { postcssPlugin: "postcss-is-pseudo-class", Rule(o2, { result:
|
|
1198
|
+
return { postcssPlugin: "postcss-is-pseudo-class", Rule(o2, { result: t }) {
|
|
1152
1199
|
if (!o2.selector) return;
|
|
1153
|
-
if (!
|
|
1200
|
+
if (!n.test(o2.selector)) return;
|
|
1154
1201
|
if (e4.has(o2)) return;
|
|
1155
1202
|
let r = false;
|
|
1156
1203
|
const warnOnComplexSelector = () => {
|
|
1157
|
-
"warning" === s.onComplexSelector && (r || (r = true, o2.warn(
|
|
1204
|
+
"warning" === s.onComplexSelector && (r || (r = true, o2.warn(t, `Complex selectors in '${o2.selector}' can not be transformed to an equivalent selector without ':is()'.`)));
|
|
1158
1205
|
};
|
|
1159
1206
|
let d = false;
|
|
1160
1207
|
const warnOnPseudoElements = () => {
|
|
1161
|
-
"warning" === s.onPseudoElement && (d || (d = true, o2.warn(
|
|
1208
|
+
"warning" === s.onPseudoElement && (d || (d = true, o2.warn(t, `Pseudo elements are not allowed in ':is()', unable to transform '${o2.selector}'`)));
|
|
1162
1209
|
};
|
|
1163
1210
|
try {
|
|
1164
|
-
let
|
|
1165
|
-
const
|
|
1211
|
+
let n2 = false;
|
|
1212
|
+
const t2 = [], r2 = complexSelectors(splitSelectors(o2.selectors, { specificityMatchingName: s.specificityMatchingName }), { onComplexSelector: s.onComplexSelector }, warnOnComplexSelector, warnOnPseudoElements);
|
|
1166
1213
|
if (Array.from(new Set(r2)).forEach((s2) => {
|
|
1167
|
-
if (o2.selectors.indexOf(s2) > -1)
|
|
1214
|
+
if (o2.selectors.indexOf(s2) > -1) t2.push(s2);
|
|
1168
1215
|
else {
|
|
1169
|
-
if (alwaysValidSelector(s2)) return
|
|
1170
|
-
e4.add(o2), o2.cloneBefore({ selector: s2 }),
|
|
1216
|
+
if (alwaysValidSelector(s2)) return t2.push(s2), void (n2 = true);
|
|
1217
|
+
e4.add(o2), o2.cloneBefore({ selector: s2 }), n2 = true;
|
|
1171
1218
|
}
|
|
1172
|
-
}),
|
|
1173
|
-
if (!
|
|
1219
|
+
}), t2.length && n2 && (e4.add(o2), o2.cloneBefore({ selectors: t2 })), !s.preserve) {
|
|
1220
|
+
if (!n2) return;
|
|
1174
1221
|
o2.remove();
|
|
1175
1222
|
}
|
|
1176
1223
|
} catch (e5) {
|
|
1177
1224
|
if (!(e5 instanceof Error)) throw e5;
|
|
1178
1225
|
if (e5.message.indexOf("call stack size exceeded") > -1) throw e5;
|
|
1179
|
-
o2.warn(
|
|
1226
|
+
o2.warn(t, `Failed to parse selector "${o2.selector}" with error: ${e5.message}`);
|
|
1180
1227
|
}
|
|
1181
1228
|
} };
|
|
1182
1229
|
} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/postcss",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "@weapp-tailwindcss/postcss",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@weapp-core/escape": "~4.0.1",
|
|
43
|
-
"postcss": "~8.5.
|
|
44
|
-
"postcss-preset-env": "^10.2.
|
|
43
|
+
"postcss": "~8.5.6",
|
|
44
|
+
"postcss-preset-env": "^10.2.3",
|
|
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.2"
|