Categories
Vue Answers

How to add global CSS in Vue.js?

Spread the love

Sometimes, we want to add global CSS in Vue.js.

In this article, we’ll look at how to add global CSS in Vue.js.

How to add global CSS in Vue.js?

To add global CSS in Vue.js, we can import our global CSS file in main.js.

For instance, in main.js, we write

import "./assets/css/main.css";

to import the styles in ./assets/css/main.css globally.

Conclusion

To add global CSS in Vue.js, we can import our global CSS file in main.js.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *