Best way to have global css in Vuejs
I found the best way is to create a new file in the assets folder, I created as global.css
but you can name anything of your choice. Then, import this file global.css
file in the main.js
.
Note: Using this approach you can also create multiple files if you think the global.css is getting really large then simply import all those files in the main.js.
@\assets\global.css
/* move the buttons to the right */.buttons-align-right { justify-content: flex-end;}
main.js
import Vue from 'vue'import App from './App.vue'import router from './routes'Vue.config.productionTip = false// Importing the global css fileimport "@/assets/global.css"new Vue({ router, render: h => h(App)}).$mount('#app')