F
F
fedor_vezesuschyj2017-10-10 15:55:53
HTML
fedor_vezesuschyj, 2017-10-10 15:55:53

Why doesn't pug mixin work with svg?

I use this
mixin mixin icon(name)
svg(class="icon icon-#{name}")
use(xlink:href="img/svg-sprite.svg##{name}")
tried this
mixin icon( name)
svg(class="icon icon-" +name)
use(xlink:href="img/svg-sprite.svg#" + name)
call
+icon(phone)
substitutes NaN for name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hrenly, 2017-10-19
@hrenly

Is there a phone variable? you either pass a string
or a variable
+icon(phone)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question