Skip to content

Commit db7633a

Browse files
committed
refactor: improve layout
1 parent 52d3098 commit db7633a

File tree

9 files changed

+42
-50
lines changed

9 files changed

+42
-50
lines changed

src/components/AppBreadcrumb.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<CBreadcrumb class="my-0 ms-2">
2+
<CBreadcrumb class="my-0">
33
<CBreadcrumbItem
44
v-for="item in breadcrumbs"
55
:key="item"

src/components/AppFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<CFooter>
2+
<CFooter class="px-4">
33
<div>
44
<a href="https://coreui.io" target="_blank">CoreUI</a>
55
<span class="ms-1"

src/components/AppHeader.vue

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<CHeader position="sticky" :class="headerClassNames">
3-
<CContainer class="border-bottom" fluid>
4-
<CHeaderToggler class="ps-1" @click="$store.commit('toggleSidebar')">
3+
<CContainer class="border-bottom px-4" fluid>
4+
<CHeaderToggler @click="$store.commit('toggleSidebar')" style="margin-inline-start: -14px">
55
<CIcon icon="cil-menu" size="lg" />
66
</CHeaderToggler>
7-
<CHeaderNav class="d-none d-md-flex me-auto">
7+
<CHeaderNav class="d-none d-md-flex">
88
<CNavItem>
99
<CNavLink href="/dashboard"> Dashboard </CNavLink>
1010
</CNavItem>
@@ -15,33 +15,32 @@
1515
<CNavLink href="#">Settings</CNavLink>
1616
</CNavItem>
1717
</CHeaderNav>
18-
<CHeaderNav>
18+
<CHeaderNav class="ms-auto">
1919
<CNavItem>
2020
<CNavLink href="#">
21-
<CIcon class="mx-2" icon="cil-bell" size="lg" />
21+
<CIcon icon="cil-bell" size="lg" />
2222
</CNavLink>
2323
</CNavItem>
2424
<CNavItem>
2525
<CNavLink href="#">
26-
<CIcon class="mx-2" icon="cil-list" size="lg" />
26+
<CIcon icon="cil-list" size="lg" />
2727
</CNavLink>
2828
</CNavItem>
2929
<CNavItem>
3030
<CNavLink href="#">
31-
<CIcon class="mx-2" icon="cil-envelope-open" size="lg" />
31+
<CIcon icon="cil-envelope-open" size="lg" />
3232
</CNavLink>
3333
</CNavItem>
34-
<li class="nav-item py-2 py-lg-1">
35-
<div
36-
class="vr d-none d-lg-flex h-100 mx-lg-2 text-body text-opacity-75"
37-
></div>
38-
<hr class="d-lg-none my-2 text-white-50" />
34+
</CHeaderNav>
35+
<CHeaderNav>
36+
<li class="nav-item py-1">
37+
<div class="vr h-100 mx-2 text-body text-opacity-75"></div>
3938
</li>
4039
<CDropdown variant="nav-item" placement="bottom-end">
4140
<CDropdownToggle :caret="false">
42-
<CIcon v-if="colorMode === 'dark'" icon="cil-moon" size="xl" />
43-
<CIcon v-else-if="colorMode === 'light'" icon="cil-sun" size="xl" />
44-
<CIcon v-else icon="cil-contrast" size="xl" />
41+
<CIcon v-if="colorMode === 'dark'" icon="cil-moon" size="lg" />
42+
<CIcon v-else-if="colorMode === 'light'" icon="cil-sun" size="lg" />
43+
<CIcon v-else icon="cil-contrast" size="lg" />
4544
</CDropdownToggle>
4645
<CDropdownMenu>
4746
<CDropdownItem
@@ -73,16 +72,13 @@
7372
</CDropdownItem>
7473
</CDropdownMenu>
7574
</CDropdown>
76-
<li class="nav-item py-2 py-lg-1">
77-
<div
78-
class="vr d-none d-lg-flex h-100 mx-lg-2 text-body text-opacity-75"
79-
></div>
80-
<hr class="d-lg-none my-2 text-white-50" />
75+
<li class="nav-item py-1">
76+
<div class="vr h-100 mx-2 text-body text-opacity-75"></div>
8177
</li>
8278
<AppHeaderDropdownAccnt />
8379
</CHeaderNav>
8480
</CContainer>
85-
<CContainer fluid>
81+
<CContainer class="px-4" fluid>
8682
<AppBreadcrumb />
8783
</CContainer>
8884
</CHeader>
@@ -100,17 +96,15 @@ export default {
10096
AppHeaderDropdownAccnt,
10197
},
10298
setup() {
103-
const headerClassNames = ref('mb-4')
104-
const { colorMode, setColorMode } = useColorModes(
105-
'coreui-free-vue-admin-template-theme',
106-
)
99+
const headerClassNames = ref('mb-4 p-0')
100+
const { colorMode, setColorMode } = useColorModes('coreui-free-vue-admin-template-theme')
107101
108102
onMounted(() => {
109103
document.addEventListener('scroll', () => {
110104
if (document.documentElement.scrollTop > 0) {
111-
headerClassNames.value = 'mb-4 shadow-sm'
105+
headerClassNames.value = 'mb-4 p-0 shadow-sm'
112106
} else {
113-
headerClassNames.value = 'mb-4'
107+
headerClassNames.value = 'mb-4 p-0'
114108
}
115109
})
116110
})

src/components/AppHeaderDropdownAccnt.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<CDropdown placement="bottom-end" variant="nav-item">
3-
<CDropdownToggle class="py-0" :caret="false">
3+
<CDropdownToggle class="py-0 pe-0" :caret="false">
44
<CAvatar :src="avatar" size="md" />
55
</CDropdownToggle>
66
<CDropdownMenu class="pt-0">

src/layouts/DefaultLayout.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<AppSidebar />
44
<div class="wrapper d-flex flex-column min-vh-100">
55
<AppHeader />
6-
<div class="body flex-grow-1 px-3">
7-
<CContainer lg>
6+
<div class="body flex-grow-1">
7+
<CContainer class="px-4" lg>
88
<router-view />
99
</CContainer>
1010
</div>

src/styles/_custom.scss

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
// Here you can add other styles// Here you can add other styles
1+
// Custom styles for this theme
2+
23
.header > .container-fluid,
34
.sidebar-header {
45
min-height: calc(4rem + 1px); // stylelint-disable-line function-disallowed-list
56
}
67

8+
.header > .container-fluid + .container-fluid {
9+
min-height: 3rem;
10+
}
11+
12+
.sidebar-brand-full {
13+
margin-left: 3px;
14+
}
15+
716
.sidebar-toggler {
817
@include ltr-rtl("margin-left", auto);
918
}
@@ -15,19 +24,6 @@
1524
}
1625
}
1726

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-
3127
.footer {
3228
min-height: calc(3rem + 1px); // stylelint-disable-line function-disallowed-list
3329
}
File renamed without changes.

src/styles/_variables.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
// Variable overrides
22
//
33
// If you want to customize your project please add your variables below.
4+
5+
$enable-rtl: true; /* stylelint-disable-line scss/dollar-variable-default */
6+
$enable-deprecation-messages: false; /* stylelint-disable-line scss/dollar-variable-default */

src/styles/style.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
// If you want to override variables do it here
22
@import "variables";
33

4-
$enable-ltr: true;
5-
$enable-rtl: true;
6-
74
// Import CoreUI for React components library
85
@import "@coreui/coreui/scss/coreui";
96

107
// Import Chart.js custom tooltips styles
118
@import "@coreui/chartjs/scss/coreui-chartjs";
129

1310
@import "layout";
14-
@import "example";
11+
12+
// Preview
13+
@import "examples";
1514

1615
// If you want to add custom CSS you can put it here.
1716
@import "custom";

0 commit comments

Comments
 (0)