From af8b250e83c688fc08040ee627aa615e11ab2702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Mon, 26 Feb 2024 23:14:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20lang=20switch=20model=20patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/styles/index.scss | 2 ++ docs/.vuepress/styles/patch-lang-switch.scss | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 docs/.vuepress/styles/patch-lang-switch.scss diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index 87c7e5129..77f6b0d8a 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -1,3 +1,5 @@ +@import "patch-lang-switch"; + // place your custom styles here header.vp-navbar { // 隐藏导航栏和导航栏菜单外链图标 diff --git a/docs/.vuepress/styles/patch-lang-switch.scss b/docs/.vuepress/styles/patch-lang-switch.scss new file mode 100644 index 000000000..0a825112c --- /dev/null +++ b/docs/.vuepress/styles/patch-lang-switch.scss @@ -0,0 +1,19 @@ +// 当站点 url 语言与当前语言不一致时,会弹出提示框 +// 该功能由插件 @vuepress/plugin-redirect 提供 +// 对于组件 class https://github.com/vuepress/ecosystem/blob/main/plugins/plugin-redirect/src/client/styles/language-switch.scss +// 对于组件 var https://github.com/vuepress/ecosystem/blob/main/plugins/plugin-redirect/src/client/styles/vars.css +// 由于在 class 文件中定义的变量未在 var 文件中定义,导致确认的第一个按钮不可见 +// 故本文件对 class 文件进行补充定义,并增加了提示框在深色模式下的背景色 + +// 由于以下两个变量未定义,导致确认的第一个按钮不可见 +:root { + --redirect-primary-color: var(--theme-color-light); + --redirect-primary-hover-color: var(--theme-color-dark); +} + +// 提示框在深色模式下的背景色 +html[data-theme=dark] { + .lang-modal-wrapper { + background: var(--bg-color); + } +} \ No newline at end of file