API: The css Property
Nuxt.js lets you define the CSS files/modules/libraries you want to set globally (included in every page).
In case you want to use sass
make sure that you have installed node-sass
and sass-loader
packages. If you didn't just
npm install --save-dev node-sass sass-loader
- Type:
Array
- Items:
string
- Items:
In nuxt.config.js
, add the CSS resources:
export default {
css: [
// Load a Node.js module directly (here it's a Sass file)
'bulma',
// CSS file in the project
'@/assets/css/main.css',
// SCSS file in the project
'@/assets/css/main.scss'
]
}
Nuxt.js will automatically guess the file type by its extension and use the appropriate pre-processor loader for webpack. You will still need to install the required loader if you need to use them.
← cli components →
Contributors
![Atinux](https://github.com/Atinux.png?size=32)
![alexchopin](https://github.com/alexchopin.png?size=32)
![mamboer](https://github.com/mamboer.png?size=32)
![Tabrizian](https://github.com/Tabrizian.png?size=32)
![Haeresis](https://github.com/Haeresis.png?size=32)
![pi0](https://github.com/pi0.png?size=32)
![Thivieira](https://github.com/Thivieira.png?size=32)
![tapitapeh](https://github.com/tapitapeh.png?size=32)
![andrewjrhill](https://github.com/andrewjrhill.png?size=32)
![gahissy](https://github.com/gahissy.png?size=32)
![wanderingcrow](https://github.com/wanderingcrow.png?size=32)
Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!