1
1
<template >
2
- <NuxtLink v-if =" link !== null" class = " nav- link button-base " :to = " link " >
3
- <div class = " nav-content " >
4
- < slot / >
5
- <span >{{ label }}</ span >
6
- < span v-if = " beta " class = " beta- badge" >BETA</ span >
7
- < span v-if = " chevron " class = " chevron " >< ChevronRightIcon /> </span >
8
- </ div >
2
+ <NuxtLink v-if =" link !== null" :to = " link" class = " nav-item " >
3
+ <slot / >
4
+ < span >{{ label }}</ span >
5
+ <span v-if = " badge " class = " rounded-full bg-brand-highlight px-2 text-sm font-bold text-brand " >{{
6
+ badge
7
+ }} </span >
8
+ <span v-if = " chevron " class = " ml-auto " >< ChevronRightIcon /></ span >
9
9
</NuxtLink >
10
- <button
11
- v-else-if =" action"
12
- class =" nav-link button-base"
13
- :class =" { 'danger-button': danger }"
14
- @click =" action"
15
- >
16
- <span class =" nav-content" >
17
- <slot />
18
- <span >{{ label }}</span >
19
- <span v-if =" beta" class =" beta-badge" >BETA</span >
20
- </span >
10
+ <button v-else-if =" action" class =" nav-item" :class =" { 'danger-button': danger }" @click =" action" >
11
+ <slot />
12
+ <span >{{ label }}</span >
13
+ <span v-if =" badge" class =" rounded-full bg-brand-highlight px-2 text-sm font-bold text-brand" >{{
14
+ badge
15
+ }}</span >
21
16
</button >
22
17
<span v-else >i forgor 💀</span >
23
18
</template >
@@ -42,9 +37,9 @@ export default {
42
37
required: true ,
43
38
type: String ,
44
39
},
45
- beta : {
46
- default: false ,
47
- type: Boolean ,
40
+ badge : {
41
+ default: null ,
42
+ type: String ,
48
43
},
49
44
chevron: {
50
45
default: false ,
@@ -59,58 +54,11 @@ export default {
59
54
</script >
60
55
61
56
<style lang="scss" scoped>
62
- .nav-link {
63
- font-weight : var (--font-weight-bold );
64
- background-color : transparent ;
65
- color : var (--text-color );
66
- position : relative ;
67
- display : flex ;
68
- flex-direction : row ;
69
- gap : 0.25rem ;
70
- box-shadow : none ;
71
- padding : 0 ;
72
- width : 100% ;
73
- outline : none ;
74
-
75
- :where (.nav-link ) {
76
- --text-color : var (--color-text );
77
- --background-color : var (--color-raised-bg );
78
- }
79
-
80
- .nav-content {
81
- box-sizing : border-box ;
82
- padding : 0.5rem 0.75rem ;
83
- border-radius : var (--size-rounded-sm );
84
- display : flex ;
85
- align-items : center ;
86
- gap : 0.4rem ;
87
- flex-grow : 1 ;
88
- background-color : var (--background-color );
89
- }
90
-
91
- & :focus-visible {
92
- .nav-content {
93
- border-radius : 0.25rem ;
94
- }
95
- }
96
-
97
- & .router-link-exact-active {
98
- outline : 2px solid transparent ;
99
- border-radius : 0.25rem ;
100
-
101
- .nav-content {
102
- color : var (--color-button-text-active );
103
- background-color : var (--color-button-bg );
104
- box-shadow : none ;
105
- }
106
- }
107
-
108
- .beta-badge {
109
- margin : 0 ;
110
- }
57
+ .nav-item {
58
+ @apply flex w-full cursor-pointer items-center gap-2 text-nowrap rounded-xl border-none bg-transparent px-4 py-2 text-left font-semibold text-button-text transition-all hover :bg- button- bg hover:text- contrast active :scale- [0.97 ];
59
+ }
111
60
112
- .chevron {
113
- margin-left : auto ;
114
- }
61
+ .router-link-exact-active.nav-item {
62
+ @apply bg-button-bgSelected text-button-text Selected ;
115
63
}
116
64
</style >
0 commit comments