fix: 🐛 同步部分页面的图标方案至 @unocss/preset-icons

closed #IBKZ2I
This commit is contained in:
Ray.Hao
2025-02-08 20:15:24 +08:00
parent dc85bb0afe
commit 3b3a2cf1c9
4 changed files with 5 additions and 9 deletions

View File

@@ -60,12 +60,10 @@ export default defineConfig({
},
// 图表集合
collections: {
// svg 是图标集合名称,使用 `i-svg:图标名` 调用
svg: FileSystemIconLoader(iconsDir, (svg) => {
// 如果 `fill` 没有定义,则添加 `fill="currentColor"`
if (!svg.includes('fill="')) {
return svg.replace(/^<svg /, '<svg fill="currentColor" ');
}
return svg;
return svg.includes('fill="') ? svg : svg.replace(/^<svg /, '<svg fill="currentColor" ');
}),
},
}),