-
-
Notifications
You must be signed in to change notification settings - Fork 502
/
TabNavigation.vue
105 lines (89 loc) · 2.03 KB
/
TabNavigation.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
<v-tabs
fixed-tabs
height="36px"
hide-slider
active-class="tab-navigation__tabs__tab--active"
class="tab-navigation__tabs py-6"
>
<v-tab
v-for="tab in tabContents"
:key="tab.name"
:to="tab.routerTo"
class="tab-navigation__tabs__tab"
:class="tab.routerTo.toLowerCase().replace('/', '').replace(/\//g, '__')"
>
{{ tab.name }}
</v-tab>
</v-tabs>
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
export interface TabContent {
name: string;
routerTo: string;
}
@Component({})
export default class TabNavigation extends Vue {
@Prop({ required: true, type: Array })
tabContents!: TabContent[];
}
</script>
<style scoped lang="scss">
@mixin start() {
border-radius: 8px 0 0 8px;
border-right: 0;
}
@mixin end() {
border-radius: 0 8px 8px 0;
border-left: 0;
}
.tab-navigation {
&__tabs {
::v-deep {
.v-tabs-bar {
background-color: var(--v-rotki-light-grey-base) !important;
border: var(--v-rotki-light-grey-darken1) solid thin;
border-radius: 8px;
}
}
&__tab {
background-color: white;
border-left: var(--v-rotki-light-grey-darken1) solid thin;
border-right: var(--v-rotki-light-grey-darken1) solid thin;
&:hover {
background-color: var(--v-rotki-light-grey-base);
}
a {
border: 1px solid var(--v-primary-base);
background-color: white;
}
&--active {
color: white;
background-color: var(--v-primary-base) !important;
}
&:first-of-type {
&:hover {
@include start();
}
@include start();
}
/* stylelint-disable no-descending-specificity */
&:last-of-type {
&:hover {
@include end();
}
@include end();
}
/* stylelint-enable no-descending-specificity */
}
.v-tab {
&:hover {
&::before {
border-radius: inherit;
}
}
}
}
}
</style>