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

CSS incorrect order #318

Closed
callumacrae opened this issue Dec 9, 2016 · 4 comments
Closed

CSS incorrect order #318

callumacrae opened this issue Dec 9, 2016 · 4 comments

Comments

@callumacrae
Copy link

Hello!

I have the following section in my main SCSS file:

// load vendors
$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
@import "~bootstrap-sass/assets/stylesheets/_bootstrap.scss";
@import "~@samknows/css-framework/dst/samknows.css";
@import "vendor/vuejs";

In my output CSS, I'm getting them in the following order:

samknows/css-framework
bootstrap
vuejs

This is pretty critical: build tools shouldn't be changing the order of CSS!

Any idea how I can fix this?

@jhnns
Copy link
Member

jhnns commented Dec 9, 2016

I'm pretty confident that the sass-loader is not changing the order. We have a lot of tests for that. Please remove every other loader and try to remove as much code as possible while the error still occurs. This will help to track down the problem.

@callumacrae
Copy link
Author

callumacrae commented Dec 9, 2016

/**
* a comment
*/

$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/_print.scss";
@import "~bootstrap/dist/css/bootstrap.min.css";

output:

bootstrap
/**
* a comment
*/
bootstrap-sass

Definitely an issue, probably not in sass-loader.

@jgornick
Copy link

jgornick commented Jan 26, 2017

@callumacrae Did you ever solve why the order is not right?

As far as I can tell it has to do with the style-loader and the way in which it inserts CSS into the header. However, I think that due to the nature of lazy loading imports, there's really not a good way to specify an order.

webpack-contrib/style-loader#17

@callumacrae
Copy link
Author

Yeah it was user error - it was one of my Vue modules being required first and adding bootstrap again. Wasn't a problem in this.

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

3 participants