selaux/node-sprite-generator — pull request #31 by filippovdaniil (2014-12-29 08:02:53+00:00)
Title: Improved scss stylesheet template

Sometimes it's necessary to include only some properties of the current sprite's mixin (`background-image`, for example).

I added in the scss stylesheets template new mixins for `background-image`, `background-size`, `background-position`, `width` and `height`, and included them in the main mixin.
Also were added new variables for the each image in sprite. The output scss file now looks like this:

```scss
$foo_x: 0;
$foo_y: 0;
$foo_width: 75px;
$foo_height: 6px;
$foo: $foo_x $foo_y $foo_width $foo_height;
$bar_x: 0;
$bar_y: -6px;
$bar_width: 75px;
$bar_height: 12px;
$bar: $bar_x $bar_y $bar_width $bar_height;
$test_x: 0;
$test_y: -18px;
$test_width: 75px;
$test_height: 6px;
$test: $test_x $test_y $test_width $test_height;

@mixin sprite_image {
background-image: url("./images/png/sprite.png");
}
@mixin sprite_size {
background-size: 75px 78px;
}
@mixin sprite_position($sprite) {
background-position: nth($sprite, 1) nth($sprite, 2);
}
@mixin sprite_width($sprite) {
width: nth($sprite, 3);
}
@mixin sprite_height($sprite) {
height: nth($sprite, 4);
}
@mixin sprite($sprite) {
@include sprite_image;
@include sprite_size;
@include sprite_position($sprite);
@include sprite_width($sprite);
@include sprite_height($sprite);
}
```

I made it only for scss template, but I think that it also should be done for the sass, less and stylus.