mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: prevent style conflicts with Bilibili Evolved dark mode
This commit is contained in:
@@ -128,10 +128,20 @@ if (isSupportedPages() || isSupportedIframePages()) {
|
||||
if (settings.value.adaptToOtherPageStyles)
|
||||
useDark()
|
||||
|
||||
if (settings.value.adaptToOtherPageStyles)
|
||||
if (settings.value.adaptToOtherPageStyles) {
|
||||
document.documentElement.classList.add('bewly-design')
|
||||
else
|
||||
|
||||
// Remove the Bilibili Evolved's dark mode style
|
||||
runWhenIdle(async () => {
|
||||
const darkModeStyle = document.head.querySelector('#dark-mode')
|
||||
if (darkModeStyle)
|
||||
document.head.removeChild(darkModeStyle)
|
||||
})
|
||||
}
|
||||
|
||||
else {
|
||||
document.documentElement.classList.remove('bewly-design')
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.value.adaptToOtherPageStyles && isHomePage()) {
|
||||
|
||||
Reference in New Issue
Block a user