mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 08:11:39 +02:00
Add active theme toggling
This commit is contained in:
parent
f0e0e9334e
commit
9a745ea8bc
7 changed files with 46 additions and 5 deletions
|
@ -118,6 +118,16 @@
|
|||
theme))
|
||||
:else changes)))
|
||||
|
||||
(defn toggle-token-theme [token-theme-id]
|
||||
(ptk/reify ::toggle-token-theme
|
||||
ptk/WatchEvent
|
||||
(watch [it state _]
|
||||
(let [themes (wtts/get-active-theme-ids state)
|
||||
new-themes (wtts/toggle-active-theme-id token-theme-id state)
|
||||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/update-active-token-themes new-themes themes))]
|
||||
(rx/of (dch/commit-changes changes))))))
|
||||
|
||||
(defn create-token-set [token-set]
|
||||
(let [new-token-set (merge
|
||||
{:id (uuid/next)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue