mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: sync Bilibili Evolved mode with BewlyBewly dark/light mode switch #26
This commit is contained in:
@@ -23,11 +23,15 @@ const [showSettings, toggleSettings] = useToggle(false)
|
||||
const isDark = useDark({
|
||||
onChanged: (isDark: boolean) => {
|
||||
if (isDark) {
|
||||
document.querySelector('html')?.classList.add('dark')
|
||||
document.documentElement.classList.add('dark')
|
||||
// Adjust Bilibili Evolved to dark mode when switching to dark mode
|
||||
document.body.classList.add('dark')
|
||||
document.querySelector('#bewly')?.classList.add('dark')
|
||||
}
|
||||
else {
|
||||
document.querySelector('html')?.classList.remove('dark')
|
||||
document.documentElement.classList.remove('dark')
|
||||
// Adjust Bilibili Evolved to light mode when switching to light mode
|
||||
document.body.classList.remove('dark')
|
||||
document.querySelector('#bewly')?.classList.remove('dark')
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user