0.1.0 • Published 10 years ago

grunt-gss-c v0.1.0

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

grunt-gss

Google Stylesheets plugin for Grunt.

Getting Started

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 --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-gss');

The "gss" task

Overview

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.
    },
  },
});

Options

options.compilerPath

Type: String Default value: '.'

A string value that is used to locate closure-stylesheets.jar.

options.flags

Type: String Default value: ''

Any additional parameters to closure-stylesheets.jar should be written here.

options.closureRenaming.rename

Type: Boolean Default value: false

If set, stylesheets will processed with --rename CLOSURE paramter.

options.closureRenaming.outputFile

Type: String Default value: 'cssMap.js'

File name where css name mapping will be saved.

options.closureRenaming.excludeRenameClasses

Type: Array.<String> Default value: []

List of names to exclude when minifying gss.

Usage Examples

  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'
          }
        }
      }
    }
  });