mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Move theme and color scheme setting to the documentElement
In theory this is more correct and could help with issues of color-scheme not being set correctly in the reader on iOS and Android.
This commit is contained in:
parent
a1952fb9e7
commit
0a147b744d
6 changed files with 9 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
|
@ -116,6 +116,7 @@ struct WebReader: PlatformViewRepresentable {
|
|||
(webView as? OmnivoreWebView)?.updateJustifyText()
|
||||
|
||||
webView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.tintColor = UIColor.black
|
||||
webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor)
|
||||
webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ?
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -288,6 +288,9 @@ const blackThemeSpec = {
|
|||
}
|
||||
|
||||
const sepiaThemeSpec = {
|
||||
colorScheme: {
|
||||
colorScheme: 'light',
|
||||
},
|
||||
colors: {
|
||||
readerBg: '#FBF0D9',
|
||||
readerFont: '#5F4B32',
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export function updateThemeLocally(themeId: string): void {
|
|||
window.localStorage.setItem(themeKey, themeId)
|
||||
}
|
||||
|
||||
document.body.classList.remove(
|
||||
document.documentElement.classList.remove(
|
||||
...Object.keys(LEGACY_THEMES),
|
||||
sepiaTheme,
|
||||
darkTheme,
|
||||
|
|
@ -52,7 +52,7 @@ export function updateThemeLocally(themeId: string): void {
|
|||
blackTheme,
|
||||
...Object.keys(ThemeId)
|
||||
)
|
||||
document.body.classList.add(getTheme(themeId))
|
||||
document.documentElement.classList.add(getTheme(themeId))
|
||||
}
|
||||
|
||||
export function currentThemeName(): string {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
}
|
||||
|
||||
:root {
|
||||
color-scheme: var(--colorScheme-colorScheme);
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
.speakingSection {
|
||||
|
|
|
|||
Loading…
Reference in a new issue