Skip to content

Commit c00ca2f

Browse files
ItsPierrejohannes-huther
authored andcommitted
feat: refactor navigation drawer
Refactor navigation drawer. Make list-items more compact and less rounded. Remove automatic branding transitions.
1 parent 356d436 commit c00ca2f

File tree

3 files changed

+7
-52
lines changed

3 files changed

+7
-52
lines changed

src/components/navigation-drawer/CNavigationDrawer.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
:class="rail ? 'rail' : ''"
66
rail-width="80"
77
mobile-breakpoint="md"
8-
class="c-navigation-drawer rounded-xl"
8+
class="c-navigation-drawer"
99
>
1010
<div class="d-flex flex-column" style="height: 100%">
1111
<!-- Branding -->
12-
<v-list v-if="slots['branding']" nav class="my-3 ml-1">
13-
<slot name="branding"></slot>
14-
</v-list>
12+
<slot name="branding"></slot>
1513

1614
<div
1715
class="d-flex flex-column overflow-x-hidden overflow-y-auto"

src/components/navigation-drawer/CNavigationItem.vue

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
:prepend-icon="icon"
55
:title="label"
66
:to="to"
7-
class="mb-0 full-width"
7+
class="mb-0 full-width py-2 my-1"
88
min-height="unset"
9+
rounded="lg"
910
>
1011
</v-list-item>
11-
<div class="rail-label d-flex align-center justify-center">
12-
<p>{{ label }}</p>
13-
</div>
1412
</div>
1513
</template>
1614

@@ -40,45 +38,4 @@ defineProps<{
4038
}>();
4139
</script>
4240

43-
<style lang="scss">
44-
.c-navigation-item {
45-
height: 56px;
46-
47-
.rail-label {
48-
font-size: 10px;
49-
opacity: 0;
50-
height: 0;
51-
// The default rail width - the padding of the nav-drawer
52-
width: calc(80px - 16px);
53-
}
54-
55-
.v-list-item {
56-
height: 48px;
57-
}
58-
}
59-
60-
// When used in navigation drawer, show it on rail mode
61-
.c-navigation-drawer.rail {
62-
.c-navigation-subtitle {
63-
opacity: 0;
64-
height: 0;
65-
}
66-
67-
.v-list-item .v-list-item__content {
68-
opacity: 0;
69-
}
70-
71-
.c-navigation-item {
72-
margin-bottom: 12px;
73-
74-
.v-list-item {
75-
height: 32px;
76-
}
77-
78-
.rail-label {
79-
opacity: 100%;
80-
height: 20px;
81-
}
82-
}
83-
}
84-
</style>
41+
<style lang="scss"></style>

src/components/navigation-drawer/CNavigationSubtitle.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="c-navigation-subtitle mb-3 ml-5 text-grey-darken-2 font-weight-bold"
3+
class="c-navigation-subtitle mb-1 ml-5 text-grey-darken-2 font-weight-bold"
44
:class="classes"
55
>
66
{{ title }}
@@ -52,7 +52,7 @@ const props = withDefaults(
5252
}
5353
5454
.v-list .c-navigation-subtitle:not(:first-child) {
55-
margin-top: 16px;
55+
margin-top: 4px;
5656
}
5757
5858
// When used in navigation drawer, hide it on rail mode

0 commit comments

Comments
 (0)