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

fonts in meteor /public directory #268

Closed
macrozone opened this issue Jun 22, 2016 · 2 comments
Closed

fonts in meteor /public directory #268

macrozone opened this issue Jun 22, 2016 · 2 comments

Comments

@macrozone
Copy link
Contributor

macrozone commented Jun 22, 2016

Hi guys,

I have fonts in the /public directory of meteor, say in /public/fonts/myfont.ttf

I now declare font-face in a scss file like this:

@font-face {font-family: 'myfont';
  src: url('/fonts/myfont.scss');
}

Using absolute paths like above works fine locally in meteor and in storybook.

However, if i publish this to github pages (to company.github.io/myproject/), the fonts will not load, because they are resolved to company.github.io/fonts/myfont.scss instead of company.github.io/myproject/fonts/myfont.scss.

I therefore tried to change to relative paths, but i did not manage to have a setup, where every three environments work.

In particular webpack complains about not finding the font during build-time, when i pass a relative path. But i don't understand why webpack even tries to resolve these paths...

I also tried to add to head.html in .storybook-folder, but this will break loading js files for the static storybook. But fonts get still loaded from the parent directory.

Any idea how to deal with this?

@arunoda
Copy link
Member

arunoda commented Jun 22, 2016

Yes. I can understand the pain. Looking for some ideas to get around with this.

@arunoda
Copy link
Member

arunoda commented Aug 3, 2016

We are going to fix this with #344.
So, I'll move the discussion to there.

@arunoda arunoda closed this as completed Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants