From 29191d0bdc25182566961b62ca3796f733f69417 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 22 Oct 2020 19:56:41 +0800 Subject: [PATCH] More css tweaks --- web/src/main/frontend/components/hiccup.cljs | 4 ++-- web/src/main/frontend/components/page.cljs | 11 ++++++----- web/src/main/frontend/components/right_sidebar.cljs | 13 +++++++------ web/src/main/frontend/components/sidebar.cljs | 8 ++++---- web/src/main/frontend/ui.cljs | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/web/src/main/frontend/components/hiccup.cljs b/web/src/main/frontend/components/hiccup.cljs index 589239071..a4389693f 100644 --- a/web/src/main/frontend/components/hiccup.cljs +++ b/web/src/main/frontend/components/hiccup.cljs @@ -652,7 +652,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 @@ -664,7 +664,7 @@ 0) :float "left"}} - [:a.block-control + [:a.block-control.opacity-50.hover:opacity-100 {:id (str "control-" uuid) :style {:width 14 :height 16 diff --git a/web/src/main/frontend/components/page.cljs b/web/src/main/frontend/components/page.cljs index 02421e6cd..011c75d3a 100644 --- a/web/src/main/frontend/components/page.cljs +++ b/web/src/main/frontend/components/page.cljs @@ -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 diff --git a/web/src/main/frontend/components/right_sidebar.cljs b/web/src/main/frontend/components/right_sidebar.cljs index d5419a930..f83399fd6 100644 --- a/web/src/main/frontend/components/right_sidebar.cljs +++ b/web/src/main/frontend/components/right_sidebar.cljs @@ -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")} diff --git a/web/src/main/frontend/components/sidebar.cljs b/web/src/main/frontend/components/sidebar.cljs index 11005fb0b..cbd0902df 100644 --- a/web/src/main/frontend/components/sidebar.cljs +++ b/web/src/main/frontend/components/sidebar.cljs @@ -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:.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)]]]] diff --git a/web/src/main/frontend/ui.cljs b/web/src/main/frontend/ui.cljs index 70c5f4c3c..fa9591091 100644 --- a/web/src/main/frontend/ui.cljs +++ b/web/src/main/frontend/ui.cljs @@ -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