-
Notifications
You must be signed in to change notification settings - Fork 6
options.classPrefix
Eugene Lazutkin edited this page Dec 9, 2013
·
5 revisions
Type: String
Default value: 'sprite_'
A string value that is used as a prefix for generated CSS class names.
All examples below assume following source files:
images/icons/16x16/tool.png
images/icons/16x16/help.png
images/icons/32x32/tool.png
images/icons/32x32/help.png
Default configuration:
grunt.initConfig({
tight_sprite: {
icons: {
cwd: "images/icons",
src: ["**/*.png"],
dest: "images/icons.png"
}
}
})The generated CSS files will include following CSS classes:
.sprite_16x16_tool_png ...
.sprite_16x16_help_png ...
.sprite_32x32_tool_png ...
.sprite_32x32_help_png ...'sprite_' is a default value of this options. The rest comes from source file names.
Different prefix:
grunt.initConfig({
tight_sprite: {
icons: {
options: {
classPrefix: "icons-"
}
cwd: "images/icons",
src: ["**/*.png"],
dest: "images/icons.png"
}
}
})The generated CSS files will include following CSS classes:
.icons-16x16_tool_png ...
.icons-16x16_help_png ...
.icons-32x32_tool_png ...
.icons-32x32_help_png ...No prefix:
grunt.initConfig({
tight_sprite: {
icons: {
options: {
classPrefix: ""
}
cwd: "images/icons",
src: ["**/*.png"],
dest: "images/icons.png"
}
}
})The generated CSS files will include following CSS classes:
.16x16_tool_png ...
.16x16_help_png ...
.32x32_tool_png ...
.32x32_help_png ...