-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Description
Version
Vben Admin V5
Describe the bug?
设置了单一主题也会被系统主题影响,是不是加个判断,仅在mode为auto时自动切换
// 监听系统主题偏好设置变化
window
.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', ({ matches: isDark }) => {
this.updatePreferences({
theme: { mode: isDark ? 'dark' : 'light' },
});
});
Reproduction
设置theme: light,手动切换电脑系统主题为暗色,系统变更为暗色
期望:mode !== 'auto' 页面不受系统主题影响
System Info
System:
OS: macOS 13.5.2
CPU: (12) arm64 Apple M2 Pro
Memory: 110.42 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
pnpm: 9.12.2 - ~/.nvm/versions/node/v20.16.0/bin/pnpm
Watchman: 2024.11.18.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 135.0.7049.85
Safari: 16.6
Relevant log output
Validations
- Read the docs
- Ensure the code is up to date. (Some issues have been fixed in the latest version)
- I have searched the existing issues and checked that my issue does not duplicate any existing issues.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.