Skip to content

Commit 886c60e

Browse files
committed
feat: automatically show external link icon
1 parent 2278aa1 commit 886c60e

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

app/components/AppFooter.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ const isHome = computed(() => route.name === 'index')
2020
</LinkBase>
2121
<LinkBase href="https://docs.npmx.dev" target="_blank" rel="noopener noreferrer">
2222
{{ $t('footer.docs') }}
23-
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
2423
</LinkBase>
2524
<LinkBase href="https://repo.npmx.dev" target="_blank" rel="noopener noreferrer">
2625
{{ $t('footer.source') }}
27-
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
2826
</LinkBase>
2927
<LinkBase href="https://social.npmx.dev" target="_blank" rel="noopener noreferrer">
3028
{{ $t('footer.social') }}
31-
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
3229
</LinkBase>
3330
<LinkBase href="https://chat.npmx.dev" target="_blank" rel="noopener noreferrer">
3431
{{ $t('footer.chat') }}
35-
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
3632
</LinkBase>
3733
</div>
3834
</div>

app/components/Link/Base.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ const props = withDefaults(
4747
/></span>
4848
<NuxtLink
4949
v-else
50-
class="group"
50+
class="group inline-flex gap-x-1 items-center justify-center"
5151
:class="{
5252
'text-fg underline-offset-4 underline decoration-1 decoration-fg/50 hover:(no-underline text-fg/80) transition-colors duration-200':
5353
variant === 'link',
54-
'gap-x-1 inline-flex gap-x-1 items-center justify-center font-mono border border-border rounded-md transition-all duration-200 aria-current:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':
54+
'gap-x-1 font-mono border border-border rounded-md transition-all duration-200 aria-current:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':
5555
variant !== 'link',
5656
'text-sm px-4 py-2': variant !== 'tag' && variant !== 'link',
5757
'text-xs px-2 py-0.5': variant === 'tag',
@@ -69,6 +69,8 @@ const props = withDefaults(
6969
aria-hidden="true"
7070
/>
7171
<slot />
72+
<!-- automatically show icon indicating external link -->
73+
<span v-if="href" class="i-carbon:launch rtl-flip w-3 h-3 opacity-50" aria-hidden="true" />
7274
<kbd
7375
v-if="keyshortcut"
7476
class="inline-flex items-center justify-center w-4 h-4 text-xs text-fg bg-bg-muted border border-border rounded no-underline"

0 commit comments

Comments
 (0)