trying Neutrino for the first time to jumpstart a react project. Want to add google fonts to it; tried passing google URLS in as a links array in config/html but no joy. suggestions?
Asked
Active
Viewed 834 times
0
-
[Have you checked the docs?](https://neutrino.js.org/packages/font-loader/) – Marko Gresak Mar 01 '18 at 23:48
1 Answers
1
There are two ways you could load Google fonts into your Web-based Neutrino project.
The easiest would probably be to install the font you would like from npm, such as Works Sans:
npm install --save typeface-work-sans
Which you can then import into your project with:
import 'typeface-work-sans';
The second method would involve the links way you mentioned, by adding an external stylesheet to your local Web-based .neutrinorc.js
(using react
for this example):
// .neutrinorc.js
module.exports = {
use: [
['@neutrinojs/react', {
html: {
links: [
{
href: 'https://fonts.googleapis.com/css?family=Work+Sans',
rel: 'stylesheet'
}
]
}
}]
]
};

Eli
- 17,397
- 4
- 36
- 49