Skip to content

Instantly share code, notes, and snippets.

@wagenet
Created June 16, 2014 17:41
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wagenet/79b804eb943b9f3d7594 to your computer and use it in GitHub Desktop.
Save wagenet/79b804eb943b9f3d7594 to your computer and use it in GitHub Desktop.
app.registry.add('css', 'broccoli-compass', 'scss', {
toTree: function(tree, inputPath, outputPath, options) {
// broccoli-compass doesn't like leading slashes
if (inputPath[0] === '/') { inputPath = inputPath.slice(1); }
tree = mergeTrees([
tree,
'public'
], {
description: 'TreeMerger (stylesAndVendorAndPublic)'
});
return compileCompass(tree, inputPath + '/app.scss', {
outputStyle: 'expanded',
require: 'sass-css-importer', // Allows us to import CSS files with @import("CSS:path")
sassDir: inputPath,
imagesDir: 'images',
//fontsDir: 'fonts',
cssDir: outputPath
});
}
});
@sir-dunxalot
Copy link

Incase anyone is wondering, this [awesome] solution works with the following npm modules installed and required above the code in this gist:

var mergeTrees = require('broccoli-merge-trees');
var compileCompass = require('broccoli-compass');

@quaertym
Copy link

quaertym commented Aug 1, 2014

@wagenet I have turned this into ember-cli-compass-compiler addon which I think makes it easier to use since it is a single line install and it can be updated easily. It is installed with a single command, please take a look.

npm install --save-dev ember-cli-compass-compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment