-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@import doesn't work for fonts #101
Comments
Having the same problem. Any files referenced inside the Here's my
I am in the
Using
Using either
If, however, I do this instead, it works – but it isn't ideal:
|
@selfagency One solution (although it increases project complexity, as you have to keep it outside of your .scss file that uses it) is to put all @imports inside .scss imported via nuxt's scss as oposed to the loader. |
Yes, that's what I wound up doing above, at the end. |
Use
That works well for me. |
This is the right answer!, thank you so much. So when referencing fonts to include in a |
You could try erase that last slash.
font-face statement:
@font-face {
font-family: "Bagnard";
src: url("~assets/fonts/BagnardSans.otf");
}
El mié., 3 de marzo de 2021 3:51 p. m., Maksym Portianoi <
[email protected]> escribió:
… Use ~assets, for example:
@font-face {
font-family: 'FontAwesome';
src: url('~assets/fonts/fontawesome/fontawesome-webfont.eot?v=4.7.0');
src: url('~assets/fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),
url('~assets/fonts/fontawesome/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
url('~assets/fonts/fontawesome/fontawesome-webfont.woff?v=4.7.0') format('woff'),
url('~assets/fonts/fontawesome/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),
url('~assets/fonts/fontawesome/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
That works well for me.
For some reason it produces this error for me:
Error: Can't resolve '~assets/fonts/BagnardSans.otf/'
CSS font-face statement:
@font-face {
font-family: "Bagnard";
src: url("~assets/fonts/BagnardSans.otf/");
}
Any idea what might be wrong?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJRFYYL6KO7NGNXWDC4Q2DLTB3DQ5ANCNFSM4KZSSGDA>
.
|
if you want to use google fonts, try to use the link import.
on Nuxt.js edit the nuxt.config.js
this worked for me |
I have a fresh installation of nuxt with nothing but this package installed.
The config is as such:
Now, the file that package is meant to import is:
assets/scss/imports/fonts.scss
Which only contains this:
@import url("http://fonts.googleapis.com/css?family=Open+Sans:400,700|Quicksand:400,700");
.. and the error is:
Note: I've tried all variations of it, with and without url, with and without quotation marks, ending url with .css and so on.
The text was updated successfully, but these errors were encountered: