Skip to content

Commit b552b5d

Browse files
committed
style: update VitePress config and theme styles for improved navbar appearance
1 parent a377526 commit b552b5d

2 files changed

Lines changed: 58 additions & 78 deletions

File tree

.vitepress/config.mts

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,77 @@
1-
import { defineConfig } from 'vitepress'
2-
import Icons from 'unplugin-icons/vite'
1+
import { defineConfig } from "vitepress";
2+
import Icons from "unplugin-icons/vite";
33

44
export default defineConfig({
55
vite: {
6-
plugins: [Icons({ compiler: 'vue3', autoInstall: false })]
6+
plugins: [Icons({ compiler: "vue3", autoInstall: false })],
77
},
88
title: "Mukea",
9-
9+
head: [
10+
["link", { rel: "icon", href: "/favicon.ico" }],
11+
["link", { rel: "shortcut icon", href: "/favicon.ico" }],
12+
["link", { rel: "apple-touch-icon", href: "/mukea.png" }],
13+
],
14+
1015
// 共享的主题配置
1116
themeConfig: {
12-
logo: '/favicon.ico',
17+
logo: "/favicon.ico",
1318
},
14-
base: '/',
19+
base: "/",
1520
// i18n 配置核心
1621
locales: {
1722
// 默认语言(中文) - 对应根目录 /
1823
root: {
19-
label: '简体中文',
20-
lang: 'zh-CN',
24+
label: "简体中文",
25+
lang: "zh-CN",
2126
title: "Mukea",
2227
description: "一个可爱、主动的桌面 AI 伙伴",
2328
themeConfig: {
2429
nav: [
25-
{ text: '下载', link: '/download' },
26-
{ text: '博客', link: '/blog', target: '_blank', rel: 'noreferrer' }
30+
{ text: "下载", link: "/download" },
31+
{ text: "博客", link: "/blog", target: "_blank", rel: "noreferrer" },
2732
],
2833
sidebar: {
29-
'/blog/': [
34+
"/blog/": [
3035
{
31-
text: '博客',
36+
text: "博客",
3237
items: [
33-
{ text: '为什么我们要做 Mukea', link: '/blog/' },
34-
{ text: 'Mukea形象', link: '/blog/mukea-image' }
35-
]
36-
}
37-
]
38-
}
39-
}
38+
{ text: "为什么我们要做 Mukea", link: "/blog/" },
39+
{ text: "Mukea形象", link: "/blog/mukea-image" },
40+
],
41+
},
42+
],
43+
},
44+
},
4045
},
4146
// 英文 - 对应 /en/ 目录
4247
en: {
43-
label: 'English',
44-
lang: 'en-US',
45-
link: '/en/', // 指向英文版首页
48+
label: "English",
49+
lang: "en-US",
50+
link: "/en/", // 指向英文版首页
4651
title: "Mukea",
4752
description: "A cute, proactive AI companion.",
4853
themeConfig: {
4954
nav: [
50-
{ text: 'Download', link: '/en/download' },
51-
{ text: 'Blog', link: '/en/blog', target: '_blank', rel: 'noreferrer' }
55+
{ text: "Download", link: "/en/download" },
56+
{
57+
text: "Blog",
58+
link: "/en/blog",
59+
target: "_blank",
60+
rel: "noreferrer",
61+
},
5262
],
5363
sidebar: {
54-
'/en/blog/': [
64+
"/en/blog/": [
5565
{
56-
text: 'Blog',
66+
text: "Blog",
5767
items: [
58-
{ text: 'Why We’re Building Mukea', link: '/en/blog/' },
59-
{ text: 'Mukea Look', link: '/en/blog/mukea-image' }
60-
]
61-
}
62-
]
63-
}
64-
}
65-
}
66-
}
67-
})
68+
{ text: "Why We’re Building Mukea", link: "/en/blog/" },
69+
{ text: "Mukea Look", link: "/en/blog/mukea-image" },
70+
],
71+
},
72+
],
73+
},
74+
},
75+
},
76+
},
77+
});

.vitepress/theme/style.css

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,49 +76,19 @@ html:not(.dark) .VPHome .VPFeature {
7676
background-color: transparent !important;
7777
}
7878

79-
.mukea-nav-transparent .VPNavBar:not(.screen-open) .divider-line {
80-
background-color: transparent !important;
81-
}
82-
83-
@media (min-width: 960px) {
84-
.mukea-nav-transparent .VPNavBar:not(.home.top) .content-body {
85-
background-color: transparent !important;
86-
}
87-
}
88-
89-
/* Keep top navbar layout consistent even when a sidebar exists (e.g. blog). */
90-
@media (min-width: 960px) {
91-
.VPNavBar.has-sidebar .wrapper {
92-
padding: 0 32px !important;
93-
}
94-
95-
.VPNavBar.has-sidebar .container {
96-
max-width: calc(var(--vp-layout-max-width) - 64px) !important;
97-
}
98-
99-
.VPNavBar.has-sidebar .title {
100-
position: static !important;
101-
width: auto !important;
102-
padding: 0 !important;
103-
}
79+
/* .vitepress/theme/custom.css */
10480

105-
.VPNavBar.has-sidebar .content {
106-
padding-left: 0 !important;
107-
padding-right: 0 !important;
108-
}
109-
110-
.VPNavBar.has-sidebar .divider {
111-
padding-left: 0 !important;
112-
}
113-
114-
.VPNavBarTitle.has-sidebar .title {
115-
border-bottom-color: transparent !important;
116-
}
81+
/* 1) 非 home:去掉 VPNavBar 自身的阴影/边框 */
82+
.VPNavBar:not(.home) {
83+
box-shadow: none !important;
84+
border-bottom: none !important;
11785
}
11886

119-
120-
/* Download pages: remove doc padding so fixed layout doesn't create scroll */
121-
.VPDoc .vp-doc._download,
122-
.VPDoc .vp-doc._en_download {
123-
padding: 0 !important;
87+
/* 2) 非 home:如果底部分隔线/阴影是通过内部 divider 或伪元素画出来的,也一并清掉 */
88+
.VPNavBar:not(.home)::after,
89+
.VPNavBar:not(.home) .divider,
90+
.VPNavBar:not(.home) .divider-line {
91+
box-shadow: none !important;
92+
border-bottom: none !important;
93+
background: transparent !important;
12494
}

0 commit comments

Comments
 (0)