mirror of
https://github.com/antfu-collective/icones.git
synced 2026-01-09 07:40:49 +08:00
feat: add UnoCSS snap usage (#374)
This commit is contained in:
parent
4d4073932c
commit
f65e6dbb4c
@ -68,6 +68,8 @@ export const SnippetMap: Record<string, Record<string, Snippet>> = {
|
||||
'astro': { name: 'Astro', lang: 'astro', prettierParser: 'typescript' },
|
||||
'react-native': { name: 'React Native', lang: 'tsx', prettierParser: 'typescript' },
|
||||
'unplugin': { name: 'Unplugin Icons', lang: 'tsx', prettierParser: 'typescript' },
|
||||
'unocss': { name: 'UnoCSS', lang: 'html', prettierParser: 'html' },
|
||||
'unocss-attributify': { name: 'UnoCSS', tag: 'attributify', lang: 'html', prettierParser: 'html' },
|
||||
},
|
||||
Links: {
|
||||
url: { name: 'URL', lang: 'html', prettierParser: 'html' },
|
||||
@ -128,6 +130,10 @@ export async function getIconSnippet(
|
||||
return SvgToReactNative(await getSvg(collections, icon, undefined, color), toComponentName(icon), snippet)
|
||||
case 'unplugin':
|
||||
return `import ${toComponentName(icon)} from '~icons/${icon.split(':')[0]}/${icon.split(':')[1]}'`
|
||||
case 'unocss':
|
||||
return `<div class="i-${icon}" />`
|
||||
case 'unocss-attributify':
|
||||
return `<div i-${icon} />`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user