fix: 🐛 同步部分页面的图标方案至 @unocss/preset-icons
closed #IBKZ2I
This commit is contained in:
@@ -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" ');
|
||||
}),
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user