0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00
penpot/frontend/uxbox/shapes.cljs

18 lines
461 B
Text
Raw Normal View History

(ns uxbox.shapes
(:require [sablono.core :refer-macros [html]]))
(defmulti render
(fn [shape & params]
(:type shape)))
(defmethod render :builtin/icon
[{: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 attrs data])))