From e56b300aa0f5647fdc76a0a53abf2aab087dca09 Mon Sep 17 00:00:00 2001 From: Charlie Date: Tue, 5 Dec 2023 22:52:43 +0800 Subject: [PATCH] fix(ui): theme color related issues (#10638) * fix(ui): accent color doesn't apply to block references link #10619 * enhance(ui): polish details for the keymaps setting --- src/main/frontend/colors.cljs | 1 + src/main/frontend/components/settings.cljs | 2 +- src/main/frontend/components/settings.css | 2 +- src/main/frontend/components/shortcut.cljs | 16 +++++++++------- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/frontend/colors.cljs b/src/main/frontend/colors.cljs index 548fadb5a38..acc4d325aea 100644 --- a/src/main/frontend/colors.cljs +++ b/src/main/frontend/colors.cljs @@ -30,6 +30,7 @@ "--ls-quaternary-background-color: var(--rx-" (name gray) "-04); " "--ls-link-text-color: var(--rx-" (name color) "-11); " "--ls-link-text-hover-color: var(--rx-" (name color) "-12); " + "--ls-block-ref-link-text-color: var(--rx-" (name color) "-09);" "--ls-secondary-text-color: var(--rx-" (name gray) "-12); " "--ls-primary-text-color: var(--rx-" (name gray) "-11); " "--ls-border-color: var(--rx-" (name gray) "-05); " diff --git a/src/main/frontend/components/settings.cljs b/src/main/frontend/components/settings.cljs index d9444a5e8ec..81f2d8fcc7c 100644 --- a/src/main/frontend/components/settings.cljs +++ b/src/main/frontend/components/settings.cljs @@ -1124,7 +1124,7 @@ [:div#settings.cp__settings-main (settings-effect @*active) - [:div.cp__settings-inner {:class "min-h-[65dvh] max-h-[65dvh]"} + [:div.cp__settings-inner {:class "min-h-[65dvh] max-h-[70dvh]"} [:aside.md:w-64 {:style {:min-width "10rem"}} [:header.cp__settings-header [:h1.cp__settings-modal-title (t :settings)]] diff --git a/src/main/frontend/components/settings.css b/src/main/frontend/components/settings.css index 3b6989bb8b9..481f523c2ac 100644 --- a/src/main/frontend/components/settings.css +++ b/src/main/frontend/components/settings.css @@ -481,7 +481,7 @@ svg.cmd { body[data-settings-tab=keymap] { .cp__settings-inner { > article { - @apply p-0; + @apply p-0 lg:w-[680px]; > header { @apply p-4 pb-2 h-auto; diff --git a/src/main/frontend/components/shortcut.cljs b/src/main/frontend/components/shortcut.cljs index 567f61d58a0..d374a0ad622 100644 --- a/src/main/frontend/components/shortcut.cljs +++ b/src/main/frontend/components/shortcut.cljs @@ -15,8 +15,7 @@ [frontend.util :as util] [frontend.modules.shortcut.utils :as shortcut-utils] [frontend.modules.shortcut.config :as shortcut-config] - [logseq.shui.core :as shui] - [frontend.shui :refer [make-shui-context]]) + [logseq.shui.core :as shui]) (:import [goog.events KeyHandler])) (defonce categories @@ -152,9 +151,13 @@ (rum/defc shortcut-desc-label [id binding-map] - (when-let [id' (and id binding-map (some-> (str id) (string/replace "plugin." "")))] - [:span {:title (str id' "#" (some-> (:handler-id binding-map) (name)))} - [:span.pl-1 (dh/get-shortcut-desc (assoc binding-map :id id))]])) + (when-let [id' (and id binding-map (str id))] + (let [plugin? (string/starts-with? id' ":plugin.") + id' (if plugin? (some-> id' (string/replace "plugin." "")) id') + plugin-id (when plugin? (namespace id))] + [:span {:title (str id' "#" (some-> (:handler-id binding-map) (name)))} + [:span.px-1 (dh/get-shortcut-desc (assoc binding-map :id id))] + (when plugin? [:code plugin-id])]))) (defn- open-customize-shortcut-dialog! [id] @@ -473,5 +476,4 @@ (not unset?) [:code.flex.items-center.bg-transparent (shui/shortcut-v1 (string/join " | " (map #(dh/binding-for-display id %) binding)) - (make-shui-context) - {:size :md})])]]))))])])]])) + nil {:size :md})])]]))))])])]]))