Skip to content

Commit 1bee98f

Browse files
committed
refactor(layout): changing styles
1 parent 21ad5df commit 1bee98f

File tree

20 files changed

+119
-73
lines changed

20 files changed

+119
-73
lines changed

.stylelintrc.cjs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ module.exports = {
88
"stylelint-config-html/vue", // 配置 vue 中 template 样式格式化
99
"stylelint-config-standard-scss", // 配置 stylelint scss 插件
1010
"stylelint-config-recommended-vue/scss", // 配置 vue 中 scss 样式格式化
11-
"stylelint-config-recess-order" // 配置 stylelint css 属性书写顺序插件,
11+
"stylelint-config-recess-order", // 配置 stylelint css 属性书写顺序插件,
12+
"stylelint-config-recommended",
13+
"stylelint-config-tailwindcss"
1214
],
1315
overrides: [
1416
// 扫描 .vue/html 文件中的 <style> 标签内的样式
1517
{
1618
files: ["**/*.{vue,html}"],
1719
customSyntax: "postcss-html"
20+
},
21+
{
22+
files: ["**/*.{scss,css}"],
23+
customSyntax: "postcss-scss"
1824
}
1925
],
2026
rules: {
@@ -34,7 +40,19 @@ module.exports = {
3440
{
3541
ignorePseudoClasses: ["global", "v-deep", "deep"]
3642
}
43+
],
44+
"at-rule-no-unknown": [
45+
true,
46+
{
47+
ignoreAtRules: ["tailwind", "apply", "variants", "responsive", "screen"]
48+
}
49+
],
50+
"scss/at-rule-no-unknown": [
51+
true,
52+
{
53+
ignoreAtRules: ["tailwind", "apply", "variants", "responsive", "screen"]
54+
}
3755
]
3856
},
39-
ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts","**/*.html"]
57+
ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts", "**/*.html"]
4058
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@
5757
"stylelint": "^16.1.0",
5858
"stylelint-config-html": "^1.1.0",
5959
"stylelint-config-recess-order": "^5.0.0",
60+
"stylelint-config-recommended": "^14.0.1",
6061
"stylelint-config-recommended-scss": "^14.0.0",
6162
"stylelint-config-recommended-vue": "^1.5.0",
6263
"stylelint-config-standard": "^36.0.0",
6364
"stylelint-config-standard-scss": "^13.0.0",
65+
"stylelint-config-tailwindcss": "^0.0.7",
6466
"tailwindcss": "^3.4.6",
6567
"typescript": "^5.5.3",
6668
"typescript-eslint": "^7.15.0",

pnpm-lock.yaml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/layouts/components/FileManagement/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ import type { Tree } from '@/API/interface';
7676
7777
import mittBus from '@/utils/mittBus.ts';
7878
79-
const treeStore = useTreeStore();
8079
const { t } = useI18n();
81-
const { isAsync } = storeToRefs(treeStore);
8280
const dialog = useDialog();
81+
const treeStore = useTreeStore();
82+
const { isAsync } = storeToRefs(treeStore);
8383
8484
const pattern = ref('');
8585
const showDialog = ref(false);

src/layouts/components/NavSearch/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<n-flex class="search-part" justify="center" align="center">
2+
<n-flex class="h-[35px] search-part" justify="center" align="center">
33
<n-icon color="#CCCCCC" size="16px" :component="ArrowBack" />
44
<n-icon color="#CCCCCC" size="16px" :component="ArrowForward" />
55
<n-input
@@ -8,7 +8,7 @@
88
size="small"
99
clearable
1010
autosize
11-
style="min-width: 50%; height: 24px; border-radius: 5px"
11+
class="h-[24px] min-w-[50%] rounded-[5px] min-w-1/2"
1212
>
1313
<template #prefix>
1414
<n-icon size="16px" :component="SearchOutline"></n-icon>
@@ -23,7 +23,6 @@ import { SearchOutline, ArrowBack, ArrowForward } from '@vicons/ionicons5';
2323

2424
<style scoped lang="scss">
2525
.search-part {
26-
height: 35px;
2726
background-color: var(--el-main-nav-bg-color);
2827
}
2928
</style>

src/layouts/components/Sidebar/components/Help/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:options="options"
77
@select="handleSelect"
88
>
9-
<svg-icon :name="name" :icon-style="iconStyle" />
9+
<svg-icon class="tree-icon" :name="name" :icon-style="iconStyle" />
1010
</n-dropdown>
1111
</template>
1212

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
<template>
2-
<n-image height="30px" lazy :src="logoImage" alt="Logo 图片" />
2+
<n-image
3+
lazy
4+
:src="logoImage"
5+
alt="Logo 图片"
6+
class="h-8 w-8 justify-center object-fill hover: cursor-pointer"
7+
/>
38
</template>
49

510
<script setup lang="ts">
611
defineProps<{
712
logoImage: string;
813
}>();
914
</script>
10-
11-
<style scoped lang="scss">
12-
.n-image {
13-
justify-content: center;
14-
width: 100%;
15-
&:hover {
16-
cursor: pointer;
17-
}
18-
}
19-
</style>

src/layouts/components/Sidebar/components/Profile/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:options="options"
77
@select="handleSelect"
88
>
9-
<svg-icon :name="name" :icon-style="iconStyle" />
9+
<svg-icon class="tree-icon" :name="name" :icon-style="iconStyle" />
1010
</n-dropdown>
1111
</template>
1212

src/layouts/components/Sidebar/components/Setting/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<n-popover placement="right" trigger="hover">
33
<template #trigger>
4-
<svg-icon :name="name" :icon-style="iconStyle" @click="handleSetting" />
4+
<svg-icon class="tree-icon" :name="name" :icon-style="iconStyle" @click="handleSetting" />
55
</template>
66
{{ t('Custom Setting') }}
77
</n-popover>
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<n-button text @click="handleTreeIconClick">
2+
<n-button text @click="handleTreeIconClick" :class="isCollapsed ? '' : 'icon-wrapper'">
33
<svg-icon class="tree-icon" :name="name" :icon-style="iconStyle" />
44
</n-button>
55
</template>
@@ -8,20 +8,39 @@
88
import mittBus from '@/utils/mittBus.ts';
99
import SvgIcon from '@/components/SvgIcon/index.vue';
1010
11+
import { storeToRefs } from 'pinia';
1112
import { CSSProperties } from 'vue';
13+
import { useTreeStore } from '@/stores/modules/tree.ts';
1214
1315
defineProps<{
1416
name: string;
1517
iconStyle: CSSProperties;
1618
}>();
1719
20+
const treeStore = useTreeStore();
21+
const { isCollapsed } = storeToRefs(treeStore);
22+
1823
const handleTreeIconClick = () => {
1924
mittBus.emit('tree-click');
2025
};
2126
</script>
2227

2328
<style scoped lang="scss">
24-
.tree-icon:hover {
25-
fill: var(--el-color-primary-light-1) !important;
29+
.icon-wrapper {
30+
position: relative;
31+
width: 100%;
32+
.tree-icon {
33+
fill: var(--el-color-primary-light-1) !important;
34+
}
35+
&::before {
36+
position: absolute;
37+
top: 0;
38+
left: 0;
39+
display: block;
40+
width: 2px;
41+
height: 100%;
42+
content: '';
43+
background-color: var(--el-color-primary-light-1);
44+
}
2645
}
2746
</style>

0 commit comments

Comments
 (0)