I have a compass task running on grunt which produces a compiled base.css file and also a number of page specific css files. The base.scss @imports a _settings.scss partial which dictates some global setup for all files.
compass: {
theme: {
options: {
sassDir: '/sass',
cssDir: 'css',
fontsPath: 'css/fonts',
imagesPath: 'img'
}
}
}
I want to be able to call the compass task multiple times but each time somehow stipulate that a different settings file is imported in base.scss and a uses different cssDir for the output. Is this achievable?
I have tried to use the approach below involving essentially adding to compasses config.rb (via raw) in two different compass tasks. Each task includes a different import path to a directory containing a settings file. This settings file is then picked up as an @import settings.scss at the top of my base.scss.
compass: {
theme: {
options: {
httpPath: '/',
sassDir: '/sass',
cssDir: 'css',
raw: 'add_import_path "/sass/theme"'
}
},
theme2: {
options: {
httpPath: '/',
sassDir: '/sass',
cssDir: 'css',
raw: 'add_import_path "/sass/theme2"'
}
}
}
This seems to work and although it feels like a hack it's the closest I've got to a working solution. It seems like there should be a way to do this but so far the solution has alluded me.
I'm now wondering if I can use registerTask() to create the functionality I need in approach something like the one I found here: