Closed danielmariz closed 10 years ago
The LESS functions are not unique to the variables and serve the same purpose. There should be no issue by having multiple copies of them. If you want to hide a set, then they can be disabled via cssOpts
:
'my-task': {
// src, destImg, ..
cssOpts: {
functions: false
}
}
https://github.com/Ensighten/grunt-spritesmith/tree/2.20.0#usage
If you would really like to have the different names for the same functions though, this can be done via generating a new template and loading it via cssTemplate
:
'my-task': {
// src, destImg, ..
cssTemplate: 'my/custom/less/template.less'
}
https://github.com/Ensighten/grunt-spritesmith/tree/2.20.0#usage
Thank you
@twolfson Do you know if is there a way to auto generate all classes pattern for all sprites?
Something like
for all @icon-* .icon-[item]{ .sprite(@icon-[item]); } end for
The CSS template is built for this. Moving to a .css
extension will change the generated content's template.
https://github.com/twolfson/json2css/blob/5.2.1/test/expected_files/css.css
destCSS: '<%= scaffold.dev.assets %>/less/sprite-icons.css',
In 3.5.0
we have added spritesheet
variables. The spritesheet-sprites
variable references each sprite in order and can be iterated in that fashion. Please see the included sprites
mixin in your generated output for a template to work from.
Here is an example output:
https://github.com/twolfson/spritesheet-templates/blob/8.2.0/test/expected_files/less.less#L47-L51
https://github.com/twolfson/spritesheet-templates/blob/8.2.0/test/expected_files/less.less#L90-L103
similar to this issue: https://github.com/Ensighten/grunt-spritesmith/issues/93
I need two tasks like that
But when I generate those less files I have the same less functions
How can I customize thos functions names?