mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
Improve render function for builtin icons.
This commit is contained in:
parent
a4b286888e
commit
c132ea1d67
1 changed files with 8 additions and 3 deletions
|
@ -6,7 +6,12 @@
|
|||
(:type shape)))
|
||||
|
||||
(defmethod render :builtin/icon
|
||||
[shape & [{:keys [width height] :or {width "500" height "500"}}]]
|
||||
(let [content (:svg shape)]
|
||||
[{:keys [data width height view-box]} & [attrs]]
|
||||
(let [attrs (merge
|
||||
(when width {:width width})
|
||||
(when height {:height height})
|
||||
(when view-box {:viewBox (apply str (interpose " " view-box))})
|
||||
attrs)]
|
||||
|
||||
(html
|
||||
[:svg {:width width :height height} content])))
|
||||
[:svg attrs data])))
|
||||
|
|
Loading…
Add table
Reference in a new issue