You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-global-stylesheet-simple)
2
+
3
+
## Global Stylesheet Example (Simple Version - CSS inside `node_modules`)
4
+
5
+
This is an example of importing a CSS file located inside `node_modules` (ones you downloaded using `npm` or `yarn`).
6
+
7
+
This would be useful for importing CSS libraries such as [`normalize.css`](https://necolas.github.io/normalize.css/).
8
+
9
+
### What if I want to import my own CSS, such as `styles/foo.css`?
10
+
11
+
Check out the [with-global-stylesheet](../with-global-stylesheet) example.
12
+
13
+
### How It Works
14
+
15
+
- Install `babel-plugin-inline-import` using `npm` or `yarn`
16
+
- Then, add this to your `.babelrc`:
17
+
18
+
```js
19
+
{
20
+
"plugins": [
21
+
[
22
+
"inline-import",
23
+
{
24
+
"extensions": [".css"]
25
+
}
26
+
]
27
+
],
28
+
"presets": ["next/babel"],
29
+
"ignore": []
30
+
}
31
+
```
32
+
33
+
- Install any CSS library using `npm` or `yarn`. In this example, I installed [`tachyons`](http://tachyons.io/).
34
+
- Import the CSS file. Here, I'm importing a CSS file located at `node_modules/tachyons/css/tachyons.min.css`.
0 commit comments