C
C
cyberlain2018-10-11 13:19:16
Pug
cyberlain, 2018-10-11 13:19:16

How to insert an argument into an attribute value in a pug mixin?

Here is a mixin that doesn't compile. You just need to insert the src of the image in style.
I tried without brackets and without a lattice - it's useless ... How is this done correctly?

mixin team(img_src)
  span.team-card__photo(style="background-image: url("=#{img_src}");")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2018-10-11
@cyberlain

mixin team(img_src)
    span.team-card__photo(style=`background-image: url(${img_src})`)

P
Puma Thailand, 2015-07-08
@Libris

shape-rendering="crispEdges"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question