Skip to content
Eugene Lazutkin edited this page Dec 9, 2013 · 6 revisions

Type: String Default value: ''

A string value that specifies a color to be used as a background. By default it is empty, which means to use a transparent background.

Valid CSS color constants can be used as this property's value. Please consult CSS Color Module Level 4 for more details.

Examples

Example #1

Use the default (a transparent background):

grunt.initConfig({
  tight_sprite: {
    // describe my sprite
    icons: {
      cwd: "images/icons",
      src: ["**/*.png"],
      dest: "images/icons.png"
    }
  }
})

Example #2

Use white as a background:

grunt.initConfig({
  tight_sprite: {
    // describe my sprite
    icons: {
      options: {
        background: "white"
      },
      cwd: "images/icons",
      src: ["**/*.png"],
      dest: "images/icons.png"
    }
  }
})

Example #3

Use red as a background:

grunt.initConfig({
  tight_sprite: {
    // describe my sprite
    icons: {
      options: {
        background: "#f00"
      },
      cwd: "images/icons",
      src: ["**/*.png"],
      dest: "images/icons.png"
    }
  }
})

Example #4

Use green as a background:

grunt.initConfig({
  tight_sprite: {
    // describe my sprite
    icons: {
      options: {
        background: "#00FF00"
      },
      cwd: "images/icons",
      src: ["**/*.png"],
      dest: "images/icons.png"
    }
  }
})

Example #5

Use blue as a background:

grunt.initConfig({
  tight_sprite: {
    // describe my sprite
    icons: {
      options: {
        background: "RGB(0, 0, 255)"
      },
      cwd: "images/icons",
      src: ["**/*.png"],
      dest: "images/icons.png"
    }
  }
})

Clone this wiki locally