Browse Source

Merge pull request #2110 from pengx17/adapt-theme-mode

feat: adapt correct light theme mode for plugins
Charlie 4 years ago
parent
commit
b1c60bdae4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/main/frontend/components/theme.cljs
  2. 1 1
      src/main/logseq/api.cljs

+ 1 - 1
src/main/frontend/components/theme.cljs

@@ -15,7 +15,7 @@
       (if (= theme "dark")                                 ;; for tailwind dark mode
         (.add cls "dark")
         (.remove cls "dark"))
-      (plugin-handler/hook-plugin-app :theme-mode-changed {:mode theme} nil))
+      (plugin-handler/hook-plugin-app :theme-mode-changed {:mode (if (= theme "white") "light" theme)} nil))
    [theme])
 
   (rum/use-effect!

+ 1 - 1
src/main/logseq/api.cljs

@@ -54,7 +54,7 @@
     (bean/->js
       (normalize-keyword-for-json
         {:preferred-language   (:preferred-language @state/state)
-         :preferred-theme-mode (:ui/theme @state/state)
+         :preferred-theme-mode (if (= (:ui/theme @state/state) "light") "white" "dark")
          :preferred-format     (state/get-preferred-format)
          :preferred-workflow   (state/get-preferred-workflow)
          :preferred-todo       (state/get-preferred-todo)