|
|
@@ -332,33 +332,26 @@
|
|
|
:action pick-theme
|
|
|
:desc (ui/render-keyboard-shortcut (shortcut-helper/gen-shortcut-seq :ui/toggle-theme))})))
|
|
|
|
|
|
-(defn accent-color-row []
|
|
|
+(defn accent-color-row [_in-modal?]
|
|
|
(let [color-accent (state/sub :ui/radix-color)
|
|
|
- pick-theme [:div.grid {:style {:grid-template-columns "repeat(5, 1fr)"
|
|
|
- :gap "0.75rem"
|
|
|
- :width "100%"
|
|
|
- :max-width "16rem"}}
|
|
|
+ pick-theme [:div.cp__accent-colors-list-wrap
|
|
|
+ {:class (if _in-modal? "as-modal-picker" "")}
|
|
|
(for [color (concat [:none :logseq] colors/color-list)
|
|
|
:let [active? (= color color-accent)]]
|
|
|
[:div.flex.items-center {:style {:height 28}}
|
|
|
- [:div {:class "w-5 h-5 rounded-full flex justify-center items-center transition ease-in duration-100 hover:cursor-pointer hover:opacity-100"
|
|
|
- :title color
|
|
|
- :style {:background-color (colors/variable color :09)
|
|
|
- :outline-color (colors/variable color (if active? :07 :06))
|
|
|
- :outline-width (if active? "4px" "1px")
|
|
|
- :outline-style :solid
|
|
|
- :opacity (if active? 1 0.5)}
|
|
|
- :on-click (fn [_e] (state/set-color-accent! color))}
|
|
|
- [:div {:class "w-2 h-2 rounded-full transition ease-in duration-100"
|
|
|
- :style {:background-color (str "var(--rx-" (name color) "-07)")
|
|
|
- :opacity (if active? 1 0)}}]]])
|
|
|
- (when color-accent
|
|
|
- [:div.col-span-5
|
|
|
- (shui-ui/button
|
|
|
- {:variant :secondary
|
|
|
- :size :xs
|
|
|
- :on-click (fn [_e] (state/unset-color-accent!))}
|
|
|
- "Back to default color")])]]
|
|
|
+ [:div
|
|
|
+ {:class "w-5 h-5 rounded-full flex justify-center items-center transition ease-in duration-100 hover:cursor-pointer hover:opacity-100"
|
|
|
+ :title color
|
|
|
+ :tab-index -1
|
|
|
+ :style {:background-color (colors/variable color :09)
|
|
|
+ :outline-color (colors/variable color (if active? :07 :06))
|
|
|
+ :outline-width (if active? "4px" "1px")
|
|
|
+ :outline-style :solid
|
|
|
+ :opacity (if active? 1 0.5)}
|
|
|
+ :on-click (fn [_e] (state/set-color-accent! color))}
|
|
|
+ [:span {:class "w-2 h-2 rounded-full transition ease-in duration-100"
|
|
|
+ :style {:background-color (str "var(--rx-" (name color) "-07)")
|
|
|
+ :opacity (if active? 1 0)}}]]])]]
|
|
|
|
|
|
[:<>
|
|
|
(row-with-button-action {:left-label "Accent color"
|
|
|
@@ -370,7 +363,7 @@
|
|
|
(rum/defc modal-accent-colors-inner
|
|
|
[]
|
|
|
[:div.cp__settings-accent-colors-modal-inner
|
|
|
- (accent-color-row)])
|
|
|
+ (accent-color-row true)])
|
|
|
|
|
|
(defn file-format-row [t preferred-format]
|
|
|
[:div.it.sm:grid.sm:grid-cols-3.sm:gap-4.sm:items-center
|
|
|
@@ -708,7 +701,7 @@
|
|
|
(language-row t preferred-language)
|
|
|
(theme-modes-row t switch-theme system-theme? dark?)
|
|
|
(when (and (util/electron?) (not util/mac?)) (native-titlebar-row t))
|
|
|
- (when show-radix-themes? (accent-color-row))
|
|
|
+ (when show-radix-themes? (accent-color-row false))
|
|
|
(when (config/global-config-enabled?) (edit-global-config-edn))
|
|
|
(when current-repo (edit-config-edn))
|
|
|
(when current-repo (edit-custom-css))
|