Skip to content
Loek van Gent edited this page Apr 16, 2014 · 12 revisions

Prerequisites

Homebrew (Mac OS X only)

Follow the instructions here: http://brew.sh/.

Node

You need a working nodejs install including the npm package manager. On a mac you can install node via homebrew with the command:

brew install node

This will install npm as well.

On windows you can use the installer.

For more info, look here: http://nodejs.org/

On linux, use apt-get to install node.

sudo apt-get install nodejs

NB Make sure not to install an package called node here!

Ruby

You need a working ruby install, because sass is written in Ruby. On Mac OS ruby is installed by default. On linux you can accomplish this by running:

sudo apt-get install ruby - Debian, Ubuntu

For other systems, see this: https://www.ruby-lang.org/en/installation/#package-management-systems.

Ruby version manager

It's also possible to install the Ruby Version Manager (RVM). RVM is a shell wrapper for ruby, which gives you the added benefit of changing ruby versions easily and installing gems in your home dir, thus not having to use the sudo command (and many more). This is more for advanced users. The above mentioned approach should work fine, and is more suited for the live environment.

For more info, check https://rvm.io/.

Compass

You also need to install compass (a ruby gem).

gem install compass

Some systems need the use of sudo to install gems (depending on where the gems are located):

sudo gem install compass

Grunt modules

You need to install the grunt modules for compass. This is already added to the package.json file. You can install it with the command:

npm install

It is possible that your system will complain about not having a grunt-cli available. Then install this as well

npm install grunt-cli

Your system should now be ready to render sass.

Commands

There are two grunt tasks currently available for rendering the sass.

grunt compass:dev - for development usage. This will render the css unminified and put in debug information.

grunt compass:dist - for distribution. The will minify the sass.

grunt watch - this task watches the sass directory for changes, and runs the compass:dev task if anything changes. For development.

Note on new projects

When creating a new project, the Gruntfile has to be added to the project. You can copy one over from an existing project, and adjust the paths. You also have to either add the dependencies by hand (in the package.json file) or run npm install grunt-contrib-compass --save to install and automatically save it to the package.json file.

Improvements

  • Maybe reference bluebottle in the env folder. Now it is a relative path to the bluebottle folder.