From b034e354213589839daae4bbde52938f5f66d547 Mon Sep 17 00:00:00 2001 From: ykiko Date: Sat, 26 Sep 2026 16:04:22 +0800 Subject: [PATCH] fix(theme): tidy the page bottom on narrow screens - The footer's copyright strip set its text on paper-coloured chips over screentone. Once the strip wrapped on a phone, the dots ran between and around the chips; it is now a plain strip under a dashed rule. - On pages with no sidebar and no headings (home, blog, 404), VitePress pins a bar holding only "Return to top" under the navbar once the page scrolls on narrow screens. It is hidden there; doc pages keep their bar with the sidebar menu and outline. --- .vitepress/theme/components/SiteFooter.vue | 24 +++++----------------- .vitepress/theme/style.css | 8 ++++++++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.vitepress/theme/components/SiteFooter.vue b/.vitepress/theme/components/SiteFooter.vue index c3fe4d17..47cc7eed 100644 --- a/.vitepress/theme/components/SiteFooter.vue +++ b/.vitepress/theme/components/SiteFooter.vue @@ -169,25 +169,15 @@ const other = computed(() => (zh.value ? { text: 'English', href: '/' } : { text text-underline-offset: 3px; } +/* A plain strip: text on screentone turned into a patchwork of paper chips + and dots once it wrapped on narrow screens. */ .bottom { - border-top: var(--line-thin) dashed var(--line-color); - background-image: var(--screentone); - background-size: 8px 8px; -} - -.bottom span, -.bottom a { - display: inline-block; - background: var(--paper-2); - padding: 0 10px; -} - -.bottom { - padding: 14px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; - gap: 8px; + gap: 6px 16px; + padding: 14px 24px; + border-top: var(--line-thin) dashed var(--line-color); font-size: 12px; color: var(--ink-3); } @@ -200,8 +190,4 @@ const other = computed(() => (zh.value ? { text: 'English', href: '/' } : { text .bottom a:hover { color: var(--bow); } - -.dark .bottom { - background-image: none; -} diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index d30f45ea..38824ad9 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -1214,6 +1214,14 @@ html[lang^="zh"] { } } +/* On pages with no sidebar and no headings (home, blog, 404) VitePress pins a + bar holding only "Return to top" once the page scrolls; leave it out. It + marks exactly that case with `fixed` (`empty` alone would also match doc + pages whose bar still carries the sidebar menu). */ +.VPLocalNav.fixed { + display: none; +} + /* --------------------------------------------------------------------------- * Narrow screens: thinner shadows, no side rules * ------------------------------------------------------------------------ */