Skip to content

Commit

Permalink
fix: respect size setting for emojis in smart icons
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <[email protected]>
  • Loading branch information
ZTL-UwU committed Sep 22, 2024
1 parent 0fe35d5 commit e6492e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/content/SmartIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<!-- Iconify Icons -->
<Icon v-if="checkIcon(name)" :name="name" :size="size" />
<!-- Emojis -->
<span v-else-if="/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g.test(name)">{{ name }}</span>
<span
v-else-if="/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g.test(name)"
:style="`font-size: ${size}px;`"
>{{ name }}</span>
<!-- Link -->
<NuxtImg
v-else
Expand Down
2 changes: 2 additions & 0 deletions content/1.getting-started/3.writing/2.components.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ You can put iconify icons, emojis and urls in `smart-icon`. Smart icon will rend

:smart-icon{name="😍"}
:smart-icon{name="🚀"}
:smart-icon{name="🎉" size=30}

</div>

Expand All @@ -434,6 +435,7 @@ You can put iconify icons, emojis and urls in `smart-icon`. Smart icon will rend
:smart-icon{name="😍"}
:smart-icon{name="🚀"}
:smart-icon{name="🎉" size=30}
:smart-icon{name="/logo.svg"}
:smart-icon{name="https://vueuse.org/favicon.svg" size=40}
Expand Down
2 changes: 1 addition & 1 deletion content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ navigation: false
::hero
---
announcement:
title: 'Release v0.5.4'
title: 'Release v0.5.5'
icon: '🎉'
to: https://github.com/ZTL-UwU/shadcn-docs-nuxt/releases
target: _blank
Expand Down

0 comments on commit e6492e9

Please sign in to comment.