How do we use svg icons with this plugin? #45
Unanswered
mybardaklar
asked this question in
Q&A
Replies: 1 comment 7 replies
-
|
Hi @mybardaklar, you can see the usage examples on demo site hello-world and their sources. Pug plugin add all SVG-image attributes to inline SVG-tag: img.logo(src=require('logo-image.svg') with=100 height=200)Generated HTML <svg viewBox="0 0 200 200" class="logo" with=100 height=200>
<path d="m600 0 530.3 300v600l-530.3 300-530.3-300v-600z" fill="#fff"></path>
...
</svg>Pug plugin can inline SVG/PNG/JPG/etc using Webpack option // force inline images containing `?inline` query
{
test: /\.(png|svg)$/i,
type: 'asset/inline',
resourceQuery: /inline/,
},See please other usage examples webpack-pug-scss-js-starter
|
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, its an amazing plugin!
But i have a question. How can i use svg icons with this plugin? There is no information in documents about this. For example i was using posthtml-inline-svg with posthtml-loader. But with this plugin i cannot use posthtml-loader. With posthtml-inline-svg, i can use some svg attrs like witdh, height, fill and other attrs. But how am i gonna use kind of things with this plugin ?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions