@unocss/postcss 0.55.4 → 0.55.6

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.cjs CHANGED
@@ -39,6 +39,7 @@ async function parseApply(root, uno, directiveName) {
39
39
  }, []);
40
40
  if (!utils.length)
41
41
  return;
42
+ const parentAfterNodes = [];
42
43
  for (const i of utils) {
43
44
  const [, _selector, body, parent] = i;
44
45
  const selector = _selector?.replace(core.regexScopePlaceholder, " ") || _selector;
@@ -69,7 +70,7 @@ async function parseApply(root, uno, directiveName) {
69
70
  css_parsed.walkDecls((declaration) => {
70
71
  declaration.source = source;
71
72
  });
72
- rule.parent.after(css_parsed);
73
+ parentAfterNodes.push(css_parsed);
73
74
  } else {
74
75
  const css = postcss__default.parse(body);
75
76
  css.walkDecls((declaration) => {
@@ -78,6 +79,7 @@ async function parseApply(root, uno, directiveName) {
78
79
  rule.parent.append(css);
79
80
  }
80
81
  }
82
+ rule.parent.after(parentAfterNodes);
81
83
  rule.remove();
82
84
  });
83
85
  }
package/dist/index.mjs CHANGED
@@ -30,6 +30,7 @@ async function parseApply(root, uno, directiveName) {
30
30
  }, []);
31
31
  if (!utils.length)
32
32
  return;
33
+ const parentAfterNodes = [];
33
34
  for (const i of utils) {
34
35
  const [, _selector, body, parent] = i;
35
36
  const selector = _selector?.replace(regexScopePlaceholder, " ") || _selector;
@@ -60,7 +61,7 @@ async function parseApply(root, uno, directiveName) {
60
61
  css_parsed.walkDecls((declaration) => {
61
62
  declaration.source = source;
62
63
  });
63
- rule.parent.after(css_parsed);
64
+ parentAfterNodes.push(css_parsed);
64
65
  } else {
65
66
  const css = postcss.parse(body);
66
67
  css.walkDecls((declaration) => {
@@ -69,6 +70,7 @@ async function parseApply(root, uno, directiveName) {
69
70
  rule.parent.append(css);
70
71
  }
71
72
  }
73
+ rule.parent.after(parentAfterNodes);
72
74
  rule.remove();
73
75
  });
74
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/postcss",
3
- "version": "0.55.4",
3
+ "version": "0.55.6",
4
4
  "description": "PostCSS plugin for UnoCSS",
5
5
  "author": "sibbng <sibbngheid@gmail.com>",
6
6
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  "fast-glob": "^3.3.1",
41
41
  "magic-string": "^0.30.3",
42
42
  "postcss": "^8.4.28",
43
- "@unocss/config": "0.55.4",
44
- "@unocss/core": "0.55.4"
43
+ "@unocss/config": "0.55.6",
44
+ "@unocss/core": "0.55.6"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "unbuild",