I've created a new Vue application in which I'm using Bootstrap-Vue for styling, and I'm currently facing issues trying to override the default style of Bootstrap.
Error message: [sass] Undefined variable.
11 │ $b-custom-control-indicator-size-lg: $custom-control-indicator-size * 1.25 !default;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
node_modules/bootstrap-vue/src/_variables.scss 11:38 @import
node_modules/bootstrap-vue/src/index.scss 7:9 @import
src/app.scss 7:9 root stylesheet
Steps to reproduce:
npm create vue@2, not using Typescriptnpm install bootstrap bootstrap-vuenpm add -D sass sass-loaderapp.scss: Placed in /src
// Define variable defaults
$body-bg: #000;
$body-color: #111;
// Then import Bootstrap and BootstrapVue SCSS files (order is important)
@import 'node_modules/bootstrap/scss/bootstrap.scss';
@import 'node_modules/bootstrap-vue/src/index.scss';
main.js:
import Vue from "vue";
import App from "./App.vue";
import { BootstrapVue, IconsPlugin } from "bootstrap-vue";
import "./assets/main.css";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
import './app.scss'
Vue.use(BootstrapVue);
Vue.use(IconsPlugin);
new Vue({
router,
render: (h) => h(App),
}).$mount("#app");
Update: Realised that the reason for this error is because I was using the wrong version of Bootstrap! Was using Bootstrap 5 instead of 4.
Hope this helps someone else in the future!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With