Skip to content

Commit 9fcca65

Browse files
committed
refactor: update layout
1 parent 50645fc commit 9fcca65

File tree

5 files changed

+79
-27
lines changed

5 files changed

+79
-27
lines changed

src/components/AppHeader.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<CHeader position="sticky" class="mb-4">
3-
<CContainer fluid>
3+
<CContainer class="border-bottom" fluid>
44
<CHeaderToggler class="ps-1" @click="$store.commit('toggleSidebar')">
55
<CIcon icon="cil-menu" size="lg" />
66
</CHeaderToggler>
@@ -42,17 +42,17 @@
4242
</li>
4343
<CDropdown variant="nav-item" placement="bottom-end">
4444
<CDropdownToggle :caret="false">
45-
<CIcon v-if="getColorMode() === 'dark'" icon="cil-moon" size="xl" />
45+
<CIcon v-if="colorMode === 'dark'" icon="cil-moon" size="xl" />
4646
<CIcon
47-
v-else-if="getColorMode() === 'light'"
47+
v-else-if="colorMode === 'light'"
4848
icon="cil-sun"
4949
size="xl"
5050
/>
5151
<CIcon v-else icon="cil-contrast" size="xl" />
5252
</CDropdownToggle>
5353
<CDropdownMenu>
5454
<CDropdownItem
55-
:active="getColorMode() === 'light'"
55+
:active="colorMode === 'light'"
5656
class="d-flex align-items-center"
5757
component="button"
5858
type="button"
@@ -61,7 +61,7 @@
6161
<CIcon class="me-2" icon="cil-sun" size="lg" /> Light
6262
</CDropdownItem>
6363
<CDropdownItem
64-
:active="getColorMode() === 'dark'"
64+
:active="colorMode === 'dark'"
6565
class="d-flex align-items-center"
6666
component="button"
6767
type="button"
@@ -70,7 +70,7 @@
7070
<CIcon class="me-2" icon="cil-moon" size="lg" /> Dark
7171
</CDropdownItem>
7272
<CDropdownItem
73-
:active="getColorMode() === 'auto'"
73+
:active="colorMode === 'auto'"
7474
class="d-flex align-items-center"
7575
component="button"
7676
type="button"
@@ -89,7 +89,6 @@
8989
<AppHeaderDropdownAccnt />
9090
</CHeaderNav>
9191
</CContainer>
92-
<CHeaderDivider />
9392
<CContainer fluid>
9493
<AppBreadcrumb />
9594
</CContainer>
@@ -108,13 +107,13 @@ export default {
108107
AppHeaderDropdownAccnt,
109108
},
110109
setup() {
111-
const { getColorMode, setColorMode } = useColorModes(
110+
const { colorMode, setColorMode } = useColorModes(
112111
'coreui-free-vue-admin-template-theme',
113112
)
114113
return {
115114
logo,
115+
colorMode,
116116
setColorMode,
117-
getColorMode,
118117
}
119118
},
120119
}

src/components/AppSidebar.vue

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<CSidebar
3+
class="border-end"
34
position="fixed"
45
:unfoldable="sidebarUnfoldable"
56
:visible="sidebarVisible"
@@ -11,23 +12,27 @@
1112
})
1213
"
1314
>
14-
<CSidebarBrand>
15-
<CIcon
16-
custom-class-name="sidebar-brand-full"
17-
:icon="logoNegative"
18-
:height="35"
19-
/>
20-
<CIcon
21-
custom-class-name="sidebar-brand-narrow"
22-
:icon="sygnet"
23-
:height="35"
24-
/>
25-
</CSidebarBrand>
15+
<CSidebarHeader class="border-bottom">
16+
<CSidebarBrand>
17+
<CIcon
18+
custom-class-name="sidebar-brand-full"
19+
:icon="logoNegative"
20+
:height="32"
21+
/>
22+
<CIcon
23+
custom-class-name="sidebar-brand-narrow"
24+
:icon="sygnet"
25+
:height="32"
26+
/>
27+
</CSidebarBrand>
28+
</CSidebarHeader>
2629
<AppSidebarNav />
27-
<CSidebarToggler
28-
class="d-none d-lg-flex"
29-
@click="$store.commit('toggleUnfoldable')"
30-
/>
30+
<CSidebarFooter class="border-top">
31+
<CSidebarToggler
32+
class="d-none d-lg-flex"
33+
@click="$store.commit('toggleUnfoldable')"
34+
/>
35+
</CSidebarFooter>
3136
</CSidebar>
3237
</template>
3338

src/layouts/DefaultLayout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<AppSidebar />
4-
<div class="wrapper d-flex flex-column min-vh-100 bg-body-tertiary">
4+
<div class="wrapper d-flex flex-column min-vh-100">
55
<AppHeader />
66
<div class="body flex-grow-1 px-3">
77
<CContainer lg>

src/styles/_custom.scss

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
// Here you can add other styles
1+
// Here you can add other styles// Here you can add other styles
2+
.header > .container-fluid,
3+
.sidebar-header {
4+
min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list
5+
}
6+
7+
.sidebar-toggler {
8+
@include ltr-rtl("margin-left", auto);
9+
}
10+
11+
.sidebar-narrow,
12+
.sidebar-narrow-unfoldable:not(:hover) {
13+
.sidebar-toggler {
14+
@include ltr-rtl("margin-right", auto);
15+
}
16+
}
17+
18+
.header > .container-fluid + .container-fluid {
19+
min-height: 3rem;
20+
}
21+
22+
.header {
23+
padding: 0;
24+
25+
.container-fluid {
26+
padding-right: $spacer;
27+
padding-left: $spacer;
28+
}
29+
}
30+
31+
.footer {
32+
min-height: calc(3rem + 1px); // stylelint-disable-line function-disallowed-list
33+
}

src/styles/_layout.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1+
body {
2+
background-color: var(--cui-tertiary-bg);
3+
}
4+
15
.wrapper {
26
width: 100%;
37
@include ltr-rtl("padding-left", var(--cui-sidebar-occupy-start, 0));
48
will-change: auto;
59
@include transition(padding .15s);
610
}
11+
12+
@if $enable-dark-mode {
13+
@include color-mode(dark) {
14+
body {
15+
background-color: var(--cui-dark-bg-subtle);
16+
}
17+
18+
.footer {
19+
--cui-footer-bg: var(--cui-body-bg);
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)