I'm new in webpack and i don't know how we can use Compass ( CSS Authoring Framework ) in a project.
Is there a good method ?
Thanks
I'm new in webpack and i don't know how we can use Compass ( CSS Authoring Framework ) in a project.
Is there a good method ?
Thanks
you can use compass-mixins
here is a helpful webpack boilerplate
Update:
You can use sass-resources-loader that will @import your SASS resources into every required SASS module. where you will never have to import your resources in all your sass files.please check the implementation in action in this boilerplate
Since compass is a half-ruby and a half-sass framework, compass-mixins may work incorrectly whith legacy scss code.
To enable the original compass in your webpack config, you should use:
ruby-sass-loader
with the
compass
option.Essential addition to @Ayman Jitan answer https://stackoverflow.com/a/34967698/1114926.
You have to add these two lines at top of your
styles.scss
file:Otherwise you'll get errors from
sass-loader
"Module build failed" and "No mixin" found. Like the following"If you add only
@import "compass/functions";
(without@import "compass";
), you may get this error (depends on the mixin you include, in my case it was thrown by@include background(linear-gradient(white, #cccccc, #aaaaaa));
):