React-styleguidist: Is there any recommended method to include google font in the style guide?

Created on 24 Aug 2017  Â·  2Comments  Â·  Source: styleguidist/react-styleguidist

I want to load a google font into my style guide app, I don't want to bundle it inside the component css because later on I will add a link in the index.html.

Is there a way to include the <link href="https://fonts.googleapis.com/css?family=Roboto:400" rel="stylesheet"> in the index.html of the builded version of styleguidist?

What I'm doing at the moment is including some css via the config:

 require: [
    path.join(__dirname, 'css/fontawesome.css'),
    path.join(__dirname, 'css/roboto.css'),
  ],

And inside roboto.css I'm doing the import @import url('https://fonts.googleapis.com/css?family=Roboto:400');

The problem is that this will make multiple js bundle for every font once you build it, and if it's possible I would prefer to avoid it, is there a way to just include a link in the html instead?

question

Most helpful comment

Is there a way to include the in the index.html of the builded version of styleguidist?

With a custom HTML template.

All 2 comments

Is there a way to include the in the index.html of the builded version of styleguidist?

With a custom HTML template.

Thanks that works perfectly, I've missed it!

Was this page helpful?
0 / 5 - 0 ratings