mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 10:56:32 +00:00
BREAKING CHANGE: unify light mode identifier (#4652)
* chore: unify light mode identifier Signed-off-by: Yue Yang <g1enyy0ung@gmail.com> Co-authored-by: charlie <xyhp915@qq.com> Co-authored-by: Andelf <andelf@gmail.com>
This commit is contained in:
@@ -892,7 +892,7 @@
|
||||
[theme]
|
||||
(set-state! :ui/theme theme)
|
||||
(when (mobile-util/native-ios?)
|
||||
(if (= theme "white")
|
||||
(if (= theme "light")
|
||||
(util/set-theme-light)
|
||||
(util/set-theme-dark)))
|
||||
(storage/set :ui/theme theme))
|
||||
@@ -900,7 +900,7 @@
|
||||
(defn sync-system-theme!
|
||||
[]
|
||||
(let [system-dark? (.-matches (js/window.matchMedia "(prefers-color-scheme: dark)"))]
|
||||
(set-theme! (if system-dark? "dark" "white"))
|
||||
(set-theme! (if system-dark? "dark" "light"))
|
||||
(set-state! :ui/system-theme? true)
|
||||
(storage/set :ui/system-theme? true)))
|
||||
|
||||
@@ -908,7 +908,7 @@
|
||||
[theme-mode]
|
||||
(if-not (= theme-mode "system")
|
||||
(do
|
||||
(set-theme! (if (= theme-mode "light") "white" theme-mode))
|
||||
(set-theme! theme-mode)
|
||||
(set-state! :ui/system-theme? false)
|
||||
(storage/set :ui/system-theme? false))
|
||||
(sync-system-theme!)))
|
||||
@@ -924,7 +924,7 @@
|
||||
(defn toggle-theme!
|
||||
[]
|
||||
(let [theme (:ui/theme @state)
|
||||
theme' (if (= theme "dark") "white" "dark")]
|
||||
theme' (if (= theme "dark") "light" "dark")]
|
||||
(use-theme-mode! theme')))
|
||||
|
||||
(defn set-root-component!
|
||||
|
||||
Reference in New Issue
Block a user