D
D
Dpy3b2021-10-14 16:55:44
Sprites
Dpy3b, 2021-10-14 16:55:44

I'm using gulp-svg-sprite, is it possible to create something like a snippet or mixin without pug to auto-paste the html path to a sprite in VS Code?

I'm using gulp-svg-sprite, is it possible to create a snippet/ mixin without PUG to auto-compose the path in html to the sprite? Those. when I write conditionally

<svg class="icon">
      <use xlink:href="img/sprite.svg#icon-id"></use>
</svg>

is it possible to implement something like a snippet or mixin to auto-paste the path to a sprite in VS Code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dpy3b, 2021-10-14
@Dpy3b

In short, I learned that there is no unimaginable magic solution for solving such a problem without pug, but you can write all the statics into the snippet, i.e.

<svg class="icon">
      <use xlink:href="img/sprite.svg#"></use>
</svg>

id is not static, you need to write it manually. Either that, or use pug, but personally I don’t need a whole pug for the sake of one mixin yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question