From 16c65daea9812c632872c69e52fe1ed9710e2554 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Sun, 18 Feb 2024 01:23:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=E5=9C=A8=E4=B8=8D=E5=90=8C=E8=AE=BE=E5=A4=87=E7=9A=84?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/plugin-content-update/package.json | 2 +- theme/src/client/components/LocalNav.vue | 18 ++++++++++++++ .../src/client/components/Nav/NavBarExtra.vue | 2 +- theme/src/client/components/Page.vue | 24 +++++++------------ theme/src/client/styles/search.scss | 2 +- theme/src/client/styles/vars.scss | 2 +- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/plugins/plugin-content-update/package.json b/plugins/plugin-content-update/package.json index 169aa61d..cbff24f8 100644 --- a/plugins/plugin-content-update/package.json +++ b/plugins/plugin-content-update/package.json @@ -49,6 +49,6 @@ "VuePress", "vuepress plugin", "content-update", - "vuepress-plugin-plugin-content-update" + "vuepress-plugin-content-update" ] } diff --git a/theme/src/client/components/LocalNav.vue b/theme/src/client/components/LocalNav.vue index f42fd34b..f7e29265 100644 --- a/theme/src/client/components/LocalNav.vue +++ b/theme/src/client/components/LocalNav.vue @@ -41,6 +41,7 @@ const classes = computed(() => { 'local-nav': true, 'fixed': empty.value, 'reached-top': y.value >= navHeight.value, + 'is-blog': page.value.isBlogPost, } }) @@ -98,6 +99,23 @@ const showLocalNav = computed(() => { } @media (min-width: 960px) { + .local-nav.is-blog { + display: none; + } + + .local-nav { + top: var(--vp-nav-height); + width: calc(100% - var(--vp-sidebar-width)); + margin-left: var(--vp-sidebar-width); + border-top: none; + } + + .local-nav .menu { + visibility: hidden; + } +} + +@media (min-width: 1280px) { .local-nav { display: none; } diff --git a/theme/src/client/components/Nav/NavBarExtra.vue b/theme/src/client/components/Nav/NavBarExtra.vue index bd9a3a78..bd2860be 100644 --- a/theme/src/client/components/Nav/NavBarExtra.vue +++ b/theme/src/client/components/Nav/NavBarExtra.vue @@ -33,7 +33,7 @@ const hasExtraContent = computed(

- Appearance + {{ theme.appearanceText || 'Appearance' }}

diff --git a/theme/src/client/components/Page.vue b/theme/src/client/components/Page.vue index d1c2e827..b81fb97e 100644 --- a/theme/src/client/components/Page.vue +++ b/theme/src/client/components/Page.vue @@ -33,7 +33,6 @@ onContentUpdated(() => zoom?.refresh()) >
-
@@ -101,15 +100,6 @@ onContentUpdated(() => zoom?.refresh()) display: none; } -/* .aside-curtain { - position: fixed; - bottom: 0; - z-index: 10; - width: 224px; - height: 32px; - background: linear-gradient(transparent, var(--vp-c-bg) 70%); -} */ - .aside-content { display: flex; flex-direction: column; @@ -150,6 +140,15 @@ onContentUpdated(() => zoom?.refresh()) padding: 32px 32px 0; } + .plume-page .container { + display: flex; + justify-content: center; + } + + .plume-page.is-blog .aside { + display: block; + } + .plume-page:not(.has-sidebar) .container { display: flex; justify-content: center; @@ -162,11 +161,6 @@ onContentUpdated(() => zoom?.refresh()) } @media (min-width: 1280px) { - .plume-page .container { - display: flex; - justify-content: center; - } - .plume-page .aside { display: block; } diff --git a/theme/src/client/styles/search.scss b/theme/src/client/styles/search.scss index 32322e37..cc6c9f7c 100644 --- a/theme/src/client/styles/search.scss +++ b/theme/src/client/styles/search.scss @@ -164,7 +164,7 @@ /* plugin-search */ .navbar-search .search-box input { - padding: 0 0.4rem 0 1.555rem; + padding: 0 0.3rem 0 1.655rem; background-position: 0.5rem 0.4rem; } diff --git a/theme/src/client/styles/vars.scss b/theme/src/client/styles/vars.scss index 93621e65..e7077e1d 100644 --- a/theme/src/client/styles/vars.scss +++ b/theme/src/client/styles/vars.scss @@ -588,7 +588,7 @@ html[lang="zh-CN"] { --search-item-focus-bg-color: var(--vp-c-bg-alt); --search-input-width: 8rem; --search-result-width: 20rem; - --search-border-color: var(--vp-c-divider); + --search-border-color: transparent; --search-accent-color: var(--vp-c-brand-1); }