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

Easier way of adding a font? #709

Closed
reggi opened this issue Mar 1, 2017 · 4 comments
Closed

Easier way of adding a font? #709

reggi opened this issue Mar 1, 2017 · 4 comments

Comments

@reggi
Copy link

reggi commented Mar 1, 2017

Looking for an easier way to add a font, I got this working, but it's not very obvious how this works.

head.html

<style type="text/css" media="screen, print">
  @font-face {
    font-family: "FontAwesome";
    src: url("/Fonts/FontAwesome.ttf");
  }
</style>

Then my start script needed:

start-storybook -p 9001 -c .storybook -s ./node_modules/react-native-vector-icons
@ilan-schemoul
Copy link

ilan-schemoul commented Mar 1, 2017

I think -s tells storybook that if there's a request, it must searches in (the) folder(s) passed in the -s argument.
Here you passed ./node_modules/react-native-vector-icons in the -s argument so storybook is looking in this folder when it receives the request Fonts/FontAwesome.ttf.
I'm not an expert, I just started using it, so I may have missed your point but it may also helps.

@reggi
Copy link
Author

reggi commented Mar 2, 2017

@NitroBAY -s allows the passed in folder to serve static files, I get that.

The code above works. I just desire a better way.

@ndelangen
Copy link
Member

You could use custom middleware to serve it.
#435 (comment)

https://github.com/storybooks/react-storybook/blob/master/src/server/middleware.js#L35

Let me know if you need any more help?

@OKNoah
Copy link

OKNoah commented Apr 3, 2019

You could use custom middleware to serve it.
#435 (comment)

https://github.com/storybooks/react-storybook/blob/master/src/server/middleware.js#L35

Let me know if you need any more help?

Dead link btw

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

4 participants