From 49a92f466ab590e969b385c8bf4b754cbc29e6b9 Mon Sep 17 00:00:00 2001 From: sanbuphy Date: Mon, 12 Jan 2026 19:49:21 +0800 Subject: [PATCH] style(docs): adjust sidebar spacing and typography for better readability Improve sidebar navigation spacing and line heights to enhance visual hierarchy and readability. Move CSS from external file to inline style in config for better maintainability. --- docs/.vitepress/config.mjs | 49 +++++++++++++++++++++++++++++++++- docs/.vitepress/theme/index.js | 1 + 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index f3c4a1d..ec225c4 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -6,7 +6,54 @@ export default defineConfig({ description: 'Easy-Vibe 中文实战课 - 零基础学会用 AI 干实际工作', head: [ ['link', { rel: 'icon', href: '/logo.png' }], - ['link', { rel: 'stylesheet', href: '/style.css' }] + [ + 'style', + {}, + ` + :root { + --vp-sidebar-nav-section-gap: 8px; + } + .VPSidebarItem.level-0 { + padding-bottom: 4px !important; + } + .VPSidebarItem.level-0 > .item { + padding-bottom: 2px !important; + } + .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 !important; + padding-bottom: 6px !important; + } + .VPSidebarItem.level-0 + .VPSidebarItem.level-1 { + margin-top: -2px !important; + } + .VPSidebarItem.level-0 .text { + line-height: 1.3 !important; + } + .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; + } + .VPSidebarItem .item { + padding-top: 2px !important; + padding-bottom: 2px !important; + } + ` + ] ], themeConfig: { logo: '/logo.png', diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js index dcff46d..2c7c5e4 100644 --- a/docs/.vitepress/theme/index.js +++ b/docs/.vitepress/theme/index.js @@ -4,6 +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' export default { extends: DefaultTheme,