mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 08:37:23 +00:00
style(Tabbar): adjust text color
This commit is contained in:
@@ -75,7 +75,16 @@ export function syncThemeToChild(theme) {
|
||||
}
|
||||
|
||||
export function getDefaultTheme() {
|
||||
return window.localStorage.getItem('vantTheme') || 'light';
|
||||
const cache = window.localStorage.getItem('vantTheme');
|
||||
|
||||
if (cache) {
|
||||
return cache;
|
||||
}
|
||||
|
||||
const useDark =
|
||||
window.matchMedia &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
return useDark ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
export function useCurrentTheme() {
|
||||
|
Reference in New Issue
Block a user