@weapp-tailwindcss/postcss 3.0.4 → 3.0.5
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type postcss from 'postcss';
|
|
2
2
|
export declare function removeSpecificityPlaceholders(root: postcss.Root): void;
|
|
3
|
+
export declare function removeEmptyAtRules(root: postcss.Root): void;
|
|
3
4
|
export declare function removeUnsupportedBrowserSelectors(root: postcss.Root): void;
|
|
4
5
|
export declare function removeDisplayP3Declarations(root: postcss.Root): void;
|
|
5
6
|
interface RemoveTailwindContainerRulesOptions {
|
package/dist/index.js
CHANGED
|
@@ -7625,6 +7625,11 @@ function removeSpecificityPlaceholders(root) {
|
|
|
7625
7625
|
function isEffectivelyEmptyContainer(container) {
|
|
7626
7626
|
return !container.nodes || container.nodes.every((node) => node.type === "comment");
|
|
7627
7627
|
}
|
|
7628
|
+
function removeEmptyAtRules(root) {
|
|
7629
|
+
root.walkAtRules((atRule) => {
|
|
7630
|
+
if (isEffectivelyEmptyContainer(atRule)) atRule.remove();
|
|
7631
|
+
});
|
|
7632
|
+
}
|
|
7628
7633
|
function removeEmptyAtRuleAncestors(parent) {
|
|
7629
7634
|
while (parent?.type === "atrule" && isEffectivelyEmptyContainer(parent)) {
|
|
7630
7635
|
const nextParent = parent.parent;
|
|
@@ -7772,6 +7777,7 @@ function finalizeMiniProgramCssRoot(root, options = {}) {
|
|
|
7772
7777
|
}));
|
|
7773
7778
|
const themeRule = collectThemeVariableRule(root, options);
|
|
7774
7779
|
insertHoistedRules(root, mergeEquivalentHoistedRules(themeRule ? [...preflightRules, themeRule] : preflightRules), hoistAnchor);
|
|
7780
|
+
removeEmptyAtRules(root);
|
|
7775
7781
|
}
|
|
7776
7782
|
function hoistTailwindPreflightBase(css) {
|
|
7777
7783
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -7636,6 +7636,11 @@ function removeSpecificityPlaceholders(root) {
|
|
|
7636
7636
|
function isEffectivelyEmptyContainer(container) {
|
|
7637
7637
|
return !container.nodes || container.nodes.every((node) => node.type === "comment");
|
|
7638
7638
|
}
|
|
7639
|
+
function removeEmptyAtRules(root) {
|
|
7640
|
+
root.walkAtRules((atRule) => {
|
|
7641
|
+
if (isEffectivelyEmptyContainer(atRule)) atRule.remove();
|
|
7642
|
+
});
|
|
7643
|
+
}
|
|
7639
7644
|
function removeEmptyAtRuleAncestors(parent) {
|
|
7640
7645
|
while (parent?.type === "atrule" && isEffectivelyEmptyContainer(parent)) {
|
|
7641
7646
|
const nextParent = parent.parent;
|
|
@@ -7783,6 +7788,7 @@ function finalizeMiniProgramCssRoot(root, options = {}) {
|
|
|
7783
7788
|
}));
|
|
7784
7789
|
const themeRule = collectThemeVariableRule(root, options);
|
|
7785
7790
|
insertHoistedRules(root, mergeEquivalentHoistedRules(themeRule ? [...preflightRules, themeRule] : preflightRules), hoistAnchor);
|
|
7791
|
+
removeEmptyAtRules(root);
|
|
7786
7792
|
}
|
|
7787
7793
|
function hoistTailwindPreflightBase(css) {
|
|
7788
7794
|
try {
|