Skip to content
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

custom fonts are not loaded #78

Closed
tobiasbueschel opened this issue Mar 30, 2017 · 1 comment
Closed

custom fonts are not loaded #78

tobiasbueschel opened this issue Mar 30, 2017 · 1 comment

Comments

@tobiasbueschel
Copy link

I'm trying to use a custom font by referencing it in app.css. Unfortunately, it only works if I declare it in index.html. Maybe Webpack does not properly resolve the path?

Not working:

/* app.css */

@font-face {
   font-family: "CustomFont";
   src: url(/fonts/Custom-Font.otf) format("opentype");
}

Working:

/* index.html */

<style type="text/css">
@font-face {
   font-family: "CustomFont";
   src: url(/fonts/Custom-Font.otf) format("opentype");
}
</style>
@phra
Copy link
Member

phra commented Mar 30, 2017

that is because of this.

import() and url() are managed by webpack itself so you have to put there the filesystem relative path or disable this feature if you want to let the browser to deal with that.

@phra phra closed this as completed Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants