mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: support dark mode for Bilibili Evolved settings panel & top bar popups
This commit is contained in:
@@ -57,6 +57,9 @@ export function useDark() {
|
||||
if (isDark.value) {
|
||||
document.querySelector('#bewly')?.classList.add('dark')
|
||||
document.documentElement.classList.add('dark')
|
||||
nextTick(() => {
|
||||
document.body.classList.add('dark')
|
||||
})
|
||||
// bili_dark is bilibili's official dark mode class
|
||||
document.documentElement.classList.add('bili_dark')
|
||||
|
||||
@@ -66,6 +69,9 @@ export function useDark() {
|
||||
else {
|
||||
document.querySelector('#bewly')?.classList.remove('dark')
|
||||
document.documentElement.classList.remove('dark')
|
||||
nextTick(() => {
|
||||
document.body.classList.remove('dark')
|
||||
})
|
||||
document.documentElement.classList.remove('bili_dark')
|
||||
|
||||
setCookie('theme_style', 'light', 365 * 10)
|
||||
|
||||
Reference in New Issue
Block a user