Skip to content

Commit f65e6db

Browse files
authored
feat: add UnoCSS snap usage (#374)
1 parent 4d40739 commit f65e6db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/icons.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export const SnippetMap: Record<string, Record<string, Snippet>> = {
6868
'astro': { name: 'Astro', lang: 'astro', prettierParser: 'typescript' },
6969
'react-native': { name: 'React Native', lang: 'tsx', prettierParser: 'typescript' },
7070
'unplugin': { name: 'Unplugin Icons', lang: 'tsx', prettierParser: 'typescript' },
71+
'unocss': { name: 'UnoCSS', lang: 'html', prettierParser: 'html' },
72+
'unocss-attributify': { name: 'UnoCSS', tag: 'attributify', lang: 'html', prettierParser: 'html' },
7173
},
7274
Links: {
7375
url: { name: 'URL', lang: 'html', prettierParser: 'html' },
@@ -128,6 +130,10 @@ export async function getIconSnippet(
128130
return SvgToReactNative(await getSvg(collections, icon, undefined, color), toComponentName(icon), snippet)
129131
case 'unplugin':
130132
return `import ${toComponentName(icon)} from '~icons/${icon.split(':')[0]}/${icon.split(':')[1]}'`
133+
case 'unocss':
134+
return `<div class="i-${icon}" />`
135+
case 'unocss-attributify':
136+
return `<div i-${icon} />`
131137
}
132138
}
133139

0 commit comments

Comments
 (0)