kzima / vuestrap-base-components

Web components that extend Bootstrap 4 - http://kzima.github.io/vuestrap-base-components/#/accordion
MIT License
253 stars 42 forks source link

Using with vue-loader #27

Open luveti opened 8 years ago

luveti commented 8 years ago

My team is looking to implement this into our vue-loader based app and I'm having trouble getting it to work. Do you have any tips on how to get this working with vue-loader? :)

luveti commented 8 years ago

The issue I was having was getting the packaged bootstrap styles to show. I managed to get this to work by adding this code to the style section of my App.vue file (the first component).

@import 'node_modules/vuestrap/bootstrap/bootstrap';

Is this the recommended way of doing this?

tvld commented 8 years ago

As per the instructions, I started of adapting my project's webpack.dev.conf.js to autoload the bootstrap, but I failed. It was getting too confusing and I felt I lost some control. What I ended up doing was:

1 - Create a `palette.scss file with just variables definitions, such as :

/* Primary*/
$primaryDark: #203559;      // Cello
$primaryHighlight: #a6894c; // Driftwood

2 - I created an app.scss based on the contents of variables.scss, note the use of my pallette and the import of the bootstrap at the bottom:

@import "./palette.scss";

// *** BOOTSTRAP ADJUSTMENTS ***

$brand-primary:             $primaryDark !default;  // Cello
$brand-success:             $primaryHighlight !default; // Driftwood
// etc.

@import "../../node_modules/vuestrap/bootstrap/bootstrap.scss";

3 - in my App.vue I added require("./theme/app.scss") to include the bootstrasp overrides. Only include this file ONCE in your project:

4- if I need to use scss overrides in my components I import the pallette again in the