Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2013 18:09
Show Gist options
  • Save anonymous/5775950 to your computer and use it in GitHub Desktop.
Save anonymous/5775950 to your computer and use it in GitHub Desktop.
Update a PHP constant after compiling Sass
module.exports = function(grunt) {
grunt.initConfig({
// [other stuff...]
compass: {
options: {
sassDir: 'sass',
javascriptsDir: 'javascripts',
fontsDir: 'fonts',
outputStyle: 'compressed',
environment: 'production'
},
rTheme: {
options: {
importPath: 'sass/r-only',
httpPath: '/wp-content/themes/r/',
cssDir: 'stylesheets',
imagesDir: 'img'
}
},
fTheme: {
options: {
importPath: '../f/sass/',
cssDir: '../f/stylesheets',
imagesDir: '../f/img',
httpPath: '/wp-content/themes/f/'
}
}
},
setPHPConstant: {
styles: {
constant: 'R_STYLES_UPDATED',
value: '<%= grunt.template.today("yyyymmddHHMMss") %>',
file: 'functions.php'
}
},
// [other stuff...]
// Tasks
grunt.registerTask('styles', ['compass', 'setPHPConstant:styles']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment