Cleanup styles

This commit is contained in:
Florian Schroedl 2024-08-16 13:59:18 +02:00
parent 6a7ced3204
commit 62712ef8da

View file

@ -173,69 +173,61 @@
selected-theme (get themes-index selected-theme-id) selected-theme (get themes-index selected-theme-id)
selected-token-set-id (mf/deref refs/workspace-selected-token-set-id) selected-token-set-id (mf/deref refs/workspace-selected-token-set-id)
token-sets (mf/deref refs/workspace-token-sets)] token-sets (mf/deref refs/workspace-token-sets)]
(js/console.log "selected-theme" selected-theme)
[:div [:div
{:style {:display "flex" [:style
:flex-direction "column" (str "@scope {"
:gap "10px" (str/join "\n"
:max-height "60vh" ["ul { list-style-type: disk; margin-left: 20px; }"
:overflow "auto" ".spaced { display: flex; gap: 10px; justify-content: space-between; }"
:border-bottom "2px solid grey" ".spaced-y { display: flex; flex-direction: column; gap: 10px }"
:padding "10px" ".selected { font-weight: 600; }"
:margin-bottom "50px"}} "b { font-weight: 600; }"])
"}")]
[:div.spaced-y
{:style {:max-height "60vh"
:overflow "auto"
:border-bottom "2px solid grey"
:padding "10px"
:margin-bottom "50px"}}
(str "Themes (selected: " selected-theme-id ")") [:ul
[:div
[:ul {:style {:list-style "disk"}}
[:& tokene-theme-create] [:& tokene-theme-create]
(for [[group themes] themes] (for [[group themes] themes]
[:li [:li
{:key (str "token-theme-group" group)} {:key (str "token-theme-group" group)}
group group
#_[:ul {:style {:list-style "disk" #_[:ul
:margin-left "20px"}}
(for [{:keys [id] :as theme} themes] (for [{:keys [id] :as theme} themes]
[:li {:key (str "tokene-theme-" id)} [:li {:key (str "tokene-theme-" id)}
[:input {:type "checkbox" [:input {:type "checkbox"
:checked (wtts/theme-selected? theme)}]])]])]] :checked (wtts/theme-selected? theme)}]])]])]
"Sets" [:div.spaced
[:div [:b "Sets"]
{:style {:display "flex" :gap "10px"}} [:button {:on-click #(st/emit! (wdt/create-token-set nil))} "Create"]]
[:button [:ul.spaced-y
{:on-click #(st/emit! (wdt/create-token-set nil))} (for [[_ {:keys [id name]}] token-sets]
"Create"] [:li {:class [(when (= selected-token-set-id id) "selected")]
#_[:button "Delete"]] :on-click (fn []
[:ul (st/emit!
{:style {:list-style "disk" (wdt/set-selected-token-set-id id)
:margin-left "20px" (wtu/update-workspace-tokens)))}
:display "flex" [:div.spaced
:flex-direction "column" name
:gap "10px"}} [:div.spaced
(for [[_ {:keys [id name]}] token-sets] [:button
[:li {:style {:font-weight (when (= selected-token-set-id id) "bold")} {:on-click (fn [e]
:on-click (fn [] (dom/prevent-default e)
(st/emit! (dom/stop-propagation e)
(wdt/set-selected-token-set-id id) (st/emit! (wdt/toggle-token-set id)))}
(wtu/update-workspace-tokens)))} (if (wtts/token-set-enabled-in-theme? id selected-theme)
[:div {:style {:display "flex" "👁️"
:justify-content "space-between"}} "")]
name [:button {:on-click (fn [e]
[:div {:style {:display "flex" (dom/prevent-default e)
:gap "5px"}} (dom/stop-propagation e)
[:button (st/emit! (wdt/delete-token-set id)))}
{:on-click (fn [e] "🗑️"]]]])]
(dom/prevent-default e) [:hr]]]))
(dom/stop-propagation e)
(st/emit! (wdt/toggle-token-set id)))}
(if (wtts/token-set-enabled-in-theme? id selected-theme)
"👁️"
" ")]
[:button {:on-click (fn [e]
(dom/prevent-default e)
(dom/stop-propagation e)
(st/emit! (wdt/delete-token-set id)))}
"🗑️"]]]])]
[:hr]]))
(mf/defc tokens-explorer (mf/defc tokens-explorer
[_props] [_props]