@pikacss/plugin-icons 0.0.8 → 0.0.10

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
@@ -82,9 +82,16 @@ function createIconsPlugin(lookupIconLoader) {
82
82
  ];
83
83
  let iconLoader;
84
84
  config.preflights ||= [];
85
- config.preflights.push(() => {
86
- const iconVariables = [...registeredIconVariables.entries()].map(([name, value]) => `${name}: ${value};`).join("\n");
87
- return `:root { ${iconVariables} }`;
85
+ config.preflights.push((_, isFormatted) => {
86
+ return core.renderCSSStyleBlocks(
87
+ /* @__PURE__ */ new Map([[
88
+ ":root",
89
+ {
90
+ properties: [...registeredIconVariables.entries()].map(([name, value]) => ({ property: name, value }))
91
+ }
92
+ ]]),
93
+ isFormatted
94
+ );
88
95
  });
89
96
  config.shortcuts ||= [];
90
97
  config.shortcuts.push({
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { encodeSvgForCss, loadIcon } from '@iconify/utils';
2
- import { defineEnginePlugin } from '@pikacss/core';
2
+ import { defineEnginePlugin, renderCSSStyleBlocks } from '@pikacss/core';
3
3
  import { parseIconWithLoader, getEnvFlags, createNodeLoader, combineLoaders, createCDNFetchLoader } from '@unocss/preset-icons';
4
4
  import { $fetch } from 'ofetch';
5
5
 
@@ -80,9 +80,16 @@ function createIconsPlugin(lookupIconLoader) {
80
80
  ];
81
81
  let iconLoader;
82
82
  config.preflights ||= [];
83
- config.preflights.push(() => {
84
- const iconVariables = [...registeredIconVariables.entries()].map(([name, value]) => `${name}: ${value};`).join("\n");
85
- return `:root { ${iconVariables} }`;
83
+ config.preflights.push((_, isFormatted) => {
84
+ return renderCSSStyleBlocks(
85
+ /* @__PURE__ */ new Map([[
86
+ ":root",
87
+ {
88
+ properties: [...registeredIconVariables.entries()].map(([name, value]) => ({ property: name, value }))
89
+ }
90
+ ]]),
91
+ isFormatted
92
+ );
86
93
  });
87
94
  config.shortcuts ||= [];
88
95
  config.shortcuts.push({
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.8",
7
+ "version": "0.0.10",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "@iconify/utils": "^2.3.0",
39
39
  "@unocss/preset-icons": "^65.4.3",
40
40
  "ofetch": "^1.4.1",
41
- "@pikacss/core": "0.0.8"
41
+ "@pikacss/core": "0.0.10"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "unbuild",