Skip to content

Commit f7f8582

Browse files
committed
style(layout): fine-tuning styles
1 parent 1bee98f commit f7f8582

File tree

6 files changed

+56
-53
lines changed

6 files changed

+56
-53
lines changed

src/assets/icons/split.svg

Lines changed: 1 addition & 0 deletions
Loading

src/layouts/components/MainContent/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@
99
import Tab from '../Tab/index.vue';
1010
import Main from '../Main/index.vue';
1111
</script>
12-
13-
<style scoped lang="scss"></style>

src/layouts/components/Sidebar/sideTop.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<n-flex justify="center" align="center" class="w-full my-[15px] cursor-pointer">
33
<logo :logo-image="logoImage || ''" />
4-
<n-flex justify="center" align="center" class="w-full">
4+
<n-flex justify="center" align="center" class="w-full mt-[5px]">
55
<template v-for="option of topIconOptions" :key="option.name">
66
<component :is="option.component" :name="option.name" :icon-style="option.iconStyle" />
77
</template>
@@ -45,7 +45,7 @@ const logoImage = globalStore.interface.logo_logout;
4545

4646
<style scoped lang="scss">
4747
:deep(.n-flex) {
48-
gap: 10px 12px !important;
48+
gap: 15px 12px !important;
4949
.tree-icon:hover {
5050
fill: var(--el-color-primary) !important;
5151
}

src/layouts/components/Tab/index.vue

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
2-
<n-layout-header class="header-tab">
3-
<n-flex justify="space-between" align="center">
2+
<n-layout-header class="header-tab relative">
3+
<n-space justify="space-between" align="center">
44
<n-flex ref="el" style="gap: 0">
55
<n-flex
66
justify="center"
77
align="center"
88
v-for="item in list"
9-
class="tab-item py-0 px-1.25"
9+
class="tab-item cursor-pointer"
1010
:key="item.id"
1111
:class="{
1212
'active-tab': item.isActive,
@@ -15,38 +15,64 @@
1515
}"
1616
@click="handleTabClick(item)"
1717
>
18-
{{ item.name }}
18+
<n-text class="px-[10px] flex items-center text-white">
19+
<span class="inline-flex h-[35px] min-w-[85px] text-[13px] justify-center items-center">
20+
{{ item.name }}
21+
</span>
22+
<n-icon
23+
v-if="item.isActive"
24+
:size="14"
25+
class="text-white"
26+
:component="CloseOutline"
27+
></n-icon>
28+
</n-text>
1929
</n-flex>
2030
</n-flex>
21-
<n-flex justify="space-between" align="center" class="operation-item">
31+
<!-- todo)) 组件拆分 -->
32+
<n-flex
33+
justify="space-between"
34+
align="center"
35+
class="h-[35px] mr-[15px]"
36+
style="column-gap: 5px"
37+
>
2238
<n-popover>
2339
<template #trigger>
24-
<n-icon size="18px" :component="CopyOutline" />
40+
<div
41+
class="flex justify-center items-center w-[25px] h-[25px] cursor-pointer transition-all duration-300 ease-in-out hover:rounded-[5px] hover:bg-custom-icon-hover-color"
42+
>
43+
<svg-icon name="split" :icon-style="iconStyle" />
44+
</div>
2545
</template>
2646
拆分
2747
</n-popover>
2848

2949
<n-popover>
3050
<template #trigger>
31-
<n-icon size="18px" :component="EllipsisHorizontal" />
51+
<div
52+
class="flex justify-center items-center w-[25px] h-[25px] cursor-pointer transition-all duration-300 ease-in-out hover:rounded-[5px] hover:bg-custom-icon-hover-color"
53+
>
54+
<n-icon size="16px" :component="EllipsisHorizontal" />
55+
</div>
3256
</template>
3357
操作
3458
</n-popover>
3559
</n-flex>
36-
</n-flex>
60+
<!-- todo)) 组件拆分 -->
61+
</n-space>
3762
</n-layout-header>
3863
</template>
3964

4065
<script setup lang="ts">
41-
import { reactive, ref } from 'vue';
42-
import { CopyOutline, EllipsisHorizontal } from '@vicons/ionicons5';
66+
import { type CSSProperties, reactive, ref } from 'vue';
67+
import SvgIcon from '@/components/SvgIcon/index.vue';
4368
import { useDraggable, type UseDraggableReturn } from 'vue-draggable-plus';
69+
import { EllipsisHorizontal, CloseOutline } from '@vicons/ionicons5';
4470
4571
const el = ref();
4672
4773
const list = reactive([
4874
{
49-
name: 'Joao',
75+
name: 'index.js',
5076
id: 1,
5177
clickCount: 0,
5278
isActive: false
@@ -56,20 +82,16 @@ const list = reactive([
5682
id: 2,
5783
clickCount: 0,
5884
isActive: false
59-
},
60-
{
61-
name: 'Johanna',
62-
id: 3,
63-
clickCount: 0,
64-
isActive: false
65-
},
66-
{
67-
name: 'Juan',
68-
id: 4,
69-
clickCount: 0,
70-
isActive: false
7185
}
7286
]);
87+
88+
const iconStyle: CSSProperties = {
89+
fill: '#D8D8D8',
90+
width: '16px',
91+
height: '16px',
92+
transition: 'fill 0.3s'
93+
};
94+
7395
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7496
const draggable = useDraggable<UseDraggableReturn>(el, list, {
7597
animation: 150,
@@ -96,17 +118,9 @@ const handleTabClick = (item: { id: number }) => {
96118

97119
<style scoped lang="scss">
98120
.header-tab {
99-
position: relative;
100121
width: 100% !important;
101-
height: 35px;
102122
background-color: var(--el-main-header-bg-color);
103123
.tab-item {
104-
display: flex;
105-
align-items: center;
106-
justify-content: center;
107-
width: 60px;
108-
height: 35px;
109-
cursor: pointer;
110124
transition: all 0.3s ease-in-out;
111125
&.first-click {
112126
font-style: italic;
@@ -117,24 +131,9 @@ const handleTabClick = (item: { id: number }) => {
117131
color: rgb(255 255 255 / 50%);
118132
}
119133
&.active-tab {
120-
color: #ffffff;
134+
color: #ffffff !important;
121135
background-color: var(--el-main-bg-color);
122136
}
123137
}
124-
.operation-item {
125-
margin-right: 15px;
126-
.n-icon {
127-
display: flex;
128-
align-items: center;
129-
justify-content: center;
130-
padding: 3px;
131-
cursor: pointer;
132-
transition: all 0.3s ease-in-out;
133-
&:hover {
134-
background-color: #363737;
135-
border-radius: 5px;
136-
}
137-
}
138-
}
139138
}
140139
</style>

src/styles/theme/mainContent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ export const mainContentTheme: Record<Theme.ThemeType, { [key: string]: string }
44
light: {
55
'--el-main-header-bg-color': '#F8F8F8',
66
'--el-main-text-color': '#dadada',
7-
'--el-main-bg-color': '#ffffff'
7+
'--el-main-bg-color': '#ffffff',
8+
'--el-main-nav-bg-color': '#DDDDDD'
89
},
910
dark: {
1011
'--el-main-header-bg-color': '#252526',

tailwind.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ export default {
33
mode: 'jit',
44
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
55
theme: {
6-
extend: {}
6+
extend: {
7+
colors: {
8+
'custom-icon-hover-color': '#363737'
9+
}
10+
}
711
},
812
plugins: []
913
};

0 commit comments

Comments
 (0)