mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): should remove light theme class in dark mode (#11039)
This commit is contained in:
parent
6a9d5515ce
commit
cbbdad909a
@ -27,13 +27,19 @@ export default {
|
||||
document.documentElement.classList.remove(`van-doc-theme-${oldVal}`);
|
||||
document.documentElement.classList.add(`van-doc-theme-${newVal}`);
|
||||
|
||||
const { darkModeClass } = config.site;
|
||||
const { darkModeClass, lightModeClass } = config.site;
|
||||
if (darkModeClass) {
|
||||
document.documentElement.classList.toggle(
|
||||
darkModeClass,
|
||||
newVal === 'dark'
|
||||
);
|
||||
}
|
||||
if (lightModeClass) {
|
||||
document.documentElement.classList.toggle(
|
||||
lightModeClass,
|
||||
newVal === 'light'
|
||||
);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
@ -24,6 +24,7 @@ export default {
|
||||
site: {
|
||||
defaultLang: 'en-US',
|
||||
darkModeClass: 'van-theme-dark',
|
||||
lightModeClass: 'van-theme-light',
|
||||
versions: [
|
||||
{ label: 'v1', link: '/vant/v1/' },
|
||||
{ label: 'v2', link: '/vant/v2/' },
|
||||
|
Loading…
x
Reference in New Issue
Block a user