Answer the question
In order to leave comments, you need to log in
Connecting and using svg icons in css?
Hello!
Question on the subject, more specifically how to declare style classes referring to the svg file:
@font-face {
font-family: "Font Custom";
font-style: normal;
font-weight: 900;
src: url("/static/fonts/font-custom.svg") format("svg");
}
.foobar {
font-family: "Font Custom";
}
Answer the question
In order to leave comments, you need to log in
Everything came to me, the problem was that I did not mention that the whole thing was going on webpack, before that I used raw-loader for svg, in short, this rule solved my problem:
module: {
rules: [
{
test: /\.(eot|svg|woff|woff2|ttf)$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: 'static/fonts/'
}
}]
},
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question