Skip to content

Commit 29c155a

Browse files
committed
refactor(LinkBase): remove footer variant and simplify link styles
1 parent 84cc589 commit 29c155a

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

app/components/AppFooter.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ const footerSections: Array<{ label: string; links: FooterLink[] }> = [
137137
{{ $t(link.name) }}
138138
</button>
139139

140-
<LinkBase v-else :to="link?.href" variant="footer">
140+
<LinkBase
141+
v-else
142+
:to="link?.href"
143+
variant="link"
144+
noUnderline
145+
class="text-fg-subtle text-sm lowercase"
146+
>
141147
{{ $t(link.name) }}
142148
</LinkBase>
143149
</template>

app/components/Link/Base.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const props = withDefaults(
1111
* */
1212
type?: never
1313
/** Visual style of the link */
14-
variant?: 'button-primary' | 'button-secondary' | 'link' | 'footer'
14+
variant?: 'button-primary' | 'button-secondary' | 'link'
1515
/** Size (only applicable for button variants) */
1616
size?: 'sm' | 'md'
1717
/** Makes the link take full width */
@@ -62,9 +62,8 @@ const isLinkAnchor = computed(
6262
)
6363
6464
/** size is only applicable for button like links */
65-
const isFooterLink = computed(() => props.variant === 'footer')
66-
const isLink = computed(() => props.variant === 'link' || isFooterLink.value)
67-
const isButton = computed(() => !isLink.value && !isFooterLink.value)
65+
const isLink = computed(() => props.variant === 'link')
66+
const isButton = computed(() => !isLink.value)
6867
const isButtonSmall = computed(() => props.size === 'sm' && !isLink.value)
6968
const isButtonMedium = computed(() => props.size === 'md' && !isLink.value)
7069
const keyboardShortcutsEnabled = useKeyboardShortcuts()
@@ -93,7 +92,7 @@ const keyboardShortcutsEnabled = useKeyboardShortcuts()
9392
'flex': block,
9493
'inline-flex': !block,
9594
'underline-offset-[0.2rem] underline decoration-1 decoration-fg/30':
96-
!isLinkAnchor && isLink && !noUnderline && !isFooterLink,
95+
!isLinkAnchor && isLink && !noUnderline,
9796
'justify-start font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200':
9897
isLink,
9998
'justify-center font-mono border border-border rounded-md transition-all duration-200':
@@ -104,7 +103,6 @@ const keyboardShortcutsEnabled = useKeyboardShortcuts()
104103
variant === 'button-secondary',
105104
'text-bg bg-fg hover:(bg-fg/50 text-accent) focus-visible:(bg-fg/50) aria-current:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':
106105
variant === 'button-primary',
107-
'text-fg-subtle text-sm cursor-pointer lowercase': isFooterLink,
108106
}"
109107
:to="to"
110108
:aria-keyshortcuts="keyboardShortcutsEnabled ? ariaKeyshortcuts : undefined"

0 commit comments

Comments
 (0)