Skip to content

浅色主题时 theme-light 切换为暗黑模式 刷新浏览器 左侧Sidebar 又会变为白色 #12

@xuezejun

Description

@xuezejun

解决方案 如下 修改bgColor 和 textColor
const isDark = useDark({
storageKey: 'useDarkKey',
valueDark: 'dark',
valueLight: 'light'
});
const bgColor = computed(() => {
if (isDark.value) {
return 'var(--menuBg)';
}
return sideTheme.value === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground
});
const textColor = computed(() => {
if (isDark.value) {
return 'var(--sidebar-text)';
}
return sideTheme.value === 'theme-dark' ? variables.menuColor : variables.menuLightColor;
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions