Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Spritesmith mixins #9

Closed
mikestreety opened this issue Apr 28, 2014 · 0 comments
Closed

Add Spritesmith mixins #9

mikestreety opened this issue Apr 28, 2014 · 0 comments

Comments

@mikestreety
Copy link
Contributor

As we are starting to use spritesmith, would be good if we can fold in the spritesmith mixins - so we can have them with a custom name.

To stop them being generated, put this in gulp file:

twolfson/grunt-spritesmith#63 (comment)

The mixins need to replicate the following:

@mixin sprite-width($sprite) {
  width: nth($sprite, 5);
}

@mixin sprite-height($sprite) {
  height: nth($sprite, 6);
}

@mixin sprite-position($sprite) {
  $sprite-offset-x: nth($sprite, 3);
  $sprite-offset-y: nth($sprite, 4);
  background-position: $sprite-offset-x  $sprite-offset-y;
}

@mixin sprite-image($sprite) {
  $sprite-image: nth($sprite, 9);
  background-image: url(#{$sprite-image});
}

@mixin sprite($sprite) {
  @include sprite-image($sprite);
  @include sprite-position($sprite);
  @include sprite-width($sprite);
  @include sprite-height($sprite);
}```
mikestreety pushed a commit that referenced this issue May 8, 2014
mikestreety pushed a commit that referenced this issue May 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant