How to use compass mixins in a project using Sass

2019-09-01 10:42发布

问题:

ColorZilla's gradient editor says

// needs latest Compass, add '@import "compass"' to your scss

Well I've found that's not so easy. Obviously if you just throw @import "compass"; at the top of your .scss file, Sass won't compile because _compass.scss can't be found.

  • This is an asp.net project utilizing Sass. In addition, I have to use the sass ruby gem to compile, not compass's compiler.
  • I've installed the compass gem. I've followed the instructions on http://compass-style.org/install/. I've run compass init, compass create, compass install. None of them even give me compass's mixins.

I expected this to work like bourbon, though I know this isn't compass's primary goal.

What am I missing?

回答1:

  1. Install the library

    bower install compass-sass-mixins

  2. Import the compass into your SASS file

    @import "bower_components/compass-sass-mixins/lib/compass"

  3. Checkout SASS function list:

    https://github.com/askucher/compass-sass-mixins