mirror of
https://github.com/fmhy/edit.git
synced 2026-01-12 23:11:06 +11:00
.
This commit is contained in:
parent
9e6cc5d912
commit
652b01e591
1 changed files with 14 additions and 4 deletions
|
|
@ -77,10 +77,20 @@ export class ThemeHandler {
|
||||||
if (typeof document === 'undefined') return
|
if (typeof document === 'undefined') return
|
||||||
|
|
||||||
const { currentMode, theme } = this.state.value
|
const { currentMode, theme } = this.state.value
|
||||||
if (!theme) {
|
|
||||||
this.applyDOMClasses(currentMode)
|
// Is this the WORST fix of all time???
|
||||||
return
|
const root = document.documentElement
|
||||||
}
|
const bgColor = currentMode === 'dark' && this.amoledEnabled.value ? '#000000' : currentMode === 'dark' ? '#1A1A1A' : '#f8fafc'
|
||||||
|
root.style.setProperty('--vp-c-bg', bgColor)
|
||||||
|
const bgAltColor = currentMode === 'dark' && this.amoledEnabled.value ? '#000000' : currentMode === 'dark' ? '#171717' : '#eef2f5'
|
||||||
|
root.style.setProperty('--vp-c-bg-alt', bgAltColor)
|
||||||
|
const bgElvColor = currentMode === 'dark' && this.amoledEnabled.value ? 'rgba(0, 0, 0, 0.9)' : currentMode === 'dark' ? '#1a1a1acc' : 'rgba(255, 255, 255, 0.8)'
|
||||||
|
root.style.setProperty('--vp-c-bg-elv', bgElvColor)
|
||||||
|
|
||||||
|
this.applyDOMClasses(currentMode)
|
||||||
|
|
||||||
|
if (!theme) return
|
||||||
|
|
||||||
const modeColors = theme.modes[currentMode]
|
const modeColors = theme.modes[currentMode]
|
||||||
|
|
||||||
this.applyDOMClasses(currentMode)
|
this.applyDOMClasses(currentMode)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue