From 5a74a66ef7b109ba22fd0b0201a4a42db63b56dd Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Sat, 30 Dec 2023 11:57:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E3=80=81=E5=86=85=E5=AE=B9=E5=AE=B9=E5=99=A8=E5=86=85=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=9D=97=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/2.preview/主题效果预览.md | 27 +++++++++++++++++++ theme/src/client/components/BlogExtract.vue | 6 +++++ theme/src/client/components/LocalNav.vue | 6 +++++ .../client/components/Nav/NavBarSearch.vue | 10 +++++++ theme/src/client/styles/_variables.scss | 4 --- theme/src/client/styles/md-enhance.scss | 7 ++++- theme/src/client/styles/vars.scss | 2 +- 7 files changed, 56 insertions(+), 6 deletions(-) diff --git a/docs/2.preview/主题效果预览.md b/docs/2.preview/主题效果预览.md index 1af82946..5e6d8142 100644 --- a/docs/2.preview/主题效果预览.md +++ b/docs/2.preview/主题效果预览.md @@ -44,6 +44,13 @@ _斜体文字_ 数学表达式: $-(2^{n-1})$ ~ $2^{n-1} -1$ +$\frac {\partial^r} {\partial \omega^r} \left(\frac {y^{\omega}} {\omega}\right) += \left(\frac {y^{\omega}} {\omega}\right) \left\{(\log y)^r + \sum_{i=1}^r \frac {(-1)^ Ir \cdots (r-i+1) (\log y)^{ri}} {\omega^i} \right\}$ + +19^th^ + +H~2~O + ::: center 内容居中 ::: @@ -167,18 +174,38 @@ function foo() { ::: tip 提示 提示内容 +```js +const a = 1 +const b = 2 +const c = a + b +``` ::: ::: warning 警告 警告内容 +```js +const a = 1 +const b = 2 +const c = a + b +``` ::: ::: caution 错误 错误内容 +```js +const a = 1 +const b = 2 +const c = a + b +``` ::: ::: important 重要 重要内容 +```js +const a = 1 +const b = 2 +const c = a + b +``` ::: ::: info diff --git a/theme/src/client/components/BlogExtract.vue b/theme/src/client/components/BlogExtract.vue index a07870b7..8bec0828 100644 --- a/theme/src/client/components/BlogExtract.vue +++ b/theme/src/client/components/BlogExtract.vue @@ -111,6 +111,12 @@ const showBlogExtract = computed(() => { } } +@media print { + .blog-extract { + display: none; + } +} + .blog-modal { position: fixed; top: 0; diff --git a/theme/src/client/components/LocalNav.vue b/theme/src/client/components/LocalNav.vue index d1782597..024eced5 100644 --- a/theme/src/client/components/LocalNav.vue +++ b/theme/src/client/components/LocalNav.vue @@ -99,6 +99,12 @@ const showLocalNav = computed(() => { } } +@media print { + .local-nav { + display: none; + } +} + .menu { display: flex; align-items: center; diff --git a/theme/src/client/components/Nav/NavBarSearch.vue b/theme/src/client/components/Nav/NavBarSearch.vue index e8860b46..6034c418 100644 --- a/theme/src/client/components/Nav/NavBarSearch.vue +++ b/theme/src/client/components/Nav/NavBarSearch.vue @@ -23,6 +23,7 @@ } } +/* plugin-docsearch */ .DocSearch { --docsearch-primary-color: var(--vp-c-brand-1); --docsearch-highlight-color: var(--docsearch-primary-color); @@ -211,4 +212,13 @@ .dark .DocSearch-Form { background-color: var(--vp-c-bg-soft); } + +/* plugin-docsearch */ + +/* plugin-search */ +.navbar-search .search-box input { + padding: 0 0.3rem 0 1.575rem; + background-position: 0.5rem 0.4rem; +} +/* plugin-search */ diff --git a/theme/src/client/styles/_variables.scss b/theme/src/client/styles/_variables.scss index f66580e6..12f61127 100644 --- a/theme/src/client/styles/_variables.scss +++ b/theme/src/client/styles/_variables.scss @@ -1,5 +1 @@ @import '@vuepress/plugin-palette/palette'; - -$codeLang: 'c' 'cpp' 'cs' 'dart' 'docker' 'fs' 'go' 'java' 'kt' 'makefile' 'css' - 'less' 'sass' 'scss' 'styl' 'html' 'js' 'json' 'ts' 'vue' 'jsx' 'md' 'php' - 'py' 'rb' 'rs' 'sh' 'toml' 'yml' !default; diff --git a/theme/src/client/styles/md-enhance.scss b/theme/src/client/styles/md-enhance.scss index cacb5607..e9bbad6e 100644 --- a/theme/src/client/styles/md-enhance.scss +++ b/theme/src/client/styles/md-enhance.scss @@ -87,7 +87,12 @@ } } - &.details code { + &.note code, + &.info code, + &.tip code, + &.warning code, + &.caution code, + &.details, code { background-color: transparent; } diff --git a/theme/src/client/styles/vars.scss b/theme/src/client/styles/vars.scss index 3d7ec04e..aed25288 100644 --- a/theme/src/client/styles/vars.scss +++ b/theme/src/client/styles/vars.scss @@ -543,7 +543,7 @@ html[lang='zh-CN'] { /** Component: Search **/ :root { - --search-bg-color: var(--vp-c-bg-alt); + --search-bg-color: var(--vp-c-default-soft); --search-text-color: var(--vp-c-text-2); --search-item-text-color: var(--vp-c-text-1); --search-item-focus-bg-color: var(--vp-c-bg-alt);