!91 支持 tailwindcss 深色模式

Merge pull request !91 from lbw/N/A
This commit is contained in:
lbw 2024-09-12 03:53:57 +00:00 committed by Gitee
commit e3d35eb9c3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -553,8 +553,14 @@ const onAddFilterChange = (attr: string) => {
// 4 -->
const onAddDarkChange = () => {
const body = document.documentElement as HTMLElement;
if (getThemeConfig.value.isIsDark) body.setAttribute('data-theme', 'dark');
else body.setAttribute('data-theme', '');
if (getThemeConfig.value.isIsDark) {
body.setAttribute('data-theme', 'dark');
// body dark : true class ,tailwindcss
body.classList.add('dark');
} else {
body.classList.remove('dark');
body.setAttribute('data-theme', '');
}
};
// 4 -->
const onWartermarkChange = () => {