diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index bf57652..f3c4a1d 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -6,34 +6,7 @@ export default defineConfig({ description: 'Easy-Vibe 中文实战课 - 零基础学会用 AI 干实际工作', head: [ ['link', { rel: 'icon', href: '/logo.png' }], - ['style', {}, ` - :root { - --vp-sidebar-nav-section-gap: 4px; - --vp-sidebar-item-line-height: 16px !important; - --vp-sidebar-item-padding-bottom: 0px !important; - --vp-sidebar-item-padding-top: 0px !important; - } - .VPSidebarItem .item, - .VPSidebarItem .VPLink, - .VPSidebarItem .link, - .VPSidebarItem .text { - padding-top: 1px !important; - padding-bottom: 1px !important; - min-height: unset !important; - line-height: 1.2 !important; - font-size: 13px !important; - } - .VPSidebarItem.level-0 { padding-bottom: 4px !important; } - .VPSidebarItem.level-0 > .item { padding-top: 3px !important; padding-bottom: 3px !important; } - .VPSidebarItem.level-0 > .item .text { font-weight: 600 !important; font-size: 14px !important; } - .VPSidebarItem.level-1 .item, - .VPSidebarItem.level-2 .item, - .VPSidebarItem.level-3 .item, - .VPSidebarItem.level-4 .item { padding-top: 0px !important; padding-bottom: 0px !important; } - .VPSidebarItem .VPLink { display: flex !important; align-items: center !important; min-height: 20px !important; } - .VPSidebarGroup { padding-top: 2px !important; padding-bottom: 2px !important; } - .VPSidebarItem .indicator { height: 10px !important; width: 3px !important; top: 50% !important; transform: translateY(-50%) !important; } - `] + ['link', { rel: 'stylesheet', href: '/style.css' }] ], themeConfig: { logo: '/logo.png', diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js index 6067272..2c7c5e4 100644 --- a/docs/.vitepress/theme/index.js +++ b/docs/.vitepress/theme/index.js @@ -4,7 +4,7 @@ import 'viewerjs/dist/viewer.css' import TypeIt from 'typeit' import { onMounted, watch, nextTick } from 'vue' import { useRoute, useData } from 'vitepress' -import './style.css?v=20260112' // 强制刷新缓存 +import './style.css' export default { extends: DefaultTheme, diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index ab27e8a..918fbe0 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -5,38 +5,53 @@ /* 减少一级标题(如"前端开发")底部的间距 */ .VPSidebarItem.level-0 { - padding-bottom: 4px; + padding-bottom: 4px !important; } /* 减少一级标题文字与下方子菜单的间距 */ .VPSidebarItem.level-0 > .item { - padding-bottom: 2px; + padding-bottom: 2px !important; } -/* 调整子菜单项之间的间距 */ -.VPSidebarItem.level-1 .item { - padding: 2px 0; +/* 调整子菜单项之间的间距 - 针对所有层级 */ +.VPSidebarItem.level-1 .item, +.VPSidebarItem.level-2 .item, +.VPSidebarItem.level-3 .item, +.VPSidebarItem.level-4 .item { + padding-top: 2px !important; + padding-bottom: 2px !important; + min-height: 24px !important; /* 强制减小最小高度 */ } /* 针对可能存在的特定类名进行覆盖,确保紧凑 */ .VPSidebarGroup { - padding-top: 6px; - padding-bottom: 6px; + padding-top: 6px !important; + padding-bottom: 6px !important; } /* 进一步压缩分组标题与第一项之间的间距 */ .VPSidebarItem.level-0 + .VPSidebarItem.level-1 { - margin-top: -2px; + margin-top: -2px !important; } /* 压缩分组标题本身的行高 */ .VPSidebarItem.level-0 .text { - line-height: 1.3; + line-height: 1.3 !important; } /* 压缩子项的行高 */ -.VPSidebarItem.level-1 .text { - line-height: 1.4; +.VPSidebarItem.level-1 .text, +.VPSidebarItem.level-2 .text, +.VPSidebarItem.level-3 .text { + line-height: 1.4 !important; + padding: 0 !important; /* 移除文字本身的内边距 */ +} + +/* 强制链接本身没有额外的边距 */ +.VPSidebarItem .VPLink { + padding-top: 2px !important; + padding-bottom: 2px !important; + min-height: auto !important; } /* 图片高度限制策略:根据长宽比调整最大高度 */