🎉 Include sprite inline in a template.

This commit is contained in:
Andrey Antukh 2020-11-12 13:35:20 +01:00 committed by Alonso Torres
parent 4ad08a7449
commit e5ea8bf302
5 changed files with 846 additions and 226 deletions

View file

@ -10,11 +10,9 @@
(ns app.main.ui.icons
(:require [rumext.alpha]))
(def base-uri "/images/svg-sprite/symbol/svg/sprite.symbol.svg#icon-")
(defmacro icon-xref
[id]
(let [href (str base-uri (name id))]
(let [href (str "#icon-" (name id))]
`(rumext.alpha/html
[:svg {:width 500 :height 500}
[:use {:xlinkHref ~href}]])))