Is it possible to specify a variable in SASS from GruntFile.js before compiling with Grunt-contrib-sass?
For example, if absolute paths were needed in CSS, the path could be determined by a Gruntfile based on a dev assembly or deployment assembly.
For those familiar with LESS ( https://github.com/gruntjs/grunt-contrib-less ), this will be SASS, equivalent to LESS ' modifyVars.
GruntFile Example
...
sass: {
deploy: {
vars: {
absolute: "http://www.example.com/"
}
},
dev: {
vars: {
absolute: "/local_path/"
}
}
}
...
SASS Example
.element {
background-image: url("#{absolute}image.jpg");
}
Jason source
share