mirror of
https://github.com/penpot/penpot.git
synced 2025-05-05 15:35:52 +02:00
17 lines
461 B
Clojure
17 lines
461 B
Clojure
(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])))
|