-
Notifications
You must be signed in to change notification settings - Fork 6
options.includePath
Eugene Lazutkin edited this page Mar 18, 2014
·
4 revisions
Type: Boolean
Default value: true
A boolean value that indicates if an image file's path should be included in a generated CSS class name.
Usually this flag is used when sources include files with the same names but in different folders. If paths are not included, then generated CSS classes may accidentally collide.
All examples below assume following source files:
images/icons/16x16/tool.png
images/icons/16x16/help.png
Default configuration:
grunt.initConfig({
tight_sprite: {
icons: {
options: {
hide: "images/icons/"
},
src: ["images/icons/**/*.png"],
dest: "images/icons.png"
}
}
})
The generated CSS files will include following CSS classes:
.sprite_16x16_tool ...
.sprite_16x16_help ...
Exclude image file's path, while generating CSS class names:
grunt.initConfig({
tight_sprite: {
icons: {
options: {
includePath: false,
hide: "images/icons/"
},
src: ["images/icons/**/*.png"],
dest: "images/icons.png"
}
}
})
The generated CSS files will include following CSS classes:
.sprite_tool ...
.sprite_help ...