Closed hiravebapu closed 5 years ago
These docs explain how to reference local assets. 🙂
Hi! @chrisvfritz
Could you please, help here.
I was trying to use the option that provided in the doc you mentioned. But it works only if I import the fonts inside the component within the
<style lang="scss" module>
tag, but I need to import those fonts inside the scss file like this
// design/base/_fonts.scss
@font-face {
font-family: 'Intro Book';
src: url('@assets/fonts/Intro-Book.eot?#iefix') format('embedded-opentype'),
url('@assets/fonts/Intro-Book.woff2') format('woff2'),
url('@assets/fonts/Intro-Book.woff') format('woff');
font-weight: normal;
font-style: normal;
}
If I try like this I'll get an error that the relative file can't be loaded.
So, I tried the relative path /src/assets/fonts/......
and with this approach, it doesn't work either.
while developing it says - 'Failed to decode downloaded font' and after the build it doesn't copy files to the dist folder.
Could you please clarify, how to utilize local fonts within the .scss files?
Thanks!
As noted in those docs, you're missing an ~
before @assets
.
How do you support custom fonts from local directory ?