1

Here is the SASS grunt-contrib-sass portion of my Gruntfile:

sass: {
    dist: {
        options: {
            style: 'compressed',
            require: ['zurb-foundation', 'bourbon']
        },
        files: {
            'dist/css/styles.css': 'src/sass/app.scss'
        }
    }
},

What I'm trying to do is require both the Foundation framework and Bourbon mixin library. When I try to compile, it says the path to read in the Foundation files is not readable (or supplied) even though they are installed on my system (I've used Codekit in the past with Compass, but want to move away from it). Is there something specific I'd have to do add to pull-in these gems? Thanks!

Zach
  • 1,185
  • 3
  • 24
  • 60

1 Answers1

1

Let's take Bourbon as an example; if the gem is installed on your system (it appears in the gem list command), you will need to install it into your stylesheets directory and also import it. E.g.

@import 'bourbon/bourbon';

body {
    margin: 0
}

/* ... */

This follows the documentation on bourbon.io; I don't think it's enough to just specify Bourbon in the require config. Look at the Foundation docs and it will also tell you to @import the library.

Hope this helps.

Ben
  • 10,106
  • 3
  • 40
  • 58
  • I went ahead and tested this out; you do need to install bourbon (`bourbon install`) to your project (go ahead and add the path to the gitignore if you're using git) and then `@import` it. Once you've done this you'll be able to use it with the `grunt-contrib-sass` task. :-) – Ben Sep 16 '13 at 21:02
  • What I'm trying to figure out is what the purpose of `require` is then. In a Compass `config.rb` file, I can just use `require 'zurb-foundation'` and can reference the Foundation framework (that is held in the gem file) as I am trying to do now. From what I'm understanding, are you saying I'd need to have a copy of Foundation in my project? Seems a bit different than what I would expect to happen by requiring a gem. Thanks. – Zach Sep 17 '13 at 01:46
  • I've not tried this for your use case, but I did manage to get `grunt-contrib-sass` to `require` a Ruby script in my project directory to extend Sass with a custom function for another website. Might be right in saying therefore that you could have a `config.rb` just like you do at the moment, and use *that* in `require`. – Ben Sep 17 '13 at 07:54
  • Word. I'll give the compass flag a shot tonight, see how that goes and report back. Thanks. – Zach Sep 18 '13 at 11:40
  • Ended up deciding just using the compass grunt plugin suited my needs a bit more here, but will continue to play around with the sass one since I'd rather use bourbon – Zach Sep 19 '13 at 02:23