mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 16:37:16 +02:00
✨ Add css variables and theme switch
This commit is contained in:
parent
b77f85b697
commit
adffdb31f3
42 changed files with 225 additions and 60 deletions
|
@ -58,10 +58,10 @@
|
|||
(.setAttribute (.querySelector js/document "html") "lang" lang))
|
||||
|
||||
(defn set-html-theme-color
|
||||
[^string color scheme]
|
||||
(let [meta-node (.querySelector js/document "meta[name='theme-color']")]
|
||||
(.setAttribute meta-node "content" color)
|
||||
(.setAttribute meta-node "media" (str/format "(prefers-color-scheme: %s)" scheme))))
|
||||
[^string color]
|
||||
(let [node (.querySelector js/document "body")]
|
||||
(.removeAttribute node "class")
|
||||
(.add ^js (.-classList ^js node) color)))
|
||||
|
||||
(defn set-page-style!
|
||||
[styles]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue