mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
fix: the issue where the auto theme is invalid due to an incorrect class setting (#5194)
This commit is contained in:
parent
8fc708be97
commit
409e90d2c5
@ -32,6 +32,9 @@ export const useTheme = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const updateTheme = (theme: string) => {
|
const updateTheme = (theme: string) => {
|
||||||
|
if (theme === 'auto') {
|
||||||
|
theme = prefersDark.matches ? 'dark' : 'light';
|
||||||
|
}
|
||||||
const body = document.documentElement as HTMLElement;
|
const body = document.documentElement as HTMLElement;
|
||||||
body.setAttribute('class', theme);
|
body.setAttribute('class', theme);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user