Skip to content

Commit 80937f2

Browse files
committed
修复整个首页背景渐变覆盖
- 使用多个选择器确保整个页面都有背景渐变 - 添加样式优先级确保覆盖 - 包含 VPContent, vp-doc, body.is-home 等选择器 - 确保 VPDoc 区域也有背景渐变 - 解决只有上半部分有背景的问题 - 让整个首页都有统一的渐变效果
1 parent dc1b91e commit 80937f2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/.vitepress/theme/style.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@
3030
--panda-light-gray: #343a40;
3131
}
3232

33-
/* 首页整体背景渐变 */
34-
.Layout.is-home {
35-
background: linear-gradient(135deg, var(--panda-white) 0%, rgba(236, 240, 241, 0.3) 25%, rgba(255, 255, 255, 0.8) 50%, rgba(236, 240, 241, 0.4) 75%, var(--panda-white) 100%);
33+
/* 首页整体背景渐变 - 使用多个选择器确保覆盖 */
34+
.Layout.is-home,
35+
.Layout.is-home .VPContent,
36+
.Layout.is-home .vp-doc,
37+
body.is-home {
38+
background: linear-gradient(135deg, var(--panda-white) 0%, rgba(236, 240, 241, 0.3) 25%, rgba(255, 255, 255, 0.8) 50%, rgba(236, 240, 241, 0.4) 75%, var(--panda-white) 100%) !important;
3639
min-height: 100vh;
3740
}
3841

42+
/* 确保整个文档区域也有背景 */
43+
.VPDoc {
44+
background: linear-gradient(135deg, var(--panda-white) 0%, rgba(236, 240, 241, 0.3) 25%, rgba(255, 255, 255, 0.8) 50%, rgba(236, 240, 241, 0.4) 75%, var(--panda-white) 100%) !important;
45+
}
46+
3947
/* 主页英雄区域 - 熊猫主题 */
4048
.VPHero {
4149
background: linear-gradient(135deg, var(--panda-light-gray) 0%, rgba(236, 240, 241, 0.8) 30%, rgba(255, 255, 255, 0.9) 70%, var(--panda-white) 100%);

0 commit comments

Comments
 (0)