Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with vue-loader #27

Open
luveti opened this issue Sep 10, 2016 · 3 comments
Open

Using with vue-loader #27

luveti opened this issue Sep 10, 2016 · 3 comments

Comments

@luveti
Copy link
Contributor

luveti commented Sep 10, 2016

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 luveti changed the title Using vue-loader Using with vue-loader Sep 10, 2016
@luveti
Copy link
Contributor Author

luveti commented Sep 10, 2016

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
Copy link

tvld commented Sep 10, 2016

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 <style> section, not the app.scss as that would load bootstrap.scss multiple times in my project...

@luveti
Copy link
Contributor Author

luveti commented Sep 12, 2016

Thanks for the suggestions @tvld! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants