Google Stylesheets plugin for Grunt.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-gss-c --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-gss-c');
In your project's Gruntfile, add a section named gss
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
gss: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value: '.'
A string value that is used to locate closure-stylesheets.jar.
Type: String
Default value: ''
Any additional parameters to closure-stylesheets.jar should be written here.
Type: Boolean
Default value: false
If set, stylesheets will processed with --rename CLOSURE paramter.
Type: String
Default value: 'cssMap.js'
File name where css name mapping will be saved.
Type: Array.<String>
Default value: []
List of names to exclude when minifying gss.
grunt.initConfig({
gss: {
options: {
compilerPath: '.'
},
dev: {
src: ['css/styles.gss'],
dest: 'css/styles.css',
options: {
flags: ['--pretty-print']
}
},
prod: {
src: ['css/styles.gss'],
dest: 'css/styles.css',
options: {
closureRenaming: {
rename: true,
excludeRenameClasses: ['excluded-class-name'],
outputFile: 'cssMap.js'
}
}
}
}
});