Merge pull request #161 from logseq/css-theme-variables

CSS Theme Migration
pull/645/head
Tienson Qin 2020-10-22 19:57:28 +08:00 committed by GitHub
commit 9711f24a58
7 changed files with 33 additions and 31 deletions

View File

@ -54,7 +54,7 @@
(let [href (if (config/draw? file)
(rfe/href :draw nil {:file (string/replace file (str config/default-draw-directory "/") "")})
(rfe/href :file {:path file-id}))]
[:a.text-gray-700 {:href href}
[:a {:href href}
file])]
[:td [:span.text-gray-500.text-sm
(if (zero? modified-at)

View File

@ -655,7 +655,7 @@
control-show (util/react (rum/cursor *control-show? block-id))
dark? (= "dark" (state/sub :ui/theme))
heading? (= (get (:block/properties block) "heading") "true")]
[:div.hd-control.mr-2.flex.flex-row.items-center
[:div.mr-2.flex.flex-row.items-center
{:style {:height 24
:margin-top (if (and heading? (<= level 6))
(case level
@ -667,7 +667,7 @@
0)
:float "left"}}
[:a.block-control
[:a.block-control.opacity-50.hover:opacity-100
{:id (str "control-" uuid)
:style {:width 14
:height 16

View File

@ -313,11 +313,12 @@
(when (seq links)
(ui/dropdown-with-links
(fn [{:keys [toggle-fn]}]
[:a {:style {:position "absolute"
:right 0
:top 20}
:title "More options"
:on-click toggle-fn}
[:a.opacity-70.hover:opacity-100
{:style {:position "absolute"
:right 0
:top 20}
:title "More options"
:on-click toggle-fn}
(svg/vertical-dots {:class (util/hiccup->class "opacity-50.hover:opacity-100.h-5.w-5")})])
links
{:modal-class (util/hiccup->class
@ -452,7 +453,7 @@
(for [[page modified-at] pages]
(let [encoded-page (util/encode-str page)]
[:tr {:key encoded-page}
[:td [:a.text-gray-700 {:on-click (fn [e]
[:td [:a {:on-click (fn [e]
(util/stop e)
(let [repo (state/get-current-repo)
page (db/pull repo '[*] [:page/name (string/lower-case page)])]

View File

@ -70,8 +70,9 @@
(let [fold? (get state ::fold?)]
[:div
[:div.flex.flex-row.items-center.mb-1
[:a.control {:on-click #(swap! fold? not)
:style {:width "0.75rem"}}
[:a.control.opacity-50.hover:opacity-100
{:on-click #(swap! fold? not)
:style {:width "0.75rem"}}
(when (seq l)
(if @fold?
svg/arrow-down-v2
@ -89,7 +90,7 @@
(rum/defc contents < rum/reactive db-mixins/query
[]
[:div.contents.flex-col.flex.ml-3.mt-2
[:div.contents.flex-col.flex.ml-3
(when-let [contents (db/entity [:page/name "contents"])]
(page/contents-page contents))])
@ -164,7 +165,7 @@
([on-close]
(close nil on-close))
([class on-close]
[:a.close.hover:text-gray-900.text-gray-500.flex.items-center
[:a.close.opacity-50.hover:opacity-100.flex.items-center
(cond-> {:on-click on-close}
class
(assoc :class class))
@ -180,12 +181,12 @@
[:div.flex.flex-col
[:div.flex.flex-row.justify-between
[:div.flex.flex-row.justify-center
[:a.hover:text-gray-900.text-gray-500.flex.items-center.pr-1
[:a.opacity-50.hover:opacity-100.flex.items-center.pr-1
{:on-click #(state/sidebar-block-toggle-collapse! db-id)}
(if collapse?
(svg/caret-right)
(svg/caret-down))]
[:div.ml-1.font-medium
[:div.ml-1
title]]
(close #(state/sidebar-remove-block! idx))]
[:div {:class (if collapse? "hidden" "initial")}
@ -236,12 +237,12 @@
:margin-right -17}}
[:div.flex.flex-row.mb-2 {:key "right-sidebar-settings"}
[:div.mr-4.text-sm
[:a {:on-click (fn [e]
[:a.right-sidebar-button {:on-click (fn [e]
(state/sidebar-add-block! repo "contents" :contents nil))}
(t :right-side-bar/contents)]]
[:div.mr-4.text-sm
[:a {:on-click (fn [_e]
[:a.right-sidebar-button {:on-click (fn [_e]
(state/sidebar-add-block! repo "recent" :recent nil))}
(t :right-side-bar/recent)]]
@ -251,7 +252,7 @@
(t :all-pages)]])
[:div.mr-4.text-sm
[:a {:on-click (fn []
[:a.right-sidebar-button {:on-click (fn []
(when-let [page (get-current-page)]
(state/sidebar-add-block!
repo
@ -262,14 +263,14 @@
[:div.mr-4.text-sm
(let [theme (if dark? "white" "dark")]
[:a {:title (t :right-side-bar/switch-theme theme)
[:a.right-sidebar-button {:title (t :right-side-bar/switch-theme theme)
:on-click (fn []
(state/set-theme! theme))}
(t :right-side-bar/theme (t (keyword theme)))])]
(when-not config/publishing?
[:div.mr-4.text-sm
[:a {:on-click (fn [_e]
[:a.right-sidebar-button {:on-click (fn [_e]
(state/sidebar-add-block! repo "help" :help nil))}
(t :right-side-bar/help)]])]

View File

@ -156,7 +156,7 @@
"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
:clip-rule "evenodd",
:fill-rule "evenodd"}]]]
[:input#search_field.block.w-full.h-full.pr-3.py-2.rounded-md.focus:outline-none.placeholder-gray-500.focus:placeholder-gray-400.sm:text-sm.bg-base-3.sm:bg-transparent
[:input#search_field.block.w-full.h-full.pr-3.py-2.rounded-md.focus:outline-none.placeholder-gray-500.focus:placeholder-gray-400.sm:text-sm.sm:bg-transparent
{:style {:padding-left "2rem"}
:placeholder (t :search)

View File

@ -35,7 +35,7 @@
(defn nav-item
[title href svg-d active? close-modal-fn]
[:a.mb-1.group.flex.items-center.pl-4.py-2.text-base.leading-6.font-medium.text-gray-500.hover:text-gray-200.transition.ease-in-out.duration-150.nav-item
[:a.mb-1.group.flex.items-center.pl-4.py-2.text-base.leading-6.font-medium.hover:text-gray-200.transition.ease-in-out.duration-150.nav-item
{:href href
:on-click close-modal-fn}
[:svg.mr-4.h-6.w-6.group-hover:text-gray-200.group-focus:text-gray-200.transition.ease-in-out.duration-150
@ -270,14 +270,14 @@
[:div {:class (if white? "white-theme" "dark-theme")
:on-click (fn []
(editor-handler/unhighlight-block!))}
[:div.h-screen.flex.overflow-hidden.bg-base-3
[:div.h-screen.flex.overflow-hidden
[:div.md:hidden
[:div.fixed.inset-0.z-30.bg-gray-600.opacity-0.pointer-events-none.transition-opacity.ease-linear.duration-300
{:class (if @open?
"opacity-75 pointer-events-auto"
"opacity-0 pointer-events-none")
:on-click close-fn}]
[:div.fixed.inset-y-0.left-0.flex.flex-col.z-40.max-w-xs.w-full.transform.ease-in-out.duration-300
[:div#left-bar.fixed.inset-y-0.left-0.flex.flex-col.z-40.max-w-xs.w-full.transform.ease-in-out.duration-300
{:class (if @open?
"translate-x-0"
"-translate-x-full")
@ -298,7 +298,7 @@
[:div.flex-1.h-0.overflow-y-auto
(sidebar-nav route-match close-fn)]]]
[:div.flex.flex-col.w-0.flex-1.overflow-hidden
[:div.relative.z-10.flex-shrink-0.flex.bg-base-3.sm:bg-transparent.shadow.sm:shadow-none.h-16.sm:h-12#head
[:div.relative.z-10.flex-shrink-0.flex.sm:bg-transparent.shadow.sm:shadow-none.h-16.sm:h-12#head
[:button#left-menu.px-4.focus:outline-none.md:hidden.menu
{:on-click (fn []
(open-fn)
@ -319,7 +319,7 @@
(when (and (not logged?)
(not config/publishing?))
[:a.text-sm.font-medium.login
[:a.text-sm.font-medium.login.opacity-70.hover:opacity-100
{:href "/login/github"
:on-click (fn []
(storage/remove :git/current-repo))}
@ -331,7 +331,7 @@
(widgets/repos true)]
(when-let [project (and current-repo (state/get-current-project))]
[:a.opacity-50.hover:opacity-100.ml-4
[:a.opacity-70.hover:opacity-100.ml-4
{:title (str (t :go-to) "/" project)
:href (str config/website "/" project)
:target "_blank"}
@ -354,7 +354,7 @@
(if-let [avatar (:avatar me)]
[:img.h-7.w-7.rounded-full
{:src avatar}]
[:div.h-7.w-7.rounded-full.bg-base-2 {:style {:padding 1.5}}
[:div.h-7.w-7.rounded-full.bg-base-2.opacity-70.hover:opacity-100. {:style {:padding 1.5}}
[:a svg/user]])])
(let [logged? (:name me)]
(->>
@ -408,7 +408,7 @@
[:a#download-as-html.hidden]
[:a.hover:text-gray-900.text-gray-500.ml-3.hidden.md:block
[:a.opacity-70.hover:opacity-100.ml-3.hidden.md:block
{:on-click (fn []
(state/toggle-sidebar-open?!))}
(svg/menu)]]]]

View File

@ -56,7 +56,7 @@
(dropdown
content-fn
(fn [{:keys [close-fn] :as state}]
[:div.py-1.rounded-md.shadow-xs.bg-base-3
[:div.py-1.rounded-md.shadow-xs
(when links-header links-header)
(for [{:keys [options title icon]} links]
(let [new-options
@ -400,7 +400,7 @@
[:div.content
[:div.flex-1.flex-row.foldable-title {:on-mouse-over #(reset! control? true)
:on-mouse-out #(reset! control? false)}
[:div.hd-control.flex.flex-row.items-center
[:div.flex.flex-row.items-center
[:a.block-control.opacity-50.hover:opacity-100.mr-2
{:style {:width 14
:height 16